Updated Google Maps Tutorial | PART 3 (Android Tutorials)

preview_player
Показать описание

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 :

Рекомендации по теме
Комментарии
Автор

Hello, you helped me so much, your tutorials are really awesome, but I recommend that you explain a little bit more about what each function we are using really does, that would be very helpful :)

hiyamghannam
Автор

This Video is been helpful can you update your Git Repo considering new updates of Android Studio.

pranjalekhande
Автор

Exactly what I needed for a project.. Thanks!

yogeshkurane
Автор

Hi! excellent tutorial. So 1:52 I'm getting the message "This interface was deprecated.
Use the connectionless API FusedLocationProviderClient instead" . I hope you can help me... Ty

TRUKFITaMiffts
Автор

When FusedLocatioApi is used what is the use of onLocationChange because fusedLocationApi does the same work that is providing current location?

tanviag
Автор

Hi, following this video and learning lot, but could you please tell me at 3:17 what buttons do you press when line 100 swaps to line 99. thank you

mattastley
Автор

location marker (blue marker) is not updating. It only points to original location .Please help,

bikkikumarsha
Автор

How to use FusedLocationPRoviderClient instead of the FusedLocationApi?

abiramishankar
Автор

Hi...
I have watched your all tutorials and write the same codes you have written.
Here, my search button works fine but hospital, school and restaurant button don't. (Only showing Toast Message but don't mark nearby places)

What can I do now, please help me anyway. Thanks.

ASADULLAHGALIB
Автор

Hi Priyanka, first great walk thru, nice job. When will you be posting the next part? the last method you mentioned of getCurrent location is what I need for my project :)

hrtbrkr
Автор

Thank you....thank you so much..very helpful tutorial

BreedingBirdsTown
Автор

What to use instead of FusedLoctaionApi as it is depecated for now

milanhazra
Автор

GettingError (Fused Location deprecated) ... Google No longer use it - please update this part

atefattar
Автор

I'm getting an error with the ACCESS_FINE_LOCATION statement. I've added the permission into the Manifest but then realised this text above the permissions...

<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->

What do I do?

NextGenerationStuff
Автор

Add comments after the tutorial and share code with GitHub that will help us to refer in future regarding doubt about any line or method

Anilkumar-ecsj
Автор

error: cannot access zza
class file for not found


im facing this error... what can i do?

lokib
Автор

why the current location point are auto change position the Markaroption are select wrong place and the current location blue circle are move automatically

MuhammadAmir-mfxt
Автор

In part 3, lastlocation attribute can't taken, how I can slove??

manalipatel
Автор

you don't explain which method for which type off work

Sahin_Safi
Автор

After getting blue dot, can anyone tell me how to get LatLng coordinates of that Help me fast

shivammittal
visit shbcf.ru