2011-03-10 122 views

回答

-1
Detect the phone's network programmatically to send sms 
public int getNetworkType() { 
     int type = 0; 
     int networkType = RadioInfo.getNetworkType(); 
     switch (networkType) { 
     case RadioInfo.NETWORK_GPRS: // GSM 
      type = 0; 
      break; 
     case RadioInfo.NETWORK_CDMA: //CDMA 
      type = 1; 
      break; 
     case RadioInfo.NETWORK_IDEN: //GSM 
      type = 0; 
      break; 
     default: 
      type = 0; //GSM 
      break; 
     } 
     return type; 
    } 
+0

這與這個問題有什麼關係? – 2012-10-20 02:05:37