RSFluffyLocation
RSFluffyLocation
Fields:
- DEFAULT_ALARM_FREQUENCY As Long
- DEFAULT_MAXIMUM_LOCATION_AGE As Int
- LOCATION_BROADCAST_EXTRA_LOCATIONINFO As String
- getLocationChangedPeriodicBroadcastAction As String
- getLocationChangedTickerBroadcastAction As String
Methods:
- EnableDebugging
- ForceLocationUpdate
To force a location update, call this and soon you'll get a broadcast containing the latest location.
- Initialize (PackageName As String) As Int
Initializes the RSFluffylocation Library.
PackageName - Your package name of your app.
- Initialize2 (PackageName As String, BroadcastEveryLocationUpdate As Boolean) As Int
Initializes the RSFluffylocation Library.
PackageName - Your package name of your app.
BroadcastEveryLocationUpdate - If true, in addition to broadcasting periodic updates,
it broadcasts every location update as it is found,
using intent action com.your.package.name.littlefluffylocationlibrary.LOCATION_CHANGED_TICK. The default is false
- Initialize3 (PackageName As String, AlarmFrequency As Long, LocationMaximumAge As Int) As Int
Initializes the RSFluffylocation Library.
PackageName - Your package name of your app.
AlarmFrequency - How often to broadcast a location update in milliseconds, if one was received.
For battery efficiency, this should be one of the available inexact recurrence intervals.
You are not prevented from using any other value.The default is AlarmManager.INTERVAL_FIFTEEN_MINUTES.
LocationMaximumAge - The maximum age of a location update.
If when the alarm fires the location is older than this, a location update will be requested.
The default is AlarmManager.INTERVAL_HOUR.
- Initialize4 (PackageName As String, BroadcastEveryLocationUpdate As Boolean, AlarmFrequency As Long, LocationMaximumAge As Int) As Int
Initializes the RSFluffylocation Library.
PackageName - Your package name of your app.
BroadcastEveryLocationUpdate - If true, in addition to broadcasting periodic updates,
it broadcasts every location update as it is found,
using intent action com.your.package.name.littlefluffylocationlibrary.LOCATION_CHANGED_TICK. The default is false
AlarmFrequency - How often to broadcast a location update in milliseconds, if one was received.
For battery efficiency, this should be one of the available inexact recurrence intervals.
You are not prevented from using any other value.The default is AlarmManager.INTERVAL_FIFTEEN_MINUTES.
LocationMaximumAge - The maximum age of a location update.
If when the alarm fires the location is older than this, a location update will be requested.
The default is AlarmManager.INTERVAL_HOUR.
- UseFineAccuracyForRequests (useFineAccuracyForRequests As Boolean)
Uses fine accuracy for requests.
- getLocationInfo (intent As IntentWrapper) As LocationInfo
Returns the latest LocationInfo object from an intent.
You should call this from your BroadCastReceiver OnReceive method.
Permissions:
- android.permission.ACCESS_COARSE_LOCATION
- android.permission.ACCESS_FINE_LOCATION
- android.permission.RECEIVE_BOOT_COMPLETED
RSFluffyLocationInfo
Methods:
- AnyLocationDataBroadcast As Boolean
Returns true if any location data been broadcast since the last reboot
- AnyLocationDataReceived As Boolean
Returns true if any location data been received since the last reboot.
- HasLatestDataBeenBroadcast As Boolean
Returns true if the location data in the object has already been broadcast.
- Initialize
Initializes the RSFluffylocation Library.
PackageName - Your package name of your app.
- IsInitialized As Boolean
- Refresh
Refresh the fields with the latest location info
Properties:
- Accuracy As Int [read only]
Gets the last location update's accuracy, in metres
- Latitude As Float [read only]
Gets the last location update's latitude.
- LocationBroadcastTimestamp As Long [read only]
Gets the time a location update was last broadcast, in milliseconds
- LocationUpdateTimestamp As Long [read only]
Gets the time the last location update was recorded, in milliseconds
- Longitude As Float [read only]
Gets the last location update's longitude
- Provider As String [read only]
Gets the latest location provider.
- TimestampAgeInSeconds As Long [read only]
Returns the age of the last location update in seconds