Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/middleware/AppLocationManager.java
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | public void onProviderEnabled(String provider) { | ||||
requestGPSPositionUpdates(); | requestGPSPositionUpdates(); | ||||
} | } | ||||
@Override | @Override | ||||
public void onProviderDisabled(String provider) { | public void onProviderDisabled(String provider) { | ||||
locMan.removeUpdates(this); | locMan.removeUpdates(this); | ||||
} | } | ||||
/** | |||||
* Interface to be implemented to get the location request | |||||
*/ | |||||
public interface LocationRequester{ | public interface LocationRequester{ | ||||
/** | |||||
* Do something with the newly obtained location | |||||
* @param loc the obtained location | |||||
*/ | |||||
void onLocationChanged(Location loc); | void onLocationChanged(Location loc); | ||||
/** | |||||
* Inform the requester that the GPS status has changed | |||||
* @param status new status | |||||
*/ | |||||
void onLocationStatusChanged(int status); | void onLocationStatusChanged(int status); | ||||
/** | |||||
* Give the last time of update the requester has | |||||
* Set it to -1 in order to receive each new location | |||||
* @return the time for update in milliseconds since epoch | |||||
*/ | |||||
long getLastUpdateTimeMillis(); | long getLastUpdateTimeMillis(); | ||||
/** | |||||
* Get the specifications for the location | |||||
* @return fully parsed LocationCriteria | |||||
*/ | |||||
LocationCriteria getLocationCriteria(); | LocationCriteria getLocationCriteria(); | ||||
} | } | ||||
} | } |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register