Application running in background in android -
i want run application in background. want make application when battery down specific level have send sms someone. if phone on standby or playing game , battery level reach 5% have send sms. want know how run application in background??
if (btrylevelorig==batterylevel) { toast.maketext(getapplicationcontext(), "level", toast.length_short).show(); sendsms(); }
you have use android service . if have show user interaction notification, can run service foreground using startforeground
check link create own background custom service. make sure onstartcommand return start_sticky run service continuously .
Comments
Post a Comment