Entertainment

Saturday, 13 August 2016

Android and Databases

● Access to remote database e.g. MySQL can occur using a PHP script hosted on the server performing the query and JSON formatting for data exchange for reference check out the Database
 
● Local light weight database system.
http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html

Accelerometer and Access to other Sensors

● An instance of the SensorManager is required in order to
retrieve informations about the supported sensors.

● No permission is required to access the sensor service. It is

then possible to retrieve the list of available sensors of a
certain type.

● For an accelerometer sensor, the type to use is given by the Sensor.TYPE_ACCELEROMETER constant.

● If at least one Sensor exists, it is possible to register a
SensorEventListener for a Sensor of the list.

● It is possible to specify the delivering rate for sensor
events. Specified rate must be one of :

SensorManager.SENSOR_DELAY_FASTEST : as fast as
possible
 
SensorManager.SENSOR_DELAY_GAME : rate suitable for
game
 
SensorManager.SENSOR_DELAY_NORMAL : normal rate
 
SensorManager.SENSOR_DELAY_UI : rate suitable for UI
Thread

Sunday, 20 March 2016

           Android Upload Image to Server Using PHP MySQL


if you liked the demonstration of Android Upload Image to Server App then go ahead to know how you can do this. Lets start creating our Android Upload Image to Server Project.
This Android Upload Image to Server is having two parts
  1. PHP MySQL
  2. Android Studio
Lets start with PHP MySQL for your Android Upload Image to Server app.

Android Upload Image to Server – PHP MySQL Part

  • I am using hostinger hosting as my web server.
  • So go to your hosting accounts PhpMyAdmin and create a new table.
  • I have created the following table
  • Now we need to create a php script for our database connection
  • Create a new file named dbConnect.php and write the following code


    • Now we need one more php script to get and save our image sent from android device
    • Create a new file upload.php and write the following code



  • Create a new file upload.php and write the following code