如何检测系统信息,如os或设备类型

编程入门 行业动态 更新时间:2024-10-28 16:22:44
本文介绍了如何检测系统信息,如os或设备类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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");

如何获取其他属性?

推荐答案

编辑:要获得有用属性的完整概述,我将它们全部结合在我的ErrorHandler活动中(开始在第56行读取): github/simon-heinen/SimpleUi/blob/ master / SimpleUI / srcAndroid / simpleui / util / DeviceInformation.java#L56

edit: to get a complete overview of useful attributes, I combined them all together in my ErrorHandler activity (start to read at line 56): github/simon-heinen/SimpleUi/blob/master/SimpleUI/srcAndroid/simpleui/util/DeviceInformation.java#L56

Windows和键盘的存在是个好主意,我添加了一些更多的调试信息目的:

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 + ")";

更多推荐

如何检测系统信息,如os或设备类型

本文发布于:2023-11-27 05:50:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636848.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:检测系统   设备类型   信息   os

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!