我已经完成了一个Android应用程序来启动对另一个号码的调用。
步骤
但是连接已经消失并显示一条消息。现在在尝试启动第二个呼叫时显示错误消息“错误!!检查您的Internet连接”..
首次启动通话时,GPRS / WIFI消失了
请帮助
但是在模拟器中它的工作正常...在Android设备中连接已经消失
答案 0 :(得分:1)
GPRS在大多数设备上进行语音通话时断开连接。
引用Wikipedia:
Class B
Can be connected to GPRS service and GSM service (voice, SMS), but using only one or the other at a given time. During GSM service (voice call or SMS), GPRS service is suspended, and then resumed automatically after the GSM service (voice call or SMS) has concluded. Most GPRS mobile devices are Class B
答案 1 :(得分:0)
我明白了
检查Android设备上是否存在互联网连接
ConnectivityManager connec = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED
|| connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTING
|| connec.getNetworkInfo(0).getState() == NetworkInfo.State.SUSPENDED
|| connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING
|| connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED
|| connec.getNetworkInfo(1).getState() == NetworkInfo.State.SUSPENDED) {
return true;
} else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED
|| connec.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED) {
return false;
}
return false
;