com.github.ignition.location.templates
Class IgnitedAbstractLocationUpdateRequester

java.lang.Object
  extended by com.github.ignition.location.templates.IgnitedAbstractLocationUpdateRequester
Direct Known Subclasses:
IgnitedLegacyLocationUpdateRequester

public abstract class IgnitedAbstractLocationUpdateRequester
extends Object

Abstract base class that can be extended to provide active and passive location updates optimized for each platform release. Uses broadcast Intents to notify the app of location changes.


Field Summary
protected  android.location.LocationManager locationManager
           
protected static String TAG
           
 
Constructor Summary
protected IgnitedAbstractLocationUpdateRequester(android.location.LocationManager locationManager)
           
 
Method Summary
 void removeLocationUpdates()
           
 void requestLocationUpdates(long minTime, long minDistance, android.location.Criteria criteria, android.app.PendingIntent pendingIntent)
          Request active location updates.
 void requestPassiveLocationUpdates(long minTime, long minDistance, android.app.PendingIntent pendingIntent)
          Request passive location updates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG

protected static final String TAG
See Also:
Constant Field Values

locationManager

protected android.location.LocationManager locationManager
Constructor Detail

IgnitedAbstractLocationUpdateRequester

protected IgnitedAbstractLocationUpdateRequester(android.location.LocationManager locationManager)
Method Detail

requestLocationUpdates

public void requestLocationUpdates(long minTime,
                                   long minDistance,
                                   android.location.Criteria criteria,
                                   android.app.PendingIntent pendingIntent)
Request active location updates. These updates will be triggered by a direct request from the Location Manager.

Parameters:
minTime - Minimum time that should elapse between location update broadcasts.
minDistance - Minimum distance that should have been moved between location update broadcasts.
criteria - Criteria that define the Location Provider to use to detect the Location.
pendingIntent - The Pending Intent to broadcast to notify the app of active location changes.

removeLocationUpdates

public void removeLocationUpdates()

requestPassiveLocationUpdates

public void requestPassiveLocationUpdates(long minTime,
                                          long minDistance,
                                          android.app.PendingIntent pendingIntent)
Request passive location updates. These updates will be triggered by locations received by 3rd party apps that have requested location updates. The miniumim time and distance for passive updates will typically be longer than for active updates. The trick is to balance the difference to minimize battery drain by maximize freshness.

Parameters:
minTime - Minimum time that should elapse between location update broadcasts.
minDistance - Minimum distance that should have been moved between location update broadcasts.
pendingIntent - The Pending Intent to broadcast to notify the app of passive location changes.


Copyright © 2012. All Rights Reserved.