Location service object & location in general.

Issue #27 resolved
Raymond Wells created an issue

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)

  1. Raymond Wells reporter

    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.

  2. Raymond Wells 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. :)

  3. Raymond Wells reporter

    Hmm.. tracking location is pretty expensive on the battery. This might be something best done when polling for new ads.

  4. Raymond Wells reporter

    Done.

    LocationService.getInstance()  to get the current instance
    LocationService.requestLocation // requests a single location returned in a callback
    
    LocationService.requestConstantUpdates will request  locaiton updates.
    

    ```

  5. Log in to comment