質問

Folks,

Our application is intended to run only for a specific model of display monitor having a specific serial number. On Linux version of our app, we obtain this information via EDID.

We are now looking at porting the code over to Android (Google TV).

Is there any API on Android NDK that would let us obtain display device characteristics such as its model and serial number?

Thank you in advance for your help.

Regards,
Peter

役に立ちましたか?

解決

Since Google TV devices don't have telephony hardware, you cannot use the TelephonyManager to get the device id.

You can get other device information using the following code:

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

For the Vizio Co-Star Google TV device you will get the following:

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

他のヒント

You can dump all the features using the following:

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

The android build properties for vendor etc will allow you to scope to a specific device. With respect to a serial number (eg. a cpu serial - is not available) we recommend you use the mac address.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top