You can check if your app is running over Simulator or Device.
public static boolean isSimulator(Context context){
boolean isSimulator = false;
TelephonyManager tManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String uuid = tManager.getDeviceId();
if(null==uuid ||uuid.equals("000000000000000")){
isSimulator = true;
}
return isSimulator;
}
Permission:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
No comments:
Post a Comment