|
WIMM Labs |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wimm.framework.provider.LocationCache
public class LocationCache
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 |
---|
public static final String ACTION_LOCATION_ADDED
Includes LOCATION_EXTRA
.
public static final String LOCATION_EXTRA
ACTION_LOCATION_ADDED
containing a Location
.
Constructor Detail |
---|
public LocationCache()
Method Detail |
---|
public static Location getLastKnownLocation(ContentResolver cr)
cr
- The ContentResolver
.
Location
or null if Location Services are disabled.
|
WIMM Labs |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |