Christopher Francisco
Christopher Francisco

Reputation: 16278

Using Google Play Services from a Service: alternate flow of events

I'm working on a Service that will track the user's location using LocationClient from Google Play Services. Everything works fine, so now I want to consider alternate event flows like:

  1. The user doesn't have Play Services on its phone
  2. The user doesn't even have Google Play Store and is still using the Market app
  3. How to handle any different case that those 2 above that will trigger onConnectionFailed()
  4. The Service shouldn't be stopped unless certain condition has been met, so is onDisconnect() even going to be called (since LocationClient#disconnect() is not called)

Generally, when doing this inside an Activity you would just present a Dialog (from GooglePlayServicesUtil.getErrorDialog() ) or similar to let the user know, but since this is a Service with no Activity related to it, how am I supposed to handle this kind of errors

Upvotes: 1

Views: 46

Answers (1)

eleven
eleven

Reputation: 6857

Create and show notification from your Service. When user clicks on it show Activity where errors/fails are described.

Upvotes: 1

Related Questions