Android代码片段:设备信息
来源:互联网 发布:南京风水 知乎 编辑:程序博客网 时间:2024/06/03 12:30
设备ID
/** * Use for getting your device id if available. * * @param context * @return your device id */ public static String getDeviceId(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return telephonyManager.getDeviceId(); }
获取APP图标
/** * use for getting application Icon. * * @param mContext * @return Icon as drawable from the application */ public static Drawable getAppIcon(Context mContext) { Drawable icon = null; final PackageManager pm = mContext.getPackageManager(); String packageName = mContext.getPackageName(); try { icon = pm.getApplicationIcon(packageName); return icon; } catch (NameNotFoundException e1) { e1.printStackTrace(); } return null; }
0 0
- Android代码片段:设备信息
- [代码片段] Android实用代码片段整合
- android常用代码片段
- android 代码片段
- Android 代码片段
- android有用代码片段
- android常用代码片段
- android有用代码片段
- android有用代码片段
- android有用代码片段
- Android实用代码片段
- android常用代码片段
- Android代码片段
- Android常用代码片段
- Android 代码片段
- android 代码片段
- Android有用代码片段
- Android 常用代码片段
- [leetcode] 75.Sort Colors
- 在开发环境的DDMS中输出异常的堆栈信息
- iOS设计模式——Category
- HDU ACM 1047 Integer Inquiry->大数相加
- Android酷炫实用的开源框架(UI框架)
- Android代码片段:设备信息
- 并行编程,绝不是你想的那么简单
- Java中的SerialVersionUID
- C#获取日期汇总
- 【构建Android缓存模块】(三)Controller & 异步图片加载
- SVN服务器客户端以及环境的搭建和使用
- MFC DLL PreTranslateMessage 导致的快捷键不响应的问题?
- 2015年大一下第13周项目1-小玩文件
- Building a Raspberry Pi 2 WebRTC camera