Android Brillo Internals
Dissecting Google Brillo and Weave
Written by : Nanik Tolaram
Introduction
Before going through this documentation it is crucial to understand the difference between Brillo (https://developers.google.com/brillo/?hl=en) and Weave (https://developers.google.com/weave/?hl=en). Have a read first to understand it before continuing with this article as it can get confusing sometimes.
This document is by no means a tutorial rather this is just a research document. As of Jan 4, 2016 there isn't that much information from Google regarding Brillo. The findings that are documented are based on available source code (and decompiling of library) to understand how the whole stack works together.
Sample App
Google has released sample Weave application which can be downloaded from https://github.com/googlesamples/android-WeaveLedToggler. Weave is the stack that takes care of the way Brillo device communicates with other devices either via – WiFi (cloud), mDNS or Bluetooth. The sample application shows how to tun ON/OFF led on a Brillo device which currently is a development board (either from Marvell, Intel or other Brillo partners).
On looking inside the sample there is a jar file inside third_party library which contains classes used inside the sample to communicate with Brillo devices.
Following shows how the sample app should look like when run. The screenshot below was taken from screenshot directory of the source code (due to error encountered explained below)
|
|
The library that is included for the sample app takes care of few things such as device discovery, authentication and communication. There is a dependency on an .apk that need to be downloaded from the Google Play Store, which as of today (4/January/2016) is not available. Tested on a device with Google Play Store the app run with error shown below
01-04 00:12:20.062 4694 4694 W MainActivity: Could not create RequestAccessIntent, trying resolution intent: WeaveError (code: 1004, reason: null, message: null) 01-04 00:12:20.127 483 1200 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=market://details?id=com.google.android.weave cmp=com.android.vending/com.google.android.finsky.activities.LaunchUrlHandlerActivity} from uid 10097 on display 0 01-04 00:12:22.443 483 802 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=http://market.android.com/details?id=com.google.android.weave cmp=com.android.vending/com.google.android.finsky.activities.MainActivity (has extras)} from uid 10016 on display 0 01-04 00:12:28.108 2978 2978 D Finsky : [1] ExternalReferrer$1.run: Capture referrer for com.google.android.weave (empty) 01-04 00:12:28.524 2978 3014 E Volley : [287] BasicNetwork.performRequest: Unexpected response code 404 for https://android.clients.google.com/fdfe/details?doc=com.google.android.weave
This means that either Google has removed the apk from the Play Store or it has not been uploaded
Brillo Hardware
The sample app requires Brillo enabled devices which at the moment are only available using development board. Here are list of the development boads that are supported by Brillo.