/** 判断是否模拟器。如果返回TRUE,则当前是模拟器
* @param context
* @return
*/
public static boolean isEmulator(Context context){
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = tm.getDeviceId();
if (imei == null || imei.equals("000000000000000")){
return true;
}
return false;
}
这个方法没大量测试过,应该是WORK的,一般真机都有IMEI的,不过也见过工程机的IMEI是000000000000000还是0。
更多android例子请关注 android学习手册,360手机助手中下载
查mei