如何在Android中获取显示设备特性?

如何在Android中获取显示设备特性?,android,google-tv,Android,Google Tv,各位 我们的应用程序仅适用于具有特定序列号的特定型号的显示器。在我们应用程序的Linux版本上,我们通过EDID获取此信息 我们现在正在考虑将代码移植到Android(谷歌电视) Android NDK上是否有API可以让我们获得显示设备的特性,如型号和序列号 提前感谢您的帮助 问候, Peter由于谷歌电视设备没有电话硬件,因此无法使用TelephonyManager获取设备id 您可以使用以下代码获取其他设备信息: Log.i(LOG_TAG, "android.os.Build.VERSI

各位

我们的应用程序仅适用于具有特定序列号的特定型号的显示器。在我们应用程序的Linux版本上,我们通过EDID获取此信息

我们现在正在考虑将代码移植到Android(谷歌电视)

Android NDK上是否有API可以让我们获得显示设备的特性,如型号和序列号

提前感谢您的帮助

问候,

Peter

由于谷歌电视设备没有电话硬件,因此无法使用TelephonyManager获取设备id

您可以使用以下代码获取其他设备信息:

Log.i(LOG_TAG, "android.os.Build.VERSION.RELEASE="+android.os.Build.VERSION.RELEASE);
Log.i(LOG_TAG, "android.os.Build.VERSION.INCREMENTAL="+android.os.Build.VERSION.INCREMENTAL);
Log.i(LOG_TAG, "android.os.Build.DEVICE="+android.os.Build.DEVICE);
Log.i(LOG_TAG, "android.os.Build.MODEL="+android.os.Build.MODEL);
Log.i(LOG_TAG, "android.os.Build.PRODUCT="+android.os.Build.PRODUCT);
Log.i(LOG_TAG, "android.os.Build.MANUFACTURER="+android.os.Build.MANUFACTURER);
Log.i(LOG_TAG, "android.os.Build.BRAND="+android.os.Build.BRAND);
对于Vizio Co-Star谷歌电视设备,您将获得以下信息:

android.os.Build.VERSION.RELEASE=3.2
android.os.Build.VERSION.INCREMENTAL=U4.6.0-ota2
android.os.Build.DEVICE=VAP430
android.os.Build.MODEL=VAP430
android.os.Build.PRODUCT=StreamPlayer
android.os.Build.MANUFACTURER=VIZIO
android.os.Build.BRAND=Vizio
    TextView text = (TextView) findViewById(id.featurestextview);

    FeatureInfo features[] = getPackageManager()
            .getSystemAvailableFeatures();
    Log.d("Features", "getSystemAvailableFeatures() = " + features);

    text.append("Supported System Features on this device:\n\n");

    if (features != null) {
        for (FeatureInfo featureInfo : features) {
            if (featureInfo.name!= null) {
                text.append(featureInfo.name+"  (Flags: "+featureInfo.flags+") \n");
            } else {
                text.append(featureInfo+"\n");
            }
        }
    }

    long maxMemory = Runtime.getRuntime().maxMemory();
    int memoryClass = ((ActivityManager) getSystemService(ACTIVITY_SERVICE)).getMemoryClass();
    MemoryInfo memInfo = new MemoryInfo();
    ((ActivityManager) getSystemService(ACTIVITY_SERVICE)).getMemoryInfo(memInfo);


    text.append("\n\nMEMORY:\nMaxMemory "+maxMemory/1024+"KB / "+maxMemory/1024/1024+"MB");
    text.append(" (Memory Class: "+memoryClass+")");
    text.append("\n MemoryInfo: Avail="+ memInfo.availMem / 1024 +"KB   Threshold="+memInfo.threshold /1024 +"KB");

您可以使用以下方法转储所有功能:

android.os.Build.VERSION.RELEASE=3.2
android.os.Build.VERSION.INCREMENTAL=U4.6.0-ota2
android.os.Build.DEVICE=VAP430
android.os.Build.MODEL=VAP430
android.os.Build.PRODUCT=StreamPlayer
android.os.Build.MANUFACTURER=VIZIO
android.os.Build.BRAND=Vizio
    TextView text = (TextView) findViewById(id.featurestextview);

    FeatureInfo features[] = getPackageManager()
            .getSystemAvailableFeatures();
    Log.d("Features", "getSystemAvailableFeatures() = " + features);

    text.append("Supported System Features on this device:\n\n");

    if (features != null) {
        for (FeatureInfo featureInfo : features) {
            if (featureInfo.name!= null) {
                text.append(featureInfo.name+"  (Flags: "+featureInfo.flags+") \n");
            } else {
                text.append(featureInfo+"\n");
            }
        }
    }

    long maxMemory = Runtime.getRuntime().maxMemory();
    int memoryClass = ((ActivityManager) getSystemService(ACTIVITY_SERVICE)).getMemoryClass();
    MemoryInfo memInfo = new MemoryInfo();
    ((ActivityManager) getSystemService(ACTIVITY_SERVICE)).getMemoryInfo(memInfo);


    text.append("\n\nMEMORY:\nMaxMemory "+maxMemory/1024+"KB / "+maxMemory/1024/1024+"MB");
    text.append(" (Memory Class: "+memoryClass+")");
    text.append("\n MemoryInfo: Avail="+ memInfo.availMem / 1024 +"KB   Threshold="+memInfo.threshold /1024 +"KB");

供应商etc的android构建属性将允许您将范围扩展到特定设备。关于序列号(例如cpu序列号-不可用),我们建议您使用mac地址。

感谢您的帮助。这会给我有关附加显示设备(如电视或投影仪)的信息吗?关于皮特,此类信息仅通过HDMI CEC提供,目前电视市场不完全支持。您将无法找到当前通过HDMI连接的设备类型。感谢您的帮助。我需要的是获取与联播相关的显示设备(电视、投影仪等)的信息,而不是联播本身。因为你的答案最接近我想要的,所以我现在就把它标记为解决方案。你好,彼得。