I want to create an application for Android smartphones that checks if the phone is in airplane mode. If so, the application pulls the phone out of airplane mode and checks if there is a network connection to send SMS. When I talk about connecting to a network, I mean the coverage of a mobile network for sending SMS, I do not want to check the Internet connection. If there is a network connection, the application will try to send SMS.
I managed to check the flight mode and switch, but I did not find a way to find out if the phone is connected to the cellular network, and if there is coverage. I found many examples that test Internet connectivity, but that is not what I need.
Is there a way to check if the phone is connected to the cellular network and is there coverage for sending SMS?
Thanks in advance for your help.
source share