[英]How to get Device Feature Information in Android?
我想顯示我的應用程序使用的設備功能信息。 例如:這樣的信息
android.hardware.location.network
android.hardware.wifi
com.google.android.feature.GOOGLE_BUILD
android.hardware.telephony
android.hardware.location
android.software.sip
android.hardware.touchscreen.multitouch
glEsVersion = 2.0
我用下面的代碼:
PackageManager packageManager = mcontex.getApplicationContext().getPackageManager();
FeatureInfo[] feature = packageManager.getSystemAvailableFeatures();
String k = null;
for (FeatureInfo s : feature) {
k = s.name + "\n" + "glEsVersion =" + s.reqGlEsVersion;
}
return k;
它僅顯示glEsversion,而其余部分顯示為null。 有什么建議嗎?
您總是會覆蓋k,但如果我理解正確,則您希望所有功能都在一個String中
for (FeatureInfo s : feature) {
k =k+ s.name + "\n" + "glEsVersion =" + s.reqGlEsVersion;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.