如何检测像操作系统或设备类型的系统信息 [英] How to detect system information like os or device type

查看:280
本文介绍了如何检测像操作系统或设备类型的系统信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最重要的事情,我想知道的是设备类型,操作系统版本,如果它有一个硬件键盘,也许是屏幕分辨率。但如果你知道其他有用的调试信息,请添加它们:)

The most important things i want to know are the device type, the os version, if it has a hardware keyboard and maybe the screen resolution. but if you know other useful debug information please add them :)

我发现本作的操作系统版本:

i found this for the os version:

string+="OS Version: "+System.getProperty("os.version");

我如何获得其他属性?

how do i get the other properties?

推荐答案

编辑:获得有用的属性,一个完整的概述,我在我的ErrorHandler活动结合它们放在一起(开始读取行559):<一href="https://github.com/bitstars/SimpleUi/blob/master/SimpleUI/src/tools/ErrorHandler.java#L559">https://github.com/bitstars/SimpleUi/blob/master/SimpleUI/src/tools/ErrorHandler.java#L559

edit: to get a complete overview of useful attributes, I combined them all together in my ErrorHandler activity (start to read at line 559): https://github.com/bitstars/SimpleUi/blob/master/SimpleUI/src/tools/ErrorHandler.java#L559

Windowsize和键盘presence是一个不错的主意,我增加了一些更相关信息用于调试的目的:

Windowsize and keyboard presence were a good idea, i added some more infos for debug purpose:

String s="Debug-infos:";
s += "\n OS Version: " + System.getProperty("os.version") + "(" + android.os.Build.VERSION.INCREMENTAL + ")";
s += "\n OS API Level: " + android.os.Build.VERSION.SDK_INT;
s += "\n Device: " + android.os.Build.DEVICE;
s += "\n Model (and Product): " + android.os.Build.MODEL + " ("+ android.os.Build.PRODUCT + ")";

这篇关于如何检测像操作系统或设备类型的系统信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆