How to Get Current Location On Google Map in Android Studio| Java| Android Studio Tutorial

preview_player
Показать описание
In this video, you will learn how to get the user's current location on Google Map in Android Studio.

I forgot to explain the location request code. Find the code below and paste it inside getCurrentLocation Method

LocationCallback mLocationCallback = new LocationCallback() {
@Override
public void onLocationResult(LocationResult locationResult) {

if (locationResult == null) {

return;
}
if (location != null) {

//TODO: UI updates.
}
}
}
};

Dependencies :-

Permissions:--

Project Creation: 00:08
Getting API Key :00:27
Output: 08:09

You can visit my channel for more tutorials and videos :
Our telegram channel:

Facebook Page:

Twitter:

Linkedin:

Please provide your feedback in the comment section. And, don't forget to like the video and subscribe my channel.
Рекомендации по теме
Комментарии
Автор

not a beginner friendly you cut a part of the video for sure :3 I don't know how to paste the one in the description since LocationRequest in not recognized.

zegiyt
Автор

ty for the tuto, but i have a problem the location is null

LIBGHIT
Автор

I get this error: Attempt to invoke virtual method 'double on a null object reference". Even with the code provided in description.

rodrigolozano
Автор

I am still getting same error even the code was added

renkailee
Автор

The program loads properly but shows I'm in Africa not Miami FL. LOL.

geraldinejns
Автор

Bole to link moklu sort ma only if condition se current location mil jata he to kayu chutiyapa karne ki jarurat he

vinaymori
Автор

Hello am happy to see this buh can u help by uploading the source code on github

henrycode
Автор

My app sometimes crashes and sometimes it will work completely fine when using google maps activity, please help me out with this.

KeshavSharma-pjti
Автор

Hello thank you for the video everything is working fine except it wont get to my location its like the location is null

reema
Автор

where i need to paste the decription code i pasted inside current loation method it shows errors i.e setInterval, setFastedst, set priority errors

yuvasekhar
Автор

can someone already fix the error? i already tried to paste the code but still error

unknown-vqso
Автор

hi, I need help, why in writes "There are no permissions required by android.permission. ..." my code is still the same, permissions are present in the Manifest, what's the matter?
error in 76 strock's

No-Name
join shbcf.ru