I want to make an app, when user open my app user will get their current location in my app and while user change their location it will also update after some specific time. I got solution of changed location while user change their location but i need to show current location of user while user open my app.
Asked
Active
Viewed 2,862 times
1
-
1Possible duplicate of [How do I get the current GPS location programmatically in Android?](http://stackoverflow.com/questions/1513485/how-do-i-get-the-current-gps-location-programmatically-in-android) – Shabbir Dhangot Feb 13 '17 at 06:44
-
what have you done so far ? Please add the code. – tahsinRupam Feb 13 '17 at 06:44
1 Answers
4
googleMap.setMyLocationEnabled(true);
Location myLocation = googleMap.getMyLocation();
These are the the key lines to get current location.
for more info ,refer these tutorials: android show current location on map using google maps api
-
-
But that links worked fine for me. then refer these links also, http://javapapers.com/android/get-current-location-in-android/ , http://clover.studio/2016/08/09/getting-current-location-in-android-using-location-manager/ – Liya Feb 14 '17 at 04:03
-
1It works [android show current location on map using google maps api](http://javapapers.com/android/android-show-current-location-on-map-using-google-maps-api/) when i run it on different devices.Thanks – Arpit Prajapati Feb 14 '17 at 05:19