解决方案 »
- cursor.getColumnIndex(PhoneLookup.NUMBER);没取到值
- 请问关于intent和synchronized的问题
- Android AppWidget框架妄析: Android中的借尸还魂
- android 视频播放问题
- 想学习的朋友,可以进这个网站下载视频资料!很不错的自学教程!
- Toast的应用-如何显示长信息总结
- 自定义通知栏样式
- 大家手机连接电脑用什么工具
- 一个普通用户对阿里系应用与百度系应用卡顿的困惑
- android 蓝牙BluetoothGatt 问题,修改连接超时时间,onConnectionUpdated问题
- Android录制视频能以流的形式输出吗?
- 谁能帮我解释这段代码 虽然会很难 还请大家帮帮忙
有个例子:TelephonyManager tm=(TelephonyManager )activity.getSystemService(Context.TELEPHONY_SERVICE);
if(tm==null || !this.hasTelephony())
{
Log.v(TAG, "Can't get telephony service. Forcing shut down!");
return false;
}
String deviceId=tm.getDeviceId();
if(deviceId==null || deviceId.length() < 2)
{
Log.v(TAG, "Looks like emulator - bail out!");
Toast.makeText(activity, "This special version not intended to run in this device!", 5000).show();
return false;
}
关于如何检测到安装到模拟器,请参考:http://stackoverflow.com/questions/2799097/how-can-i-detect-when-an-android-application-is-running-in-the-emulator