w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android backround service

Did you try service bind mechanism?

You can create service for collecting GPS data (http://developer.android.com/guide/components/services.html), start it on application startup (http://developer.android.com/guide/components/services.html#StartingAService), bind this service on starting your activity and use binder object for transferring data between the service and activity (http://developer.android.com/guide/components/bound-services.html), unbind on closing your activity and service will continue working on background.

In this model, your service will work always and will transfer data when it needed.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.