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
Post a Comment