0

I am creating an app that requires a local database to be updated every time there has been a change in the server database. I want to run a service that runs every 2 minutes and updates the local database using ORMLite.

Would an IntentService be the best route to do this? Also I am getting mixed results on my searches about if all services are asynchronous or do I have to call a asynctask in Services other than IntentService.

Any suggestions on which direction I should go would be greatly appreciated!

Gray
  • 115,027
  • 24
  • 293
  • 354
Darussian
  • 1,573
  • 1
  • 16
  • 28

1 Answers1

0

I think what you need here is a Bound Service It helps you deal with client-server model, where you main application can take advantage of background service. This service will do the job for you in background. With IntentService, this concept becomes a little bit different, you should handle this when you have a spefic job needed to be done in a short time ( not periodically like yours).

And because of frequent updatings , I think you should keep a socket connection to your server to receive pushed updates from it ( I think some mail clients do this way).

Hope this helps.

toantran
  • 1,789
  • 17
  • 25