How do you make a alarm which will work even if app is closed?

Send a dm to @Anke and ask him how to use his extension

Also see the BackgroundTaskExtension it will work even if the app is closed

oh i see.. thanks..

when you mean background the app is not totally closed he's on the recent app only?

Try using onPause. If you simply close out the app it can still be open in the background. Depends how it's closed.

That's only is in its name it will work when the app is closed if the app is in recent it do not work

sir what if user use the recent button then closed the app. is there event i can depend so that before user closed the app i can execute a command.

@val_masing1 use this Extension By @Taifun
This will also work ing Background or app is closed or even phone is off
If you found this helpful mark this as solution
https://puravidaapps.com/alarmmanager.php

yes sir i will try..

thats what i talking sir. when user click the exit button after he click the recent button.. if there is event so that i can execute a command before the app closed.

onPause or onStop method?

I didn't get you can you please explain

on your activity lifecycle ext. sir??

ok sir. if user click the recent button all recent app will appear. then the user have option to close the app.. look the picture thats a recent apps., what im askin if the user close on that way if there is event so that i can write a command and execute before the app closed.

Ok, like you said in your recent posts:
When TaifunWifi disconnected
then do my task

yes sir.. i want to remove the ssid when user close the app on that way. so that he can no longer use the wifi when he closed the app.

I am not sir :laughing: :laughing:, I'm 10 year-old student

No longer use WiFi for App or Full Phone

Like I said use Extension - Activity Lifecycle of an app (onPause → onStop → onResume)

Read the page and it explains how it works. There are blocks e.g. onStop and onPause that allow you do exactly what your asking. Just put what ever you want to run when the app is closed in those blocks. And try it.

thanks sir. it works but the problem is when the user click the recent button the command execute even though i choose the onStop control. i better read first.

it wont work sir because onStop will trigger if the app is not visible. so that when user click the recent button the command execute. what i need is execute the command before the app is closed.

maybe the onDestroy control is all i need sir.