際際滷

際際滷Share a Scribd company logo
www.mobisoftinfotech.com
1-855-572-APPS (2777)
business@mobisoftinfotech.com

3 ways to implement efficient location tracking in Android applications
When you think of building or developing location based Android app, does it make you think about
how to do efficient location tracking in the app which does not hamper battery of device no matter
who you are, app developer or Entrepreneur who is building a concept?
Android battery optimization is a major problem in building location based apps. However this could
be resolved and battery optimization can be done at some extend extent by implementing some
smart logic depending on the requirement of location tracking in the application.
Location tracking in your app can be implemented in following ways depending on the apps
requirement.
1. Request one shot location of device wherever needed
2. Timer/service based approach for continuous location tracking
3. Geo fence based approach for continuous location tracking

Request one shot location of device wherever
needed 
If app demands requesting devices current location on screen say some API needs lat-long as input
or need to use lat-long natively to display some info about current location of screen, map screen
etc., app can request location manager to get current location of device in the same activity class. As
long as location is used on that particular screen and app does not demand continuous location
tracking in background or foreground, this approach could best suit to the requirement. App could
just decide some param which is needed to be set to request location using location manager class
like accuracy, interval rate at which location client tries to obtain location updates, fastest time
interval, priority of location request etc.

Advantages
1. Not using continuous tracking saves battery used by app.
2. Best suited when location is needed on a particular or few screens

Disadvantages 
1. May give less accurate location as it takes one shot location wherever needed. Though accuracy
can be increased by keep requesting location updates till it reaches desired accuracy.

Timer/service based approach for continuous
location tracking 
If app demands continuous location tracking in foreground as well as background, you can write your
own service to track location on timely interval. In such a implementation, service starts listening to
location updates for sometime interval and turns off all the updates for sometime. Turning off
updates here means removing all callbacks to location manager. After the timer, when location
updates are off, has elapsed, it will again start requesting location updates. Time interval for both the
timers can be decided depending on desired accuracy of location app demands, also how frequently
app is using current location etc.

Advantages 
1. Use of own service for location tracking gives ability to track location in background as well.
2. Desired accuracy can be met if timer interval is decided accordingly.
3. Location is the most recent and is updated when it is actually being used any time anywhere in
app.
4. Battery optimization can be achieved at some extent if timer intervals are decided wisely.

Disadvantages 
1. App needs keep running location tracking service all the time.
2. Less efficient compared to geo fence based approach for continuous location tracking.
3. If service stops due to some reason and no code is written to start service if its stopped, app won't
receive location updates.

Geo fence based approach for continuous
location tracking
Google Play Services has made it easy to monitor geo location area of certain radius which is called
Geo fence. Same geo fence concept can not only be used for monitoring enter-exit events of created
geo fence but also it can be used for efficient location tracking. When app demands continuous
location tracking both in background and foreground instead of writing own service to monitor
location updates, you can create small geo fence of some radius say 250 meters, again this radius
depends on your apps requirement. If your app needs to track users location for very small area
this geofence radius can be small otherwise greater radius will also work. When first time user gets
devices location (this location could be of desired accuracy), it will create geofence at that point with
the pre-decided radius and turn off location updates. Exit event of such geofence is breached which
means if user exits the geofence, the application will destroy the same geofence and will start
location updates. The Application will create a new geo fence for the new geopoint. This way app
does not need to keep tracking devices location all the time using a background service. Instead
once geofence is created Google Play service will take care of location tracking until and unless the
user does not exit geofence.

Advantages 
1. No need of writing own service for continuous location tracking.
2. Better battery optimization as compared to timer/service based approach.

Disadvantages 
1. This approach is not suitable when the app demands location tracking for minute location
updates. For example, when the app tracks food places and specially when the area is highly dense
with food places.
In this way, depending on your apps requirement above mentioned techniques can help you to
develop efficient location tracking in your app.

Please Contact us at: www.mobisoftinfotech.com
1-855-572-APPS (2777)
business@mobisoftinfotech.com
Tracking android apps

More Related Content

Similar to Tracking android apps (20)

My Places
My PlacesMy Places
My Places
IRJET Journal
Head into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performanceHead into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performance
iMOBDEV Technologies Pvt. Ltd.
Bus Tracking Application in Android
Bus Tracking Application in AndroidBus Tracking Application in Android
Bus Tracking Application in Android
Abhishek Singh
Mobile Device Application to locate an Interest Point using Google Maps
Mobile Device Application to locate an Interest Point using Google MapsMobile Device Application to locate an Interest Point using Google Maps
Mobile Device Application to locate an Interest Point using Google Maps
Editor IJCATR
Android location based services
Android location based servicesAndroid location based services
Android location based services
aswath babu
Preparing for the Mobile Algorithm Shift
Preparing for the Mobile Algorithm ShiftPreparing for the Mobile Algorithm Shift
Preparing for the Mobile Algorithm Shift
Crystal Ware
Benefits of geolocation app development in 2022 (1)
Benefits of geolocation app development in 2022 (1)Benefits of geolocation app development in 2022 (1)
Benefits of geolocation app development in 2022 (1)
Moon Technolabs Pvt. Ltd.
Gps enabled android application for bus
Gps enabled android application for busGps enabled android application for bus
Gps enabled android application for bus
eSAT Publishing House
Androidbasedtaskschedulerandindicator (2).pdf
Androidbasedtaskschedulerandindicator (2).pdfAndroidbasedtaskschedulerandindicator (2).pdf
Androidbasedtaskschedulerandindicator (2).pdf
ShubhamDiggikar
Android - Android Geocoding and Location based Services
Android - Android Geocoding and Location based ServicesAndroid - Android Geocoding and Location based Services
Android - Android Geocoding and Location based Services
Vibrant Technologies & Computers
10 bm60083 location_based_badge_on_a_mobile_phone
10 bm60083 location_based_badge_on_a_mobile_phone10 bm60083 location_based_badge_on_a_mobile_phone
10 bm60083 location_based_badge_on_a_mobile_phone
Shashidhar Shenoy
SMART MECHANIC SYSTEM
SMART MECHANIC SYSTEMSMART MECHANIC SYSTEM
SMART MECHANIC SYSTEM
IRJET Journal
Location Provider with Privacy Using Localized Server and GPS
  Location Provider with Privacy Using Localized Server and GPS   Location Provider with Privacy Using Localized Server and GPS
Location Provider with Privacy Using Localized Server and GPS
Editor IJCATR
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
IJERD Editor
Gps enabled android application for bus
Gps enabled android application for busGps enabled android application for bus
Gps enabled android application for bus
eSAT Journals
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICSIEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
aswin tbbc
IRJET- Hand on Hand
IRJET- Hand on HandIRJET- Hand on Hand
IRJET- Hand on Hand
IRJET Journal
Exploiting service similarity for privacy in location based search queries
Exploiting service similarity for privacy in location based search queriesExploiting service similarity for privacy in location based search queries
Exploiting service similarity for privacy in location based search queries
Shakas Technologies
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android Apps
Singsys Pte Ltd
How To Make Your App Available Offline.pdf
How To Make Your App Available Offline.pdfHow To Make Your App Available Offline.pdf
How To Make Your App Available Offline.pdf
Satawaretechnologies1
Head into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performanceHead into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performance
iMOBDEV Technologies Pvt. Ltd.
Bus Tracking Application in Android
Bus Tracking Application in AndroidBus Tracking Application in Android
Bus Tracking Application in Android
Abhishek Singh
Mobile Device Application to locate an Interest Point using Google Maps
Mobile Device Application to locate an Interest Point using Google MapsMobile Device Application to locate an Interest Point using Google Maps
Mobile Device Application to locate an Interest Point using Google Maps
Editor IJCATR
Android location based services
Android location based servicesAndroid location based services
Android location based services
aswath babu
Preparing for the Mobile Algorithm Shift
Preparing for the Mobile Algorithm ShiftPreparing for the Mobile Algorithm Shift
Preparing for the Mobile Algorithm Shift
Crystal Ware
Benefits of geolocation app development in 2022 (1)
Benefits of geolocation app development in 2022 (1)Benefits of geolocation app development in 2022 (1)
Benefits of geolocation app development in 2022 (1)
Moon Technolabs Pvt. Ltd.
Gps enabled android application for bus
Gps enabled android application for busGps enabled android application for bus
Gps enabled android application for bus
eSAT Publishing House
Androidbasedtaskschedulerandindicator (2).pdf
Androidbasedtaskschedulerandindicator (2).pdfAndroidbasedtaskschedulerandindicator (2).pdf
Androidbasedtaskschedulerandindicator (2).pdf
ShubhamDiggikar
Android - Android Geocoding and Location based Services
Android - Android Geocoding and Location based ServicesAndroid - Android Geocoding and Location based Services
Android - Android Geocoding and Location based Services
Vibrant Technologies & Computers
10 bm60083 location_based_badge_on_a_mobile_phone
10 bm60083 location_based_badge_on_a_mobile_phone10 bm60083 location_based_badge_on_a_mobile_phone
10 bm60083 location_based_badge_on_a_mobile_phone
Shashidhar Shenoy
SMART MECHANIC SYSTEM
SMART MECHANIC SYSTEMSMART MECHANIC SYSTEM
SMART MECHANIC SYSTEM
IRJET Journal
Location Provider with Privacy Using Localized Server and GPS
  Location Provider with Privacy Using Localized Server and GPS   Location Provider with Privacy Using Localized Server and GPS
Location Provider with Privacy Using Localized Server and GPS
Editor IJCATR
International Journal of Engineering Research and Development
International Journal of Engineering Research and DevelopmentInternational Journal of Engineering Research and Development
International Journal of Engineering Research and Development
IJERD Editor
Gps enabled android application for bus
Gps enabled android application for busGps enabled android application for bus
Gps enabled android application for bus
eSAT Journals
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICSIEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
IEEE PROJECT TOPICS & ABSTRACTS BY SOFTRONIICS
aswin tbbc
IRJET- Hand on Hand
IRJET- Hand on HandIRJET- Hand on Hand
IRJET- Hand on Hand
IRJET Journal
Exploiting service similarity for privacy in location based search queries
Exploiting service similarity for privacy in location based search queriesExploiting service similarity for privacy in location based search queries
Exploiting service similarity for privacy in location based search queries
Shakas Technologies
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android Apps
Singsys Pte Ltd
How To Make Your App Available Offline.pdf
How To Make Your App Available Offline.pdfHow To Make Your App Available Offline.pdf
How To Make Your App Available Offline.pdf
Satawaretechnologies1

Tracking android apps

  • 1. www.mobisoftinfotech.com 1-855-572-APPS (2777) business@mobisoftinfotech.com 3 ways to implement efficient location tracking in Android applications When you think of building or developing location based Android app, does it make you think about how to do efficient location tracking in the app which does not hamper battery of device no matter who you are, app developer or Entrepreneur who is building a concept? Android battery optimization is a major problem in building location based apps. However this could be resolved and battery optimization can be done at some extend extent by implementing some smart logic depending on the requirement of location tracking in the application. Location tracking in your app can be implemented in following ways depending on the apps requirement. 1. Request one shot location of device wherever needed 2. Timer/service based approach for continuous location tracking 3. Geo fence based approach for continuous location tracking Request one shot location of device wherever needed If app demands requesting devices current location on screen say some API needs lat-long as input or need to use lat-long natively to display some info about current location of screen, map screen etc., app can request location manager to get current location of device in the same activity class. As long as location is used on that particular screen and app does not demand continuous location tracking in background or foreground, this approach could best suit to the requirement. App could just decide some param which is needed to be set to request location using location manager class like accuracy, interval rate at which location client tries to obtain location updates, fastest time interval, priority of location request etc. Advantages
  • 2. 1. Not using continuous tracking saves battery used by app. 2. Best suited when location is needed on a particular or few screens Disadvantages 1. May give less accurate location as it takes one shot location wherever needed. Though accuracy can be increased by keep requesting location updates till it reaches desired accuracy. Timer/service based approach for continuous location tracking If app demands continuous location tracking in foreground as well as background, you can write your own service to track location on timely interval. In such a implementation, service starts listening to location updates for sometime interval and turns off all the updates for sometime. Turning off updates here means removing all callbacks to location manager. After the timer, when location updates are off, has elapsed, it will again start requesting location updates. Time interval for both the timers can be decided depending on desired accuracy of location app demands, also how frequently app is using current location etc. Advantages 1. Use of own service for location tracking gives ability to track location in background as well. 2. Desired accuracy can be met if timer interval is decided accordingly. 3. Location is the most recent and is updated when it is actually being used any time anywhere in app. 4. Battery optimization can be achieved at some extent if timer intervals are decided wisely. Disadvantages 1. App needs keep running location tracking service all the time. 2. Less efficient compared to geo fence based approach for continuous location tracking. 3. If service stops due to some reason and no code is written to start service if its stopped, app won't receive location updates. Geo fence based approach for continuous location tracking
  • 3. Google Play Services has made it easy to monitor geo location area of certain radius which is called Geo fence. Same geo fence concept can not only be used for monitoring enter-exit events of created geo fence but also it can be used for efficient location tracking. When app demands continuous location tracking both in background and foreground instead of writing own service to monitor location updates, you can create small geo fence of some radius say 250 meters, again this radius depends on your apps requirement. If your app needs to track users location for very small area this geofence radius can be small otherwise greater radius will also work. When first time user gets devices location (this location could be of desired accuracy), it will create geofence at that point with the pre-decided radius and turn off location updates. Exit event of such geofence is breached which means if user exits the geofence, the application will destroy the same geofence and will start location updates. The Application will create a new geo fence for the new geopoint. This way app does not need to keep tracking devices location all the time using a background service. Instead once geofence is created Google Play service will take care of location tracking until and unless the user does not exit geofence. Advantages 1. No need of writing own service for continuous location tracking. 2. Better battery optimization as compared to timer/service based approach. Disadvantages 1. This approach is not suitable when the app demands location tracking for minute location updates. For example, when the app tracks food places and specially when the area is highly dense with food places. In this way, depending on your apps requirement above mentioned techniques can help you to develop efficient location tracking in your app. Please Contact us at: www.mobisoftinfotech.com 1-855-572-APPS (2777) business@mobisoftinfotech.com