Android Studio Tutorial – Build a GPS App

Wordpress sites

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:

26 thoughts on “Android Studio Tutorial – Build a GPS App”

  1. Klaudia Adamus

    This is just the thing I desperately needed and didn’t know I did ;D
    Thank you so much! <3

  2. Lars-Inge Andresen

    Thank you very much Shad

    Your video is just brilliant, finally I was able to get my app working ๐Ÿ™‚

  3. Ramanan Mathan

    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!

  4. Thank you very much for making this video, Sir. This is very clear and easy for people to understan.

  5. 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

  6. 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() {
    public void onSuccess(Location location) {
    if (location != null) {
    // we got permissions, put the values of location into the UI components
    currentLocation = location;


    If you go further in the tutorial, you may have another error with the line:

    Just use a “if” statement to make sure that the “savedLocation” list is not “null”:
    if (savedLocations != null) {

    This solved the problem for me.
    I hope this will help.
    Good luck ๐Ÿ˜‰

    1. 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

  7. 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?

  8. collince silenou

    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

  9. ๐—›๐—”๐—–๐—ง๐—˜๐—–๐—›๐—œ๐—˜ on INSTAGRAM

    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

  10. ๐—›๐—”๐—–๐—ง๐—˜๐—–๐—›๐—œ๐—˜ on INSTAGRAM

    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

  11. Mihai Cฤƒdariu

    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!

  12. On 13:37: The usage of LocationRequest = new LocationRequest() is obsolet.
    Use: LocationRequest = LocationRequest.create() – since LocationRequest is a static class

    1. Mohammed Majd

      true, but after that “PRIORITY_BALANCED_POWER_ACCURACY” is deprecated too :/

  13. ะกะฐะฝั ะกะฐะฝั

    28:12 App crash in AVD. Location is Null. To fix that – open googlemaps and find your location before starting app.

    1. ะกะฐะฝั ะกะฐะฝั

      @Nathan Duvinage You can set Fake Location. Press “…” (three dots) on bottom of emulators menu. Set location.

    2. ะกะฐะฝั ะกะฐะฝั

      @Nathan Duvinage * you need to open googlemaps and find “your location” on AVD before running up at that moment.

Comments are closed.