filmov
tv
Updated Google Maps Tutorial | PART 3 (Android Tutorials)

Показать описание
In the previous 2 parts of this android tutorial series, we first created a map with the default location set to sydney, Australia. So, in this tutorial, we are going to complete 2 methods, viz., onConnected() and onLocationChanged().
In the onConnected() method, we will create a LocationRequest and set some properties to that object. In the onLocationChanged() method, we are going to get the latitude and longitude of the new location and set it to the LatLng object. We are going to create a marker and set properties to that marker using MarkerOptions class.
Then, we will create one more method called checkLocationPermission() which will call checkSelfPermission() method.
So the app has to explicitly ask the user for permission to access location/GPS services. It will display a dialog box when the app is opened the first time and the user can either grant the permission or deny it. If the permission is granted then and then only, the map will be shown with the current location. Otherwise, you won't be able to display your current location because you won't be able to access locaiton/GPS services.
Watch other parts HERE :
Find me here :
Комментарии