读取手机参数
来源:互联网 发布:用c语言输出九九乘法表 编辑:程序博客网 时间:2024/04/28 16:32
手机操作系统版本获取
public static int getSDKVersionNumber() {int sdkVersion;try {sdkVersion = Integer.valueOf(android.os.Build.VERSION.SDK_INT);Log.i("eee", "sdkver:" + sdkVersion);} catch (NumberFormatException e) {sdkVersion = 0;}return sdkVersion;}
手机的一些屏幕参数:
/** * get mobile phone screen info */ public void getScreenInfo(){ WindowManager win = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE); Display d= win.getDefaultDisplay(); int w = d.getWidth();// 宽度 int h=d.getHeight();// 高度 int or=d.getOrientation();// 0代表portrait,1代表landscape int pformat=d.getPixelFormat();// pixel format :sdk 文档public static final int RGBA_8888 (0x00000001) float frames=d.getRefreshRate();// 刷新频率frames per second每秒多少帧 int rotation=d.getRotation();// 旋转度数。1代表旋转90度。Returns the rotation of the screen from its "natural" orientation String str = "width: "+w+" height: "+h+" orientation: "+or +" pixelFormat: "+pformat+" refreshRate: "+frames+" rotation: "+rotation; System.out.println(str); }
结果:
01-16 18:09:43.336: I/System.out(24171): portrait竖屏
width: 480
height: 854
orientation: 0
pixelFormat: 1
refreshRate: 0.012
rotation: 0
01-16 18:11:32.586: I/System.out(24171): landscape横屏
width: 854
height: 480
orientation: 1
pixelFormat: 1
refreshRate: 0.012 值等于83.3333333,每秒钟约刷新83次
rotation: 1
- 读取手机参数
- 读取android手机设置的参数 (getprop )
- 读取手机通讯记录
- 读取手机像素
- android读取手机通讯录
- 读取手机通讯录
- 【转】手机”读取XML
- android 读取手机信息
- 分页读取手机联系人
- android 读取手机相册
- 读取手机内存文件
- 读取手机通讯录
- android 读取手机联系人
- 方便快捷读取手机联系人
- 读取手机通讯录信息
- 读取手机联系人
- 小米手机读取手机短信
- 读取手机联系人
- 状态压缩DP poj 2817 WordStack 入门题
- 来自微软一站式脚本示例库的新年礼物
- 英语从句分类与解析
- struts2中action不执行的问题
- 在Excel2010工作表中设置斜线标题
- 读取手机参数
- 编译错误:类型不匹配 mscomctl与Excel库
- Java程序员面试中的多线程问题
- PKU 2778 HDU 2243 AC自动机 + 矩阵乘法
- 归并排序/合并排序(merge_sort)详解
- 上传图片的综合验证
- malloc与realloc的区别
- NDK C 改写成C++时编译出现问题的解决方法
- 心得 - 如何读大型代码和写代码