More information. What are you trying to do?
Am am in a foreign country indefinitely due to Covid (Taiwan - they have no Covid, they keep extending the time we can stay here and there is no sense going back to the US while it is such a mess). Most of the time I am connected to a wireless network with my Android which meets my connectivity needs. I bought an old iphone for development and decided to buy a pay as you go data plane for it with a local phone # so I could be connected when I am out and about.
At least One of the places where I connect wirelessly has issues in some rooms and disconnects so I wind up burning up data from my cheapo plan. I thought I would do a quick and dirty program that would just remind me with a tone to turn on/off airplane mode when I am connected to a wireless network. The situation varies, for example I am connected at my local 7-11 (they are really big here) but it is always a quick in and out so I wouldn't change the setting there, But when I leave the house and will be disconnected from the wireless for a while I want to turn off Airplane mode. When I get home, turn it in again.
If it is possible to turn airplane mode on/off from within my app that would be a bonus - save me from having to go to settings. If that requires a separate approval that is OK.
But I would be happy with a tone1 and a vibrate when connected and a tone2 and vibrate when disconnected.
I figure I could probably do something with a timer and check for a wireless connection every few minutes but I was hoping that there might be an event I could just hook to all the time.
Thanks