Learn how to create a GPS Android App. You will learn how to use FusedLocationProviderClient, Google Play services, Location Provider, and other parts of a GPS-aware application.
๐ป Starting XML file:
โ๏ธ Course developed by Shad Sluiter. Check out his channel:
—
Learn to code for free and get a developer job:
Read hundreds of articles on programming:
And subscribe for new videos on technology every day:
Excellently explained
Thank you for making this. So so great for practice๐ฅ
Hi Sir, Would you like to teach about Audio/Video save in Internal Storage? Please Sir!
hey! i was just learning about gps in android a few days back. thanks for this tut!!
This is just the thing I desperately needed and didn’t know I did ;D
Thank you so much! <3
Thank you very much Shad
Your video is just brilliant, finally I was able to get my app working ๐
Thank you very much for your tutorial. You are super accurate and clear in what you are learning! I thank you for your very qualitative education. If you follow the tuto well everything works!
Thank you very much for making this video, Sir. This is very clear and easy for people to understan.
Hello,
Nice presentation, how could I put for example a label in the location that I do, and later look for them with a search button, sorry for my English
Some people seem to have the same error:
“Attempt to invoke virtual method ‘double android.location.Location.getLatitude()’ on a null object reference.”
I assume the problem comes from the line: “fusedLocationProviderClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener()”, where getLastLocation() may return “null”.
So just after this problematic line, just use a “if” statement to make sure that “location” is not “null”:
fusedLocationProviderClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener() {
@Override
public void onSuccess(Location location) {
if (location != null) {
// we got permissions, put the values of location into the UI components
updateUIValues(location);
currentLocation = location;
}
}
});
If you go further in the tutorial, you may have another error with the line:
“tv_wayPointCounts.setText(Integer.toString(savedLocations.size()));”
Just use a “if” statement to make sure that the “savedLocation” list is not “null”:
if (savedLocations != null) {
tv_wayPointCounts.setText(Integer.toString(savedLocations.size()));
}
This solved the problem for me.
I hope this will help.
Good luck ๐
I got some sort of error when I tried to combine this file into my dashcam file essentially making it a part of a feature of my dashcam app but it always causes the app to stop working. But when i run it as an individual app it can run. Any ideas here ? @Gazon
thank you so much <3
Thankyou for the course! Great stuff!
Easy to follow & very detailed tutorial. Thank you!
Hi Sr.
Thanks a lot for the good tutorial. I’ve learned many things about GPS.
I got one questions: How to save the GPS data to firebase firestore even not network phone?
Hello. Thank you for this awsome tutorial. I really appreciate. please could you give me a hint or make a video to explain how to save the location change in the list without needing to press the save location button? I want the app to add a new location in the list automatically in case of location change.
Thank you
Your support and encouragement have always been the driving factor of my life.thank you so much for getting me into my partner’s phone
Your support and encouragement have always been the driving factor of my life.thank you so much for getting me into my partner’s phone
Very very well done tutorial! So glad I found it on YouTube. First day learning Android for me. This tutorial provides excellent value. Clearly explained!
On 13:37: The usage of LocationRequest = new LocationRequest() is obsolet.
Use: LocationRequest = LocationRequest.create() – since LocationRequest is a static class
true, but after that “PRIORITY_BALANCED_POWER_ACCURACY” is deprecated too :/
28:12 App crash in AVD. Location is Null. To fix that – open googlemaps and find your location before starting app.
hi so i can create an account and search my localion on emulator?
@Nathan Duvinage You can set Fake Location. Press “…” (three dots) on bottom of emulators menu. Set location.
@Nathan Duvinage * you need to open googlemaps and find “your location” on AVD before running up at that moment.
What a great lesson, thank you sir!!!