android - How to check if a cell tower connection exists? -
In my Android app, I have to gather a lot of information about network names like cell tower, network code, First I start capturing all those things which I have to ensure that cell tower connections are present ie GSM or CDMA, but I want to make sure that there is a connection otherwise I would just like to go back. For example, as we do in the case of Wi-Fi, WifiEnabled () method, with the help of WifiManager, ensures we first hand whether we have WiFi running or not.
Similarly, for the cell tower.
As you can see in the post, you can find it as below
Boolean Havanwork = android.telephony.TelephonyManager.getNetworkType ()! = Android .telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN; // True, if the phone is connected to any type of network i.e. signals is another way from the same link, but is not marked as a solution, then the network operator Regional Boolean Hammoby is available (Reference apconnectext) {Telephony Manager Telecommunication = (Telephony Manager) Apcontext.Get System System (Reference. TELEPHONY_SERVICE); Return (tel.getNetworkOperator ()! = Null & amp; tel.getNetworkOperator (.) Equal ("")) False: True); }
Comments
Post a Comment