android:获取屏幕分辨率,屏幕密度

DisplayMetrics dm = getResources().getDisplayMetrics() ;
int
screenWidth = dm. widthPixels ;
int
screenHeight = dm. heightPixels ;
Log.d( "liudezu" , "==========屏幕分辨率:" + "(" +screenWidth+ "," +screenHeight+ ") \n " ) ;
Log.d( "liudezu" , "==========屏幕密度" +dm. density + " 屏幕dpi:" +dm. densityDpi ) ;

android.os.Build的一些常使用常量:


 BOARD
The name of the underlying board, like "goldfish".主板名称

BOOTLOADERThe system bootloader version number.系统引导程序版本号

BRANDThe brand (e.g., carrier) the software is customized for, if any.android系统定制商

CPU_ABI
The name of the instruction set (CPU type + ABI convention) of native code.CPU 和ABI的本地代码指令集
 CPU_ABI2The name of the second instruction set (CPU type + ABI convention) of native code.

DEVICEThe name of the industrial design.设备参数

DISPLAYA build ID string meant for displaying to the user显示屏参数

FINGERPRINTA string that uniquely identifies this build.硬件名

HARDWARE
The name of the hardware (from the kernel command line or /proc).内核命令行中的硬件名

HOST 

IDEither a changelist number, or a label like "M4-rc20".修改版本列表

MANUFACTURERThe manufacturer of the product/hardware.硬件厂商

MODELThe end-user-visible name for the end product.版本

PRODUCTThe name of the overall product.手机厂商

RADIOThis field was deprecated in API level 14. The radio firmware version is frequently not available when this class is initialized, leading to a blank or "unknown" value for this string. Use getRadioVersion() instead.

SERIALA hardware serial number, if available.
            
   
   
 
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值