I want to set up a timer in an Android application that will call a function after every 15/30/45 and n minutes when user login. But also it will stop timer when user log off. and timer begin from start if user login again. I want that option(15/30/45/n miutes) to be saved in database so that I can update list after sync.
Is Timer a good approach or I need to use alarm services? Or is there any system services required?
Is it possible to change previous doc/file in local phone database storage to new doc that is receiving through web server? is there any system services required to do so?
AlarmManager
for delays of this magnitude, withRTC
orRTC_WAKEUP
option, depending on your needs. Apart from that, it's hard to say what you mean by "user logs on/off". Either way, don't useTimer
on Android, it's almost always the wrong way. No Service required becauseAlarmManager
takes care of everything for you. – Hepato