是有可能检测是否在蜂窝网络中的Android可用? [英] Is it possible to detect if the cellular network is available in Android?
问题描述
我已经创建了一个应用程序,可以对一个按钮,点击发送短信,但奇怪的问题是,当没有覆盖的应用程序强制关闭或没有信息发送。所以我想检查是否有手机信号覆盖,如果让我用发送短信或者请再试一次OK!
I have created an app that can send text message on a click of a button but strange problem is that when there no coverage the app force closes or sends in no information. so I would like check if there is any cellular coverage if so I am OK with sending SMS or else please try again!
这可能吗?
谢谢!
推荐答案
如果您通过覆盖不足,无连接的意思是,你可以看看这个:
的http://developer.android.com/reference/android/net/ConnectivityManager.html#EXTRA_EXTRA_INFO
If you mean by "lack of coverage", no connectivity, you can check this out: http://developer.android.com/reference/android/net/ConnectivityManager.html#EXTRA_EXTRA_INFO
检查:EXTRA_NO_CONNECTIVITY
check:EXTRA_NO_CONNECTIVITY
如果你正在谈论的信号强度那么....你也可以用这个作为参考:
If you are talking about signal strength then.... you can also use this as a reference:
http://developer.android.com/reference/android/telephony/ SignalStrength.html
这篇关于是有可能检测是否在蜂窝网络中的Android可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!