Android Story

[ Android ] Network type

WhiteDuck 2016. 12. 19. 09:16

안드로이드에서의 네트워크 타입


TelephonyManager teleMan =  
            (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
int networkType = teleMan.getNetworkType();

switch (networkType)
{
case 7:
    textV1.setText("1xRTT");
    break;      
case 4:
    textV1.setText("CDMA");
    break;      
case 2:
    textV1.setText("EDGE");
    break;  
case 14:
    textV1.setText("eHRPD");
    break;      
case 5:
    textV1.setText("EVDO rev. 0");
    break;  
case 6:
    textV1.setText("EVDO rev. A");
    break;  
case 12:
    textV1.setText("EVDO rev. B");
    break;  
case 1:
    textV1.setText("GPRS");
    break;      
case 8:
    textV1.setText("HSDPA");
    break;      
case 10:
    textV1.setText("HSPA");
    break;          
case 15:
    textV1.setText("HSPA+");
    break;          
case 9:
    textV1.setText("HSUPA");
    break;          
case 11:
    textV1.setText("iDen");
    break;
case 13:
    textV1.setText("LTE");
    break;
case 3:
    textV1.setText("UMTS");
    break;          
case 0:
    textV1.setText("Unknown");
    break;
}


출처 : http://stackoverflow.com/questions/2919414/get-network-type

반응형