首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

判断真机仍是模拟器

2012-09-05 
判断真机还是模拟器?TelephonyManager telmgr (TelephonyManager) getSystemService(Context.TELEPHONY_

判断真机还是模拟器

?TelephonyManager telmgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);?? ? ? ? ? ? ? ? String deviceID = telmgr.getDeviceId();?
? ? ? ? ? ? ? ? boolean isEmulator = "000000000000000".equalsIgnoreCase(deviceID);?
?
????????????????
??????????????? if (isEmulator) {?
? ? ? ? ? ? ? ? ? ? ((myApp) getApplication()).setBitmapX(BitmapFactory.decodeFile(imageFileName));?
? ? ? ? ? ? ? ? } else {?
? ? ? ? ? ? ? ? ? ? ((myApp) getApplication()).setBitmapX(BitmapFactory.decodeByteArray((byte[]) args[0], 0, ((byte[])args[0]).length));?
? ? ? ? ? ? ? ? }?

热点排行