开发者

Timer, or Handler for capturing data at regular intervals in Android mobile apps?

开发者 https://www.devze.com 2023-04-10 08:01 出处:网络
I am writing an Android app that uses the accelerometer t开发者_如何学编程o record captured data at regular time intervals and store them into SQLite.

I am writing an Android app that uses the accelerometer t开发者_如何学编程o record captured data at regular time intervals and store them into SQLite.

Is is better to use Timer (and TimerTask), or Handler for this task?


I would use a Handler in a TimerTask. Then I would use this task with a Timer.


I would personally use a Handler. How are you recording the data?


Handler is right way not timertask....You can directly use it for view invalidation not timer task

0

精彩评论

暂无评论...
验证码 换一张
取 消