Tracking Location Provider Android

Tracking the android mobile and animating marker smoothly in Google Maps. Tracking has been done both in foreground and background. Tested in Android Oreo 8.1, Android 6.0 and Android 5.0
Alternatives To Tracking Location Provider Android
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Uber Like Cab Service85
3 years ago21Java
Uber Like Android App with PHP backend
Mapsmeasure69
24 days ago6apache-2.0Java
A simple Android app to measure distances on Google Maps
Takeaway Kotlin45
6 months agon,ullbsd-3-clauseKotlin
🍕this order food 🥗 and 🍹drink app made with Kotlin & Firebase was some part inspired by this design: https://www.sketchappsources.com/free-source/3486-cheeza-pizza-app-sketch-freebie-resource.html
Google Maps Android Charts41
4 years ago1apache-2.0Java
🗺 Google Maps Chart for Android - Render marker clusters as charts categorized on the Google Maps
Flutter Google Maps Demo38
5 years ago5Dart
Photo_exif_toolkit33
6 years ago2gpl-3.0Kotlin
Photo Exif Toolkit Android app entirely written using Kotlin language
Tracking Location Provider Android31
5 years ago3Java
Tracking the android mobile and animating marker smoothly in Google Maps. Tracking has been done both in foreground and background. Tested in Android Oreo 8.1, Android 6.0 and Android 5.0
Snazzymaps Browser25
7 years ago1apache-2.0Java
Android app for searching and browsing Snazzy Maps
Google Maps Tracker23
8 years agootherJava
Android app to report/track your location using Google Maps API
Meetme20
6 years agoJava
An Android apps that using google maps to track realtime location between two people that wanna meet with chat feature, and realtime tracking
Alternatives To Tracking Location Provider Android
Select To Compare


Alternative Project Comparisons
Readme

tracking-location-provider-android

In this demo, I have covered both foreground tracking and background tracking.

Foreground Tracking

Foreground Tracking will work only if app is in foreground. To start foreground tracking, tap on the "START FOREGROUND TRACKING" button. Before requesting for location updates, check location settings of the device as below.

mLocationRequest = new LocationRequest();
        mLocationRequest.setInterval(30000);
        mLocationRequest.setFastestInterval(15000);
        mLocationRequest.setSmallestDisplacement(50); // set this as 100 to 200 if user use app while driving or motor riding
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
        LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
                .addLocationRequest(mLocationRequest);
        SettingsClient client = LocationServices.getSettingsClient(this);
        Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());
        task.addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {
            @Override
            public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
                // All location settings are satisfied. The client can initialize
                // location requests here.
                // ...
                bService.setVisibility(View.GONE);
                startLocationUpdates();
            }
        });
        task.addOnFailureListener(this, new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                int statusCode = ((ApiException) e).getStatusCode();
                switch (statusCode) {
                    case CommonStatusCodes.RESOLUTION_REQUIRED:
                        // Location settings are not satisfied, but this can be fixed
                        // by showing the user a dialog.
                        try {
                            // Show the dialog by calling startResolutionForResult(),
                            // and check the result in onActivityResult().
                            ResolvableApiException resolvable = (ResolvableApiException) e;
                            resolvable.startResolutionForResult(MainActivity.this,
                                    REQUEST_CHECK_SETTINGS);
                        } catch (IntentSender.SendIntentException sendEx) {
                            // Ignore the error.
                        }
                        break;
                    case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
                        // Location settings are not satisfied. However, we have no way
                        // to fix the settings so we won't show the dialog.
                        break;
                }
            }
        });

Note: No need to show notication, as location is taken when the app is in foreground.

Background Tracking

Background Tracking is need when you want to track user location even after your app is closed or killed from task. For background tracking you must notify users via foreground notification while getting location. For this purpose we are using foreground service named(LocationJobService.java). Android versions > 7.1 restricts background location process even though foreground service is used. You cannot override this, and you will get 3 0r 4 location updates for 1 hour period. For more information, refer here

Screenshots

main_page background_service notification

Popular Google Maps Projects
Popular Android App Projects
Popular Mapping Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Animation
Location
Android App
Google Maps
Job Scheduler
Location Services
Gps Tracking