Task: you need to check at startup whether the application is connected to Bluetooth, and also to the Internet.
If something of the voiced falls off during the work or the user is forced down, the application issues a message and stops the work algorithm. For example, it will not break into a server until it gains access to the network. Or (which is natural) will not look for devices, but if the bluetooth works, it will automatically continue.
Please tell me what I need to read and what methods should I use in my project?
So far I have learned only to check the connection. But how to detect a sudden disconnection or loss of the network, and wait in real time until it appears, until I know. How to turn to search - too.