Android Things is a new project of Google that extends the Android OS to SoC (System on a Chip) boards such as Raspberry Pi and Intel Edison.
https://developer.android.com/things/index.html
To get started you need to install the Android Thing image on the SoC computer.
Instructions for Raspberry Pi 3 are available here: https://developer.android.com/things/hardware/raspberrypi.html
Tip: Use 7zip to unzip the zipped image file. Windows Explorer might fail to extract it due to its size.
The next step is to connect ADB to the remote computer. ADB is the tool used to connect to a device in USB debug mode.
You can find it under <android sdk>\platform-tools.
You can use this command to connect:
Check that it is actually connected with
Once connected you can develop with it like you develop with a regular Android phone.
The platform is a bit slow and it will hard crash if you try to access a feature that is not supported. Check the unfiltered logs for more information.
You can add this code to the manifest editor to make your program the default program that starts after boot:
Tips:
- You can uninstall a program with:
- If there are multiple connected devices then you need to add "-s Android.local:5555" to the adb commands.
- You can also use B4J to target these platforms. The advantage of B4A is that it supports UI applications (the ARM Java package doesn't include the UI package).
The advantage of B4J is that you can use jServer library to implement servers. There are other advantages for using Linux instead of Android for server applications.
- Set the #SupportedOrientations attribute to landscape if the screen orientation is wrong.
- Things library (provides access to the hardware pins): https://www.b4x.com/android/forum/threads/android-things.74823/
- From my experience the Wifi settings mentioned in Google tutorial should be avoided. It caused problems with the reported ip address.
.
Source code: https://www.b4x.com/android/forum/threads/72149/#content
Change this line:
https://developer.android.com/things/index.html
To get started you need to install the Android Thing image on the SoC computer.
Instructions for Raspberry Pi 3 are available here: https://developer.android.com/things/hardware/raspberrypi.html
Tip: Use 7zip to unzip the zipped image file. Windows Explorer might fail to extract it due to its size.
The next step is to connect ADB to the remote computer. ADB is the tool used to connect to a device in USB debug mode.
You can find it under <android sdk>\platform-tools.
You can use this command to connect:
B4X:
adb connect Android.local
Check that it is actually connected with
B4X:
adb devices
The platform is a bit slow and it will hard crash if you try to access a feature that is not supported. Check the unfiltered logs for more information.
You can add this code to the manifest editor to make your program the default program that starts after boot:
B4X:
AddActivityText(Main,
<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>
)
Tips:
- You can uninstall a program with:
B4X:
adb uninstall <package name>
- You can also use B4J to target these platforms. The advantage of B4A is that it supports UI applications (the ARM Java package doesn't include the UI package).
The advantage of B4J is that you can use jServer library to implement servers. There are other advantages for using Linux instead of Android for server applications.
- Set the #SupportedOrientations attribute to landscape if the screen orientation is wrong.
- Things library (provides access to the hardware pins): https://www.b4x.com/android/forum/threads/android-things.74823/
- From my experience the Wifi settings mentioned in Google tutorial should be avoided. It caused problems with the reported ip address.
.
Source code: https://www.b4x.com/android/forum/threads/72149/#content
Change this line:
B4X:
lblMyIp.Text = "My ip: " & Starter.server.GetMyWifiIP
'To
lblMyIp.Text = "My ip: " & Starter.server.GetMyIP
Last edited: