java - How to Realize an Update Service is Running in the Background? -
i'm working on app android os displays data. ensure data up-to-date, required app fetches updates remote server time time. data not change often, update should carried out once per week. want give user ability choose weekday , daytime of update (and optionally disable feature completely).
the thing is: update should carried out when user not using phone @ moment, when phone sleeping , when phone has been rebooted , app hasn't been started yet.
the first thing thought of remote service starts @ system boot, determines time when run update, sets timer , waits/sleeps timer fire.
now, told should rather use alarm timers or kind of handlers... more read topic, more ways seem exist.
now, i'm bit lost method best me... here need:
i think here knows "newsrob" android? want realize pretty same newsrob-updateservice.
android service + broadcast receiver + alarm service solve purpose -
your service invoked broadcast receiver , in broadcast receiver should register various events - boot_receiver , action_user_present , take care of alarm reset , update task.
thanks.
Comments
Post a Comment