android 获取手机系统信息

String phoneInfo = "Product: " + android.os.Build.PRODUCT;

        phoneInfo += ", CPU_ABI: " +android.os.Build.CPU_ABI;

        phoneInfo += ", TAGS: " +android.os.Build.TAGS;

        phoneInfo += ", VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE;

        phoneInfo += ", MODEL: " +android.os.Build.MODEL;

        phoneInfo += ", SDK: " +android.os.Build.VERSION.SDK;

        phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;

        phoneInfo += ", DEVICE: " +android.os.Build.DEVICE;

        phoneInfo += ", DISPLAY: " +android.os.Build.DISPLAY;

        phoneInfo += ", BRAND: " +android.os.Build.BRAND;

        phoneInfo += ", BOARD: " + android.os.Build.BOARD;

        phoneInfo += ", FINGERPRINT: " +android.os.Build.FINGERPRINT;

        phoneInfo += ", ID: " +android.os.Build.ID;

        phoneInfo += ", MANUFACTURER: " +android.os.Build.MANUFACTURER;

       phoneInfo += ", USER: " + android.os.Build.USER;

 

 

Product: soju,

 CPU_ABI: armeabi-v7a,

TAGS: release-keys,

VERSION_CODES.BASE: 1,

MODEL: Nexus S,

SDK: 10,

VERSION.RELEASE: 2.3.6,

DEVICE: crespo,

DISPLAY: GRK39F,

BRAND: google,

BOARD: herring,

FINGERPRINT:google/soju/crespo:2.3.6/GRK39F/189904:user/release-keys,

ID: GRK39F,

MANUFACTURER: samsung,

USER: android-build

 

DisplayMetrics metric = new DisplayMetrics();

       getWindowManager().getDefaultDisplay().getMetrics(metric);

        int width = metric.widthPixels // 屏幕宽度(像素)

        int height = metric.heightPixels // 屏幕高度(像素)

        float density = metric.density // 屏幕密度(0.75 / 1.0 / 1.5

       int densityDpi = metric.densityDpi// 屏幕密度DPI120 / 160/ 240

 

Toast.makeText(this,

              "屏幕宽度 : " + width+" 屏幕高度:"+height+" 屏幕密度:"+density+" 屏幕密度DPI"+densityDpi,

              Toast.LENGTH_LONG).show();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值