How to schedule a service to run in android -


i have service in app make api request , use data supplied in response, there way schedule service run in every hour thank

that's how did @ end :

calendar cal = calendar.getinstance(); intent intent = new intent(this, proximityalertservice.class); pendingintent pintent = pendingintent.getservice(this, 0, intent, 0); alarmmanager alarm = (alarmmanager)getsystemservice(context.alarm_service); log.d("main",string.valueof( cal.gettimeinmillis())); //make alarm goes off every 10 sec (not exact save battery life) alarm.setinexactrepeating(alarmmanager.rtc_wakeup, cal.gettimeinmillis(), 10000, pintent); 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -