GoogleApiClient and gms.location.LocationListener sometimes takes lots of time to fetch GPS location.Do have any other efficent way to get location.
6 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Muthu KumarRank #935 · 2.2K reputationPosted Jan 4, 2019, 4:28 PM EST
+1
Here is an solution for you.
https://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android
https://developer.android.com/guide/topics/location/strategies
+1
Hari MurugesanRank #3,889 · 382 reputationPosted Oct 11, 2019, 2:57 AM EDT
+1
first step you need to add permission in manifest file the code given below
second step the activity class you need extends in LocationListener. it will override for getting current location I have all code added below
publicvoid onStatusChanged(String provider, int status, Bundle extras) {
Log.d("Latitude","status");
}
}
+1
Laxmidhar SahooRank #383 · 6.6K reputationPosted Dec 2, 2018, 4:52 PM EST
0
You may use leafleat js
0
Laxmidhar SahooRank #383 · 6.6K reputationPosted Jan 4, 2019, 5:39 PM EST
0
Yes you can store the lat long in your database and retrive it with ajax call ,then locate using marker in google api
0
Ashish TiwariRank #2,011 · 722 reputationPosted Jan 14, 2019, 6:25 PM EST
0
FusedLocationProviderClient is a good option to get the location in Android. Specify permission for FINE_LOCATION in manifest and ask dynamically before requesting for location update.
Muthu KumarRank #935 · 2.2K reputationPosted Jan 4, 2019, 4:28 PM EST
Hari MurugesanRank #3,889 · 382 reputationPosted Oct 11, 2019, 2:57 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Dec 2, 2018, 4:52 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Jan 4, 2019, 5:39 PM EST
Ashish TiwariRank #2,011 · 722 reputationPosted Jan 14, 2019, 6:25 PM EST
Bidyasagar MishraRank #766 · 3K reputationPosted Oct 12, 2019, 5:45 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts