All Projects → martinraj → tracking-location-provider-android

martinraj / tracking-location-provider-android

Licence: other
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

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to tracking-location-provider-android

trackanimation
Track Animation is a Python 2 and 3 library that provides an easy and user-adjustable way of creating visualizations from GPS data.
Stars: ✭ 74 (+100%)
Mutual labels:  tracking, google-maps, gps-tracking
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (+283.78%)
Mutual labels:  google-maps, location-services, location-tracker
GPS-Video-Logger
Android App to record video and track GPS data simultaneously. GPS Logger with Video. GPS and video recording.
Stars: ✭ 17 (-54.05%)
Mutual labels:  gps-tracking, location-tracker
flutter foreground task
This plugin is used to implement a foreground service on the Android platform.
Stars: ✭ 41 (+10.81%)
Mutual labels:  foreground-notification, foreground-service
Swiftlocation
🛰 CoreLocation Made Easy - Efficient & Easy Location Tracker, IP Location, Gecoder, Geofence, Autocomplete, Beacon Ranging, Broadcaster and Visits Monitoring
Stars: ✭ 3,014 (+8045.95%)
Mutual labels:  location-services, location-tracker
Find3
High-precision indoor positioning framework, version 3.
Stars: ✭ 4,256 (+11402.7%)
Mutual labels:  location-services, gps-tracking
ReminderPro
ReminderPro(location, note, voice recording)
Stars: ✭ 27 (-27.03%)
Mutual labels:  location-services, location-tracker
Hrcarmarkeranimation
This android library is helpful for google map marker animation with Smooth turn and movement.
Stars: ✭ 52 (+40.54%)
Mutual labels:  google-maps, location-services
Photo Exif Toolkit
Photo Exif Toolkit Android app entirely written using Kotlin language
Stars: ✭ 37 (+0%)
Mutual labels:  google-maps, android-app
Placepicker
Free Android Map Place Picker alternative using Geocoder instead of Google APIs
Stars: ✭ 126 (+240.54%)
Mutual labels:  google-maps, location-services
FusedBulb
Location fetch library.
Stars: ✭ 22 (-40.54%)
Mutual labels:  location-tracker, location-tracking
pcan
Prototypical Cross-Attention Networks for Multiple Object Tracking and Segmentation, NeurIPS 2021 Spotlight
Stars: ✭ 294 (+694.59%)
Mutual labels:  tracking
Xamarin.Forms.GoogleMaps.Clustering
A map library that brings support for clustering for Xamarin.Forms.GoogleMaps.
Stars: ✭ 23 (-37.84%)
Mutual labels:  google-maps
awesome-3d-multi-object-tracking-autonomous-driving
A summary and list of open source 3D multi object tracking and datasets at this stage.
Stars: ✭ 16 (-56.76%)
Mutual labels:  tracking
traceml
Engine for ML/Data tracking, visualization, dashboards, and model UI for Polyaxon.
Stars: ✭ 445 (+1102.7%)
Mutual labels:  tracking
traccar-api-php
Traccar API - PHP API Implementation
Stars: ✭ 35 (-5.41%)
Mutual labels:  gps-tracking
Hibi
[No Active Development] An Android app for learning Japanese by keeping a journal.
Stars: ✭ 37 (+0%)
Mutual labels:  android-app
Kalman.jl
Flexible filtering and smoothing in Julia
Stars: ✭ 62 (+67.57%)
Mutual labels:  tracking
alternative-frontends
🔐🌐 Privacy-respecting web frontends for popular services
Stars: ✭ 821 (+2118.92%)
Mutual labels:  tracking
matvt
Virtual Mouse for Android TV that can be controlled via remote itself.
Stars: ✭ 90 (+143.24%)
Mutual labels:  android-app

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].