Android Things 1.0 Features and APIs


Android Things 1.0 introduces a variety of new features and capabilities for users and developers. This document highlights what’s new for developers.

Make sure to also check out Android Things 1.0 Behavior Changes to learn about areas where platform changes may affect your apps.

System

Home Activity Support

Android Things expects one application to expose a “home activity” in its manifest as the main entry point for the system to automatically launch on boot. This activity must contain an intent filter that includes both CATEGORY_DEFAULT and CATEGORY_HOME.

For ease of development, this same activity should include a CATEGORY_LAUNCHER intent filter so Android Studio can launch it as the default activity when deploying or debugging.

<application
    android:label="@string/app_name">
    <activity android:name=".HomeActivity">
        <!-- Launch activity as default from Android Studio -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <!-- Launch activity automatically on boot, and re-launch if the app terminates. -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.HOME"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
</application>

Device Updates

Android Things 1.0 allows apps to control and monitor the process of applying over-the-air (OTA) software updates from the Android Things Console. Use UpdateManager to set the update policy and configure the reboot behavior of the device following an OTA update. You can manually trigger device reboot or factory reset with DeviceManager.

During development and testing, you can subscribe your test devices to different channels, such as canary or beta, and deliver separate OTA build to those devices through the Android Things Console. Use setChannel() to change the channel for a given device.

For more details, see the device updates guide.

Connectivity

Bluetooth

Android Things 1.0 enchances the core Android Bluetooth APIs with additional features for device state management. Configure active Bluetooth profiles with BluetoothProfileManager and set the device attributes and capabilities with BluetoothConfigManager. Use the BluetoothConnectionManager to initiate pairing with a remote device, handle incoming pairing requests, and control the connection process.

See the Bluetooth API guide for more details.

LoWPAN

Connect your devices to IP-based Low-Power Wireless Personal Area Networks (LoWPAN) in Android Things 1.0, including Thread networks. Use the LowpanManager to discover the supported radio interfaces on the device and listen for changes in state. Create new networks and join existing networks through the LowpanInterface, or create a LowpanScanner to discover other networks nearby.

See the LoWPAN guide for more on setting up these networks and getting started with OpenThread supported hardware.

Peripherals

Peripheral I/O

The Peripheral I/O APIs allow your apps to communicate with sensors and actuators using industry standard protocols and interfaces. The following interfaces are supported: GPIO, PWM, I2C, SPI, UART. Open a connection to any of these interfaces with the or list the available ports using thePeripheralManager.

Apps can also access native Peripheral I/O from C/C++ code for developers using the Android NDK.

User-space Drivers

Android Things 1.0 enables apps to extend existing Android framework services and inject hardware events with user-space drivers. In this release, drivers are supported for the following categories: location, input, sensors, LoWPAN. Implement driver code using Peripheral I/O to communicate with your custom hardware, then bind that driver to the framework through the UserDriverManager.

Settings

Date/Time

Adjust the date/time settings of the device in Android Things 1.0 with the TimeManager. This includes control of the clock time and time zone, as well date/time formats and automatic time syncing with the network.

Anúncios

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )

w

Conectando a %s