Using Google Play Services LocationClient in background service

Full source code for a background service available here:

https://gist.github.com/blackcj/20efe2ac885c7297a676

Try adding the super call to your onStartCommand.

/**
 * Keeps the service running even after the app is closed.
 * 
 */
public int onStartCommand (Intent intent, int flags, int startId)
{
    super.onStartCommand(intent, flags, startId);

    setUpLocationClientIfNeeded();
    if(!mLocationClient.isConnected() || !mLocationClient.isConnecting())
    {
        mLocationClient.connect();
    }

    return START_STICKY;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)