• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Check location in background service

touchit

Lurker
Hello,
I have following issue..
I wanna background service which is looking every minute for the location.
So I created a service and created a broadcast receiver connected to the alarm service.
That works generally fine.

Now I wanna check the Location in that Service, I have a Service which is looking first for "gps" and if not available then for "network" location. That works fine!

Now my confusing case: If I am at home and connected to the WLAN the Location is found every minute and give me an notification in android bar all is fine!

But if I am on street and go around it doesnt work. The Service is just running when I touch the screen and make it active, then the service starts and gives me the location.

Have somebody an idea? Why the service just works at street when I have the screen active? And at home in my WLAN it works always even the screen is not active.

best regards..
 
OK I think my description was to confusing... :rolleyes:

I noticed the difference now:

If the phone connected to charging then the service run every minute and give me a notification with actual location.

If the phone is NOT connected for charging then the service runs just sporadic or when the display is active.

So is it possible to force that the service runs every minute to look for location also the phone is not connected to charging and screen is not active???

Edit: OK the key word was RTC_WAKEUP I am curious about the battery life time...
maybe somebody have experience with location trackers and battery life time optimizing???
 
Back
Top Bottom