android - Handling app updates (AlarmManager) -


i developing app connects , modifies data in database executing php files.

if need make changes database or php files, may cause old versions of app behave unexpectedly , crash. reason, want force users update app when such changes made.

right now, have method connects database , compares apps version databases version. works fine call every time access database (very often) slows down usage of app. there better way this? have read use alarmmanager or broadcastreceiver check updates every x amount of hours. if user closes , doesn't use app few days. these timers called user starts app , able force update?

the android alarmmanager api let communicate , program alarm android alarm service. think of similar linux cron job. alarm programmed, it'll triggered if app isn't running, because alarm triggered alarm service , not app. instance, thing need program alarm. it's important note when restart device alarms cleared, need reprogram in every reboot. can capturing boot_completed broadcast, can reprogram alarm every time device boots up. check out definition of android alarmmanager. common pattern want program alarm sends broadcast or starts service, in service can query server. need consider when device sleeping alarms couldn't sent, need work wakelocks. class that, check out.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -