Skip to content

The OCF compliant Jukebox demo running on Android Things

Notifications You must be signed in to change notification settings

ttzeng/oc-jukebox-b2

Repository files navigation

OCF Compliant Android Things Jukebox Demo

This repository contains the source code of the Android Things based Jukebox demo that consists of a MP3 player and its Android companion app. The MP3 player is designed for running on Intel Edison Kit for Arduino with Grove LCD RGB backlight module to display the played MP3 titles, it also integrates the IoTivity base library for Android for being discovered and controlled by the companion app via OCF standards. The demo represents the jukebox device as three standard OC resources of type Brightness, Colour RGB, and Audio Controls, and a vendor proprietary media player resource for controlling MP3 playback.

Prebuilt Images

  • MP3 Player
    To setup the MP3 player demo on Intel Edison Kit for Arduino, follows these instructions to flash the Android Things Developer Preview image to the device before installing the MP3 player APK from the Android Studio.

  • Android companion app
    The companion app requires Android devices support API 21 or above.

Build Instructions

  1. Clone the repository as a local project.
$ git clone https://github.com/ttzeng/oc-jukebox-b2.git
  1. Download and install the prebuilt IoTivity base library for Android into the local maven repository with the following command.
$ mvn install:install-file -Dfile=iotivity-base-release-1.3.0.aar -DgroupId=org.iotivity -DartifactId=base -Dversion=1.3.0 -Dpackaging=aar
  1. The project contains two modules, select the module demo or companion in the Project panel, and then click Build > Make Selected Modules to build the module using Gradle.
  2. For setting up the MP3 player demo on the device, insert a standard Android SD card with pre-installed MP3 titles, or copy some MP3 files to the /sdcard/Music/ folder on the device manually with the following command.
$ adb push file.mp3 /sdcard/Music
  1. Click Run to generates a debug APK and deploys to the target device.
  2. Enter the following command to setup the wifi on the Android Things device.
$ adb shell am startservice \
        -n com.google.wifisetup/.WifiSetupService \
        -a WifiSetupService.Connect \
        -e ssid <ssid> \
        -e passphrase <passphrase>
To disconnect and clear wifi configs:
$ adb shell am startservice \
        -n com.google.wifisetup/.WifiSetupService \
        -a WifiSetupService.Reset

Screenshots

  • Complete set

Android Things Jukebox demo

- Three Card widgets represent the found resources in the companion app

Screenshot of the Jukebox companion app

About

The OCF compliant Jukebox demo running on Android Things

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages