All Projects → safetysystemtechnology → Location Tracker Background

safetysystemtechnology / Location Tracker Background

Periodically tracking user's location in the background

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Location Tracker Background

Update Background Locations
A sample iOs example that tracks background locations.
Stars: ✭ 7 (-94.44%)
Mutual labels:  location, tracker
Deep sort yolov3
Real-time Multi-person tracker using YOLO v3 and deep_sort with tensorflow
Stars: ✭ 1,590 (+1161.9%)
Mutual labels:  tracker
Snail
基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。人家才不要你的⭐⭐呢,哼
Stars: ✭ 102 (-19.05%)
Mutual labels:  tracker
Rxlocationmanager
RxJava wrap around standard Android LocationManager without Google Play Services
Stars: ✭ 115 (-8.73%)
Mutual labels:  location
Bblocationmanager
A Location Manager for easily implementing location services & geofencing in iOS. Ready for iOS 11.
Stars: ✭ 107 (-15.08%)
Mutual labels:  location
Pygoturn
PyTorch implementation of GOTURN object tracker: Learning to Track at 100 FPS with Deep Regression Networks (ECCV 2016)
Stars: ✭ 116 (-7.94%)
Mutual labels:  tracker
Android Easylocation
Google play service - location services wrapper
Stars: ✭ 100 (-20.63%)
Mutual labels:  location
Locationwithoutprompt
A proof of concept to show how easy it is to get coarse location of the user without using Core Location
Stars: ✭ 123 (-2.38%)
Mutual labels:  location
Android
Android app for collecting OpenStreetCam imagery
Stars: ✭ 119 (-5.56%)
Mutual labels:  location
Block
Let's make an annoyance free, better open internet, altogether!
Stars: ✭ 1,849 (+1367.46%)
Mutual labels:  tracker
Fcipaddressgeocoder
iOS Geocoder for geocode device IP Address location using GeoIP service(s) and a block-based syntax. 💻🌍
Stars: ✭ 114 (-9.52%)
Mutual labels:  location
Whereami
A short shell script that returns you your IPv4 address and its geolocation.
Stars: ✭ 108 (-14.29%)
Mutual labels:  location
Mobile Sdk
CARTO Mobile SDK core project
Stars: ✭ 116 (-7.94%)
Mutual labels:  location
Ttgo T Beam Car Tracker
TTGO-T-Beam Arduino Car Tracker - ESP32 + LoRa + GPS + GSM (optional)
Stars: ✭ 106 (-15.87%)
Mutual labels:  tracker
Wechat ayibang
微信小程序仿阿姨帮
Stars: ✭ 121 (-3.97%)
Mutual labels:  location
Phone Tracker
Phone tracker is an Android library to gather environment signals, like cell towers, wifi access points and gps locations.
Stars: ✭ 102 (-19.05%)
Mutual labels:  tracker
U360gts
The Universal 360º Continous Rotation Tracker System for Drones (UAVs, RPAs and FPV).
Stars: ✭ 113 (-10.32%)
Mutual labels:  tracker
Privacy services manager
A single management utility to administer Location Services, Contacts requests, Accessibility, and iCloud access in Apple's OS X.
Stars: ✭ 115 (-8.73%)
Mutual labels:  location
Smart Location Lib
Android library project that lets you manage the location updates to be as painless as possible
Stars: ✭ 1,607 (+1175.4%)
Mutual labels:  location
Mapdrawingtools
this library Drawing polygon, polyline and points in Google Map and return coordinates to your App
Stars: ✭ 122 (-3.17%)
Mutual labels:  location

location-tracker-background

Periodically tracking user's location in the background

Install

Add the dependecy

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

dependencies {
  compile 'com.github.safetysystemtechnology:location-tracker-background:v1.3'
}

Add permissions in your AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Register your receiver in AndroidManifest.xml

<receiver android:name=".LocationReceiver">
  <intent-filter>
      <action android:name="my.action"/>
  </intent-filter>
</receiver>

Usage

    private LocationTracker locationTracker;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    protected void onStart() {
        super.onStart();
        locationTracker=new LocationTracker("my.action")
                .setInterval(50000)
                .setGps(true)
                .setNetWork(false)
                
                // IF YOU WANT JUST CURRENT LOCATION
                // .currentLocation(new CurrentLocationReceiver(new CurrentLocationListener() {
                //
                //            @Override
                //            public void onCurrentLocation(Location location) {
                //               Log.d("callback", ":onCurrentLocation" + location.getLongitude());
                //               locationTracker.stopLocationService(getBaseContext());
                //            }
                //
                //            @Override
                //            public void onPermissionDiened() {
                //                Log.d("callback", ":onPermissionDiened");
                //                locationTracker.stopLocationService(getBaseContext());
                //            }
                // }))
                        
                .start(getBaseContext(), this);

                // IF YOU WANT RUN IN SERVICE
                // .start(this);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        locationTracker.onRequestPermission(requestCode, permissions, grantResults);
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        locationTracker.stopLocationService(this);
    }

Create your BroadcastReceiver to get informations of location

public class LocationReceiver extends BroadcastReceiver implements ILocationConstants {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (null != intent && intent.getAction().equals("my.action")) {
            Location locationData = (Location) intent.getParcelableExtra(SettingsLocationTracker.LOCATION_MESSAGE);
            Log.d("Location: ", "Latitude: " + locationData.getLatitude() + "Longitude:" + locationData.getLongitude());
            //send your call to api or do any things with the of location data
        }
    }
}

License

The MIT License (MIT)

Copyright (c) Safety System Technology

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the "Software"), 
to deal in the Software without restriction, including without limitation 
the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the Software is 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included 
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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].