Latest Blogs

Empowered By Innovation!

Redefining The Way Business Interact by Android Things – Emerging Platform for IoT

Android Things is a new operating system that will make easier for developers to build IoT products. It is the Google’s latest and most comprehensive attempt to become a player in the Internet Of Things and to serve as a catalyst in the widespread adoption of IoT in both consumer and enterprise applications. It can run on products like connected speakers, smart thermostats, security cameras, routers, etc. The OS will allow companies to quickly bring new, life-changing products to the market.

It is the successor and a rebranded version of Brillo, an android based OS that Google announced in its I/O conference 2015 and was developed to support lower levels eg: wiFi, Bluetooth Low Energy, and other Peripheral. It used C++ as the primary development environment. Hence to support medium complexity devices and provide security environment there was a need to shift from Brillo’s lighter version of Android for developers to a new android version of OS named “Android Things”.

Android Things utilizes the Android development environment to make it easier for android developers to connect IoT devices. As of now Google has provided Android Things System Images for these three boards: Intel Edison, NXP Pico, and Raspberry Pi 3 and helps to build connected devices while leveraging Android APIs and the company’s cloud-based services for delivering updates and enabling voice commands.

Android things Architecture


Android Things which runs on Linux kernel extends the core Android framework with additional APIs provided by the Things Support Library. These APIs allow apps to integrate with new types of hardware that are not found on mobile devices, including interfaces such as GPIO, PWM, I2C, SPI, and UART, enabling support for sensors and actuators. There is also a User Driver API that allows apps to inject hardware events into the framework that other apps can access using the standard Android APIs.

Below is the architecture of Android Things:

 

android-things-architecture


How to get started with Android Things Development

Google has released developer preview of Android Things. Development for Android Things is similar to Android.

Before you start development for Android Things all you need is development board with Android Things, OS installed on it and peripherals for board.

As of now, google provides system image for 3 types of hardware. You can download respective image, based on your hardware from: https://developer.android.com/things/preview/download.html

Prerequisite

  • Android Studio 2.2 onwards
  • Android SDK version API 24 or higher
  • SDK Build Tool 24 or higher

Implementation

Once new project is created , in build.gradle file add dependencies for android things.

dependencies {
...
provided 'com.google.android.things:androidthings:0.1-devpreview'
}

Also in application’s manifest file add:


<application ...>
 <uses-library android:name="com.google.android.things"/>
 ...
</application>

Android Things is streamlined for single application use. So define an intent filter with Category IOT_LAUNCHER, which will make that activity run on device boot. While development, define this same activity as LAUNCHER so that Android Studio can launch that when deployed.


<application android:label="@string/app_name">
    <uses-library android:name="com.google.android.things"/>
    <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 -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.IOT_LAUNCHER"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
</application>

And that’s it. Next you can connect some sensors, display to board, communicate between them using Android Things’ peripherals API.

Key points to remember while developing Android Things

 

  • Android Things extends the core Android framework with additional APIs provided by the Things Support Library. It does not include standard suite of system apps and content providers.
  • Avoid using common intents and content providers API like CalendarContract, ContactsContract, DocumentsContract, DownloadManager,MediaStore,Settings, Telephony, UserDictonary, VoiceMailContract.
  • Android Things supports graphical user interfaces using the same UI toolkit available for traditional Android applications. In graphical mode, the application window occupies the full real estate of the display. Android Things does not include the system status bar or navigation buttons, giving applications full control over the visual user experience. However, Android Things does not require a display. On devices where a graphical display is not present, activities are still a primary component of Android Things app, this is because the framework delivers all input events to the foreground activity, which has focus.
  • Unavailable APIs: AdMob, Android Pay, Firebase App Indexing, Firebase Authentication, Firebase Dynamic Links, Firebase Invites, Firebase Notifications, Maps, Play Games, Search, Sign-In.
  • Supported APIs: Cast, Drive, Firebase Analytics, Firebase Cloud Messaging, Firebase Crash Reporting, Firebase Realtime Database, Firebase Remote Config, Firebase Storage, Fit, Instance ID, Location, Nearby, Places, Mobile Vision.

Conclusion

With the introduction of Android Things, Google is not only exploring IoT domain from one more dimension, at the same time, It is trying to capitalize on the fact that it has got one of the largest community in terms of Android developers and potentially a lucrative new product space. This would mean a unified platform and a better experience for consumer.

Interestingly, Azilen at the same time is working to develop POC with Android Things and identify how will the IoT system actually work.

Subscribe To Latest Updates By Email

Leave a reply