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;
}