Geocaching Game Service
The GeocachingGameService is a background service that receives location data from the Google Location Service and sends the latitude, longitude and distance travelled to listeners.
It is designed to be used primarily with Unity to solve the problem in geocaching games where distance travelled while the phone's screen is off or the app is otherwise not in the foreground doesn't count.
GeocachingGamePlugin is the actual entry point for the Unity application so it can send information to this service.
Finally, here's the references that I used to create this code (mostly here for my own sake):
- Author
- Rory
- Version
- 1.0
- Since
- 2017-01-21
- See also
- GeocachingGamePlugin
-
deovolente.games
◆ activateReporting()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.activateReporting |
( |
boolean |
isActive | ) |
|
This method activates or deactivates reporting data to listeners.
- Parameters
-
isActive | Activates reporting to listeners when true, deactivates when false. |
◆ deregisterListener()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.deregisterListener |
( |
GeocachingGamePlugin.LocationPluginListener |
listener | ) |
|
This method allows other classes to unregister their registered listeners.
- Parameters
-
listener | This is the listener to remove. |
◆ onBind()
IBinder com.deovolentegames.geocachingunityplugin.GeocachingGameService.onBind |
( |
Intent |
intent | ) |
|
◆ onConnected()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.onConnected |
( |
@Nullable Bundle |
bundle | ) |
|
◆ onConnectionFailed()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.onConnectionFailed |
( |
@NonNull ConnectionResult |
connectionResult | ) |
|
◆ onConnectionSuspended()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.onConnectionSuspended |
( |
int |
i | ) |
|
◆ onCreate()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.onCreate |
( |
| ) |
|
◆ onDestroy()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.onDestroy |
( |
| ) |
|
◆ onLocationChanged()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.onLocationChanged |
( |
Location |
location | ) |
|
◆ registerListener()
void com.deovolentegames.geocachingunityplugin.GeocachingGameService.registerListener |
( |
GeocachingGamePlugin.LocationPluginListener |
listener | ) |
|
This method allows other classes to register listeners to this service that get called when the location is updated.
- Parameters
-
listener | This is the listener to add. |
◆ locationAccuracy
float com.deovolentegames.geocachingunityplugin.GeocachingGameService.locationAccuracy = 20 |
|
static |
◆ locationFastestInterval
int com.deovolentegames.geocachingunityplugin.GeocachingGameService.locationFastestInterval = 1000 |
|
static |
◆ locationInterval
int com.deovolentegames.geocachingunityplugin.GeocachingGameService.locationInterval = 5000 |
|
static |
◆ maxSpeed
float com.deovolentegames.geocachingunityplugin.GeocachingGameService.maxSpeed = 5f |
|
static |
◆ minSpeed
float com.deovolentegames.geocachingunityplugin.GeocachingGameService.minSpeed = 0.1f |
|
static |
◆ TAG
final String com.deovolentegames.geocachingunityplugin.GeocachingGameService.TAG = GeocachingGameService.class.getSimpleName() |
|
static |
The documentation for this class was generated from the following file:
- Z:/Projects/Unity/GeocachingGamePlugin/GeocachingUnityPlugin/app/src/main/java/com/deovolentegames/geocachingunityplugin/GeocachingGameService.java