LoginSignup
7
5

More than 5 years have passed since last update.

Android Thingsを触ってみる

Posted at

Android Thingsが気になっているので、Getting Started with the SDK Previewを参考に触ってみます。

はじめに

私は、Androidアプリ作成経験なし、Javaを使ったプログラミングもほぼ経験なし。という状況です。

今回使用する環境は下記の通りです。

  • MacBookAir
    • MacOS10.11
    • Android Studio 2.2.3
  • RaspberryPi3

Android Studioのinstall & アプリ作成

Androidアプリを作成したことないので、Android Studioのinstallから始めます。
Android StudioでAndroidアプリを作成

Raspberry Pi3に、Android Things imageをinstall & 起動

基本的に下記の手順通りにすすめます。
https://developer.android.com/things/hardware/raspberrypi.html

ポイントは下記。

  • 該当のzip fileをMacで解凍する場合、unzipではうまく解凍できないので、私は、p7zipを使用しました。(上記手順でThe Unarchiverが紹介されていることを後で気づきました)
 brew install p7zip
 7z e androidthings_rpi3_devpreview_1.zip
  • Raspberry Pi3に、imageを入れたmicroSDカードを挿入し、イーサネットのケーブルを接続して、電源をいれると下記の画面になります。
    • 画面はこれ以上は変化ありません。
    • 最初は、イーサネットでDHCPでIPが割り当てられます。(最初は、wifi側はIPは割り当てられていません。下記画像はadbコマンドでwifi設定後のものです)

IMG_6343.JPG

サンプルアプリを実行

  • 下記を参考に実際に、AndroidThingsアプリを作成しました。AndroidThingsのイメージがやっとできました。
    Android Things 用の空のプロジェクトの作り方

  • AndroidStudioのlog(logcat)に、無事、Available GPIOの情報が出力されました。

androidstudio.png

  • 参考までに、上記AndroidThingsアプリをRaspberryPi3にinstall後の画面は下記の通りです。
    • アプリのUIとしては文字列を表示しているだけで、他には何もしていないので、特に面白くないです。

IMG_6345.JPG

参考

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5