Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a device is running Android-Things

Is it possible to perform a runtime check to see if a device is running Android-Things?

like image 682
Roberto Betancourt Avatar asked May 24 '17 17:05

Roberto Betancourt


People also ask

What happened to Android things?

Android Things is a deprecated Android-based embedded operating system platform by Google, announced at Google I/O 2015, and launched in 2018. Android Things Dashboard shutdown began on January 5, 2021. After January 5, 2022, Android Things Dashboard will be shut down completely and all remaining data will be deleted.


1 Answers

You can query the PackageManager for FEATURE_EMBEDDED, which 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 in the Android O Preview SDK. Until an Android Things preview based on O is released, you may need to use the literal name of the constant: android.hardware.type.embedded

like image 187
devunwired Avatar answered Sep 27 '22 17:09

devunwired