Search code examples
androidsynchronizationaccount

Syncing the website account with android app


i was thinking if there is anyway to sync android app with a web/website account. Basically, if the user logs in through the web, i want the android app to log in/start up/show notification. Should i use a background service in android to monitor the account or something else Please help Thanks


Solution

  • As far as I can see, you have a couple of options:

    1. Use a background service (as you suggested) which is constantly running and checking. This will be battery consuming.
    2. Use the AlarmManager to schedule a repeating alarm to check on a scheduled interval. This will be less battery consuming but also less immediate (unless you set a low interval which will consume a lot of battery).
    3. Use a push message. This will be the most accurate and least battery consuming for your phone, but it's also the most advanced (difficult) to set up.