public class LocationMapComponent extends AbstractMapComponent implements android.hardware.SensorEventListener, android.location.GpsStatus.NmeaListener, android.location.LocationListener, android.content.SharedPreferences.OnSharedPreferenceChangeListener, android.location.GpsStatus.Listener
Provided Global Map Data:
String deviceType - from preferences (default: "a-f-G-U-C-I")
String deviceCallsign - from preferences (default: "ATAK")String devicePhoneNumber - requires
android.permission.READ_PHONE_STATEGeoPoint fineLocation - requires
android.permission.ACCESS_FINE_LOCATION and enabled in preferencesdouble fineLocationBearing - requires android.permission.ACCESS_FINE_LOCATION
and enabled in preferencesdouble fineLocationSpeed - requires android.permission.ACCESS_FINE_LOCATION
and enabled in preferencesdouble deviceAzimuth - modifications to deviceAzimuth outside of
LocationMapComponent will not be used by LocationMapComponent since this is just for read only
purposes. This bundle variable mirrors the local field mapDataDeviceAzimuth.
AbstractMapComponent.OnAllComponentsCreatedCallback| Modifier and Type | Field and Description |
|---|---|
static int |
GPS_TIMEOUT_MILLIS |
| Constructor and Description |
|---|
LocationMapComponent() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
_determineBestDeviceUID(android.content.Context context)
On the first run, determines the best possible device uid and persists it for the lifetime of
the saved preferences.
|
static java.lang.String |
_determineDeviceUID(android.content.Context context)
Determines the usable UID for the app.
|
static java.lang.String |
_fetchTelephonyLine1Number(android.content.Context context)
Obtains the telephone numvber associated with the device.
|
static java.lang.String |
callsignGen(android.content.Context ctx)
Produce a callsign based on a file that is included with the distribution ATAK that is
selected using the an algorithm seeded with the best determined device uid.
|
static java.lang.String |
fetchSerialNumber(android.content.Context context)
Retrieves a TAK generated serial number based on the device.
|
static java.lang.String |
fetchTelephonyDeviceId(android.content.Context context)
Retrives a TAK accessible telephony identifier based on the device.
|
static java.lang.String |
fetchWifiMacAddress(android.content.Context context)
Retrives a TAK accessible wifi mac address based on the device.
|
static boolean |
isValidTelephoneNumber(java.lang.String phone)
Check empty or known invalid
|
void |
onAccuracyChanged(android.hardware.Sensor sensor,
int accuracy) |
void |
onConfigurationChanged(android.content.res.Configuration newConfig)
Implementation of onConfigurationChanged used to handle configuration changes for each
mapComponent.
|
void |
onCreate(android.content.Context context,
android.content.Intent intent,
MapView view)
Called when the component is first created
|
protected void |
onDestroyImpl(android.content.Context context,
MapView view)
This method is invoked as a subset of the onDestroy call as part of the
MapComponent lifecycle.
|
void |
onGpsStatusChanged(int status) |
void |
onLocationChanged(android.location.Location loc) |
void |
onNmeaReceived(long timestamp,
java.lang.String nmea) |
void |
onProviderDisabled(java.lang.String provider) |
void |
onProviderEnabled(java.lang.String provider) |
void |
onResume(android.content.Context context,
MapView view)
Default implementation for an abstract map component which does not respond to the onResume
state transition.
|
void |
onSensorChanged(android.hardware.SensorEvent event) |
void |
onSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences,
java.lang.String key) |
void |
onStart(android.content.Context context,
MapView view)
Default implementation for an abstract map component which does not respond to the onStart
state transition.
|
void |
onStatusChanged(java.lang.String provider,
int status,
android.os.Bundle extras) |
addOverlay, onCreateOptionsMenu, onDestroy, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPrepareOptionsMenu, onStop, registerReceiver, removeOverlay, setOnAllComponentsCreatedCallback, unregisterReceiverpublic static final int GPS_TIMEOUT_MILLIS
public void onAccuracyChanged(android.hardware.Sensor sensor,
int accuracy)
onAccuracyChanged in interface android.hardware.SensorEventListenerpublic void onSensorChanged(android.hardware.SensorEvent event)
onSensorChanged in interface android.hardware.SensorEventListenerpublic void onNmeaReceived(long timestamp,
java.lang.String nmea)
onNmeaReceived in interface android.location.GpsStatus.NmeaListenerpublic void onGpsStatusChanged(int status)
onGpsStatusChanged in interface android.location.GpsStatus.Listenerpublic void onLocationChanged(android.location.Location loc)
onLocationChanged in interface android.location.LocationListenerpublic void onProviderDisabled(java.lang.String provider)
onProviderDisabled in interface android.location.LocationListenerpublic void onProviderEnabled(java.lang.String provider)
onProviderEnabled in interface android.location.LocationListenerpublic void onStatusChanged(java.lang.String provider,
int status,
android.os.Bundle extras)
onStatusChanged in interface android.location.LocationListenerpublic static java.lang.String callsignGen(android.content.Context ctx)
public void onCreate(android.content.Context context,
android.content.Intent intent,
MapView view)
MapComponentonCreate in interface MapComponentcontext - the context of the component (the MapActivity instance)intent - the intent of the MapActivityview - the main MapViewpublic static java.lang.String _determineDeviceUID(android.content.Context context)
context - is the context for the app.public static java.lang.String _determineBestDeviceUID(android.content.Context context)
protected void onDestroyImpl(android.content.Context context,
MapView view)
AbstractMapComponentonDestroyImpl in class AbstractMapComponentpublic void onSharedPreferenceChanged(android.content.SharedPreferences sharedPreferences,
java.lang.String key)
onSharedPreferenceChanged in interface android.content.SharedPreferences.OnSharedPreferenceChangeListenerpublic static java.lang.String fetchSerialNumber(android.content.Context context)
context - the context to usepublic static java.lang.String fetchTelephonyDeviceId(android.content.Context context)
context - the context to usepublic static java.lang.String fetchWifiMacAddress(android.content.Context context)
context - the context to usepublic static java.lang.String _fetchTelephonyLine1Number(android.content.Context context)
context - the context used to determine the telephone number.public static boolean isValidTelephoneNumber(java.lang.String phone)
phone - the phone number to checkpublic void onStart(android.content.Context context,
MapView view)
AbstractMapComponentonStart in interface MapComponentonStart in class AbstractMapComponentcontext - the context of the component (the MapActivity instance)view - the main MapViewpublic void onResume(android.content.Context context,
MapView view)
AbstractMapComponentonResume in interface MapComponentonResume in class AbstractMapComponentcontext - the context of the component (the MapActivity instance)view - the main MapViewpublic void onConfigurationChanged(android.content.res.Configuration newConfig)
MapComponentonConfigurationChanged in interface MapComponentonConfigurationChanged in class AbstractMapComponentnewConfig - called when the configuration changedActivity.onConfigurationChanged(Configuration)