Develop using the Android SDK and Android Studio

Android Things lets you experiment with building devices on a trusted platform, without previous knowledge of embedded system design:
Access hardware such as displays and cameras natively through the Android framework
Connect your apps with Google services
Integrate additional peripherals through the Peripheral I/O APIs (GPIO, I2C, SPI, UART, PWM)
Use the Android Things Console to push over-the-air feature and security updates
Hardware
Android Things enables you to build apps on top of popular hardware platforms like the Raspberry Pi 3. The Board Support Package (BSP) is managed by Google, so no kernel or firmware development is required. Software images are built and delivered to devices through the Android Things Console. This gives you a trusted platform to develop on with standard updates and fixes from Google.
Get started quickly with one of our developer kits.
SDK
Android Things extends the core Android framework with additional APIs provided by the Things Support Library, which lets you integrate with new types of hardware not found on mobile devices.
Developing apps for embedded devices is different from mobile in a few important ways such as:

  • More flexible access to hardware peripherals and drivers than mobile devices
  • System apps are not present to optimize startup and storage requirements
  • Apps are launched automatically on startup to immerse your users in the app experience.
  • Devices expose only one app to users, instead of multiple like with mobile devices.

See the Features and API page for more information on this library.
See the Platform differences page for more information on the similarities and differences between Android Things and the Android framework.
Console
When you’re ready to begin publishing your code to devices, the Android Things Consoleprovides tools to install and update the system image on supported hardware devices.This allows you to push seamless updates to users in the field as well as test deployments on your own hardware. Using the console, you can:

  • Download and install the latest Android Things system image
  • Build software images that bundle your applications with the operating system
  • Push images over-the-air (OTA) to devices as updates

See the Android Things Console documentation for more information on all of its features.

Platform differences

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

Note: Use hasSystemFeature() to determine whether a given device feature is supported.

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>
 

Categories