WIMM Labs


com.wimm.framework.provider
Class LocationCache

java.lang.Object
  extended by com.wimm.framework.provider.LocationCache

public class LocationCache
extends Object

The LocationCache class provides quick access to the last known location.

If the user has Location Services enabled, location information will be retrieved from one or more sources, including built-in GPS, network based IP-location lookup, or a paired Android or Blackberry smartphone running the WimmCompanion app.

To query the last known location, call LocationCache.getLastKnownLocation().

To receive notification of location changes, register a BroadcastReceiver for ACTION_LOCATION_ADDED. The location can be retrieved from the broadcast intent using the extra LOCATION_EXTRA.


Field Summary
static String ACTION_LOCATION_ADDED
          Broadcast when a new location is added.
static String LOCATION_EXTRA
          Extra for ACTION_LOCATION_ADDED containing a Location.
 
Constructor Summary
LocationCache()
           
 
Method Summary
static Location getLastKnownLocation(ContentResolver cr)
          Provides location information from a cached last known location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_LOCATION_ADDED

public static final String ACTION_LOCATION_ADDED
Broadcast when a new location is added.

Includes LOCATION_EXTRA.

Since:
WIMM SDK 1.0.1
See Also:
Constant Field Values

LOCATION_EXTRA

public static final String LOCATION_EXTRA
Extra for ACTION_LOCATION_ADDED containing a Location.

Since:
WIMM SDK 1.0.1
See Also:
Constant Field Values
Constructor Detail

LocationCache

public LocationCache()
Method Detail

getLastKnownLocation

public static Location getLastKnownLocation(ContentResolver cr)
Provides location information from a cached last known location.

Parameters:
cr - The ContentResolver.
Returns:
The last known Location or null if Location Services are disabled.
Since:
WIMM SDK 1.0.0

WIMM Labs