Android Things is based on the Android platform and is optimized for embedded devices. Along with new features and capabilities, Android Things includes a variety of system and API differences from Android. This document highlights some of the key differences that you should understand and account for in your apps.
Installed apps
The collection of installed apps is fixed by the developer/device maker. These are changed through OTA updates, not managed by the end-user.
Android Things is streamlined for single app use. One app is automatically launched at system startup.
Unsupported APIs
Android Things is optimized for embedded devices which may not contain the same feature set as an Android phone or tablet. For example, graphical user interfaces are optional as not all devices include a display.
The following table outlines the set of Android features not currently supported by Android Things devices, and the affected framework APIs:
Feature | API |
---|---|
System UI (status bar, navigation buttons, quick settings) |
NotificationManager KeyguardManager WallpaperManager |
VoiceInteractionService |
SpeechRecognizer |
android.hardware.fingerprint |
FingerprintManager |
android.hardware.nfc |
NfcManager |
android.hardware.telephony |
SmsManager TelephonyManager |
android.hardware.usb.accessory |
UsbAccessory |
android.hardware.wifi.aware |
WifiAwareManager |
android.software.app_widgets |
AppWidgetManager |
android.software.autofill |
AutofillManager |
android.software.backup |
BackupManager |
android.software.companion_device_setup |
CompanionDeviceManager |
android.software.picture_in_picture |
Activity Picture-in-picture |
android.software.print |
PrintManager |
android.software.sip |
SipManager |
Common intents
Android Things doesn't include the standard suite of system apps and content providers. Avoid using common intents as well as the following content provider APIs in your apps:
CalendarContract
ContactsContract
DocumentsContract
DownloadManager
MediaStore
Settings
Telephony
UserDictionary
VoicemailContract
Runtime permissions
Declare permissions that you need in your app's manifest file.
The granting of app permissions is done differently for Android Things than for typical Android apps since many IoT applications do not require a user interface or input device. Permissions are granted using Android Studio or the Android Things Console.
When running an app from Android Studio, all permissions (including dangerous permissions)
are granted at install time. This applies to new app installs and updated
<uses-permission>
elements in existing apps. You can use the adb
tool to
grant or revoke permissions for testing.
When you are ready to distribute your apps using the Android Things Console, you grant the dangerous permissions (instead of the end user) for all apps as part of the build creation process. You can override this during development, but not on actual products; end users cannot modify these permissions.
Native code
Android Things is compatible with the Android NDK for including C/C++ code into your app. However, since Android Things devices are typically memory constrained, the platform requires apps to keep native libraries inside the APK at runtime using the extractNativeLibs manifest attribute.
<manifest ...>
<application
android:extractNativeLibs="false" ...>
...
</application>
</manifest>
Review the guide on integrating native code for more details.