Code example for TelephonyManager

Methods: isNetworkRoaming

0
    public String getDeviceId() {
        return tm.getDeviceId();
    } 
 
    public boolean isRoaming() { 
        return tm.isNetworkRoaming();
    } 
 
    public boolean isTablet() { 
        return DeviceRole.TABLET == getDeviceRole(); 
    } 
     
    public boolean isSmartphone() { 
        return DeviceRole.SMARTPHONE == getDeviceRole(); 
    } 
     
    public DeviceRole getDeviceRole() { 
        try { 
            // Compute screen size 
            DisplayMetrics dm = context.getResources().getDisplayMetrics();
            float screenWidth  = dm.widthPixels / dm.xdpi;