Check if the Android-Things device is working

Is it possible to run a runtime check to see if the Android-Things device is working?

+4
source share
2 answers

You can request PackageManagerfor FEATURE_EMBEDDEDwhich is implemented by all Android Things devices:

public boolean isThingsDevice(Context context) {
    final PackageManager pm = context.getPackageManager();
    return pm.hasSystemFeature(PackageManager.FEATURE_EMBEDDED);
}

This constant was recently added to the Android O Preview SDK. Until an O-based Android Things preview comes out, you may need to use the literal name of the constant:android.hardware.type.embedded

+6
source

Any apk you make using AndroidThings will be uploaded to the IoT console not in the play store.

, , Gradle Flavors . , APK - , " " .

, APK . (, Google Play, Android Things, , Android). Android Things API Google Android. API Android Things.

+1

Source: https://habr.com/ru/post/1677871/