Location service object & location in general.
Issue #27
resolved
Location is a cross cutting concern in our application. We need to make this easy to get to and sadly the android API does not :).
We should have a service object in our app that allows us to easily track the user's location, and register callbacks to be triggered with location changes.
@engrMiguel @brandonthai2003 please comment with any suggestions.
I suggest the following, so we can also handle location both pull or push:
LocationService
| --> setLocationChangedHandler
| --> requestLocation(Callback)
Comments (5)
-
reporter -
reporter Also, like the other service objects, the constructor will take in a context. It's so we can have access to the same context the activity sees. :)
-
reporter -
assigned issue to
-
assigned issue to
-
reporter Hmm.. tracking location is pretty expensive on the battery. This might be something best done when polling for new ads.
-
reporter - changed status to resolved
Done.
LocationService.getInstance() to get the current instance LocationService.requestLocation // requests a single location returned in a callback LocationService.requestConstantUpdates will request locaiton updates.
```
- Log in to comment
I'll take this on in the next sprint. If you need a "location" for the time being, I suggest creating this object with stub methods.
I.e. the requestLocaiton method will just invoke the callback with either random or fixed data.