So the obvious first step was to get Android Things up and running. I had to load Android Studio which also adds the Android SDK and optionally the NDK (for use with native C/C++ development).
I already had the Android SDK installed with my Visual Studio 2017 setup as part of the Xamarin/Android support plug in. Microsoft seems to want to install the Android SDK under “C:\Program Files (x86)\Android\android-sdk” which I found out the hard way has issues under some scenarios. It seems a lot of the utilities and batch files still do not like the spaces in the path. So I let Android Studio install another copy of the SDK under C:\Android\sdk. The NDK installs under C:\Android\ndk. The SDK and NDK combined are quite large, several tens of gigabytes as a matter of fact, and having two copies chews up lots of disk space. I did find out later it is possible to “retarget” where Visual Studio looks for Android SDK so I can probably remove the MS installed version.
Having installed all the tools it was now time flash the factory image and try some sample programs. I am targeting my Raspberry Pi 3 hardware which I previously had Windows IoT core running on.
The Android Things samples include functions that exercise the standard inputs and outputs. Things like blinking an LED for GPIO output and reading a push button for GPIO input.
Of course these samples are written in Java as it is the most popular development language among Android developers. But as you move into the embedded space you see more developers prefer C/C++ as its much more hardware friendly. I, myself, prefer C# as it provides the best of both worlds. It is object oriented and the syntax is very much “C” like.
.NET Embedding allows your existing .NET Code (C#, F#, and others) to be consumed from other programming languages and in various different environments.
This means that if you have a .NET library that you want to use from your existing iOS app, you can do that. Or if you want to link it with a native C++ library, you can also do that. Or consume .NET code from Java.
I will attempt to do the latter using Java running on an Android Things device. Stay tuned for part 3.