How to use Accelerometer to measure distance for Android Application Development

You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice. Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video. Similar questions: track small movements of iphone with no GPS What is the real world accuracy of phone accelerometers when used … Read more

Convert magnetic field X, Y, Z values from device into global reference frame

In my comment on the checked answer on the link you provided above, I referred to my simple answer at calculate acceleration in reference to true north Let me answer here again with more clarification. The answer is the product of the rotation matrix and the magnetic field values. If you read further on the … Read more

My Algorithm to Calculate Position of Smartphone – GPS and Sensors

As some of you mentioned you got the equations wrong but that is just a part of the error. Newton – D’Alembert physics for non relativistic speeds dictates this: // init values double ax=0.0,ay=0.0,az=0.0; // acceleration [m/s^2] double vx=0.0,vy=0.0,vz=0.0; // velocity [m/s] double x=0.0, y=0.0, z=0.0; // position [m] // iteration inside some timer (dt … Read more

How do I find out if the GPS of an Android device is enabled

Best way seems to be the following: final LocationManager manager = (LocationManager) getSystemService( Context.LOCATION_SERVICE ); if ( !manager.isProviderEnabled( LocationManager.GPS_PROVIDER ) ) { buildAlertMessageNoGps(); } private void buildAlertMessageNoGps() { final AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(“Your GPS seems to be disabled, do you want to enable it?”) .setCancelable(false) .setPositiveButton(“Yes”, new DialogInterface.OnClickListener() { public void onClick(@SuppressWarnings(“unused”) final … Read more