mat_vee
mat_vee

Reputation: 85

Android multithreading for services

I have 2 tasks first is get the periodic location update and at the same time update the timer. If I run one thread for update the location and other for the timer,Is this is good design or not? If yes then how should I approach the solution i.e.use handler/asyncTask ?

Upvotes: 0

Views: 101

Answers (2)

manjusg
manjusg

Reputation: 2263

If you want to have work queue like refresh location for every 60 seconds then Intentservice serves your purpose.

Upvotes: 1

Rafael T
Rafael T

Reputation: 15689

If these are the ony Tasks which should work i would suggest to run locationUpdates inside ActivityThread, while a Timer is run in its own Thread anyways (though the TimerTask{ run() } implementation.) This is the best answer I can serve with as long as I don't know more infos, what you have tried, and what you want t o archive

Upvotes: 0

Related Questions