I need to get the mobile user's current position using the simplest method without using too much resources of the mobile phone. Please explain me the best way to accomplish this.
Please refer this resource.
Lean to get gps location in android using LocationManager and LocationListener. Add permissions to your manifest file:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 2000, 10, this);`
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Please refer this resource.
Lean to get gps location in android using LocationManager and LocationListener.
Add permissions to your manifest file:
Then you need to get location using below code snippet:
`locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER,
2000,
10, this);`