I received this today, the Xamarin MVP Award!!! This is truly something special that I can now cross off from my bucket list. Thank you, so much Xamarin and the awesome Xamarin Community! So honored to be receiving this!

Thank you to all that made this possible. It is really really amazing to know that all the years of work that went into assisting and contributing to the Xamarin and Microsoft community, globally and in South Africa has been appreciated!

Thank you once again! And here’s to more community fun and enjoyment!!

Android Studio 2.3 released on 1 March. I recently created a guide to install Xamarin side by side with Android Studio 2.2.3 here.

The steps illustrated remain the same. The only difference is, the Android Studio 2.3 zip file (without sdk and installer) can be located here. If 2.23 was previously installed, migrate the 2.2.3 settings on first run of Android Studio 2.3. This will copy across the shared SDK location with the Xamarin installation.

I returned home from the Cape Town Xamarin User’s group last night to find that I have just become a Microsoft MVP for the first time!!!

I am so honored to be receiving this award!! Thank you to all that made this possible. It is really really amazing to know that all the years of work that went into assisting and contributing to the Xamarin and Microsoft community, globally and in South Africa has been appreciated!

Thank you once again! And here’s to more community fun and enjoyment!!

Tonight was a very fun evening at CTXUG (Cape Town Xamarin User’s Group). The two topics presented were Telerik UI for Xamarin and Lottie. The User Group was held at the MLab office at the waterfront which is a great place to have events!

“Telerik® UI for Xamarin by Progress is a collection of UI controls and functionalities that complement the default controls found in the platform. The controls offer many non-trivial scenarios out of the box, helping developers to implement polished UI with native-quality performance in their apps faster, shortening time to market. Telerik UI for Xamarin includes Xamarin.iOS wrappers, Xamarin.Android wrappers and Xamarin.Forms controls.”

I did the first talk this time on Telerik UI for Xamarin. It was great showing off what the component set could do, and everyone seemed inspired and impressed with what Telerik UI for Xamarin offers.

I do hope the free Telerik license recipients will be presenting the cool stuff they build soon at CTXUG!!! 🙂

Android Things has GPIO callbacks which are triggered on certain trigger events. This is great for event handling. I’ve added a sample to Xamarin bindings which illustrates this by means of a Grove PIR (Passive InfraRed) sensor much like what’s in your home alarm system. If we use that in conjunction with a buzzer, you have a primitive alarm system.

Gpio callbacks are classes implemented inheriting from the abstract class Gpio Callback. This call back is triggered on certain trigger types. This are set on the gpio pin with the settriggertype method.

Android Things is Google’s new IOT Android based platform. In essence it’s a slightly altered version of Android which can run on Iot type devices such as the Intel Edison and the Raspberry Pi3.

“Android Things lets you build professional, mass-market products on a trusted platform, without previous knowledge of embedded system design.”

Personally I’m not yet too impressed with Android Things. It is still very new and very raw and is lacking a lot of what you’d expect from an Iot platform. However, having finally a standard Android implementation officially from Google running on these devices has to be a good thing. The platform should just get better from here.

Running in Visual Studio using Xamarin

Of course being Android, Android Things works with Xamarin too. Using Xamarin will also be a benefit for all those awesome cross platform benefits it offers, like sharing your Iot code with your backend services, Android, Ios, Windows Phone, Windows 10, OSX, XBox and whatever other devices you’d like to be supporting in your solution.

Getting the devices to appear in Visual Studio is exactly as you’d expect. The devices will use the standard Android Debugging Bridge (ADB). Plugging in an Intel Edison via USB will be reflected as “Unknown Iot_Edison”. You can obviously also use the network debugging features of ADB. eg. adb connect <ip address> The device will then also be detected in Visual Studio. A Raspberry Pi will appear as “Unknown iot_rpi3”.

Using Xamarin is very simple. All we need to do is bind to the Android Things API Jar to be able to make use of all the features provided by the Android Things SDK. At this moment in time there isn’t an official release Nuget package from Xamarin to do this. It is however very simple to do this yourself. In this sample (and I’ve shared the code on GitHub) I’m binding to the new Dev Preview 2 API for Android Things (androidthings-0.2-devpreview.jar). Once the binding project is referenced from your Android Things project, everything will work as expected. Just of course with the benefit of using C# and not Java!

I’ve created some samples based on the Standard Android Things Samples

You may need to run Android Studio and Xamarin side by side from time to time. This may be needed if you are an Android developer experimenting with Xamarin or maybe you are migrating an Android application to Xamarin. I run the two side by side often especially when I am binding native libraries for Xamarin. I put together a guide to make the new Xamarin Cycle 9 release and Android Studio 2.2.3 run together without any pain and also without wasting disk space with multiple copies of Android Sdks. I also find it’s much cleaner to install everything manually without the installers. This guide is specifically aimed for Windows and Visual Studio 2015+ users.

This is just a zip file not requiring any installation. Extract the contents to a location that’s easily accessible. Eg. C:\AndroidSDK\tools_r25.2.3-windows

Install the required SDK Tools and APIs

From command line execute <Android SDK>\tools\android This will open the SDK manager.

Install Android SDK tools 25.2.5

Install Android SDK platform tools 25.0.3

Install Android Build tools 25.0.2

Install API 25 SDK Platform (and whichever other APIs you require)

Install “Sources for Android SDK” for API 25. Xamarin does not require this, but Android Studio will later request it be installed. This will simplify the later setup if done now.

Install Google Repository

Install Google Play Services

Install Android Support Repository

Install Xamarin for Visual Studio 4.3. If you installed Xamarin with Visual Studio 2015, you have it already. To upgrade to Cycle 9 use the Updater Channel within Visual Studio. Alternatively if you don’t have it, you can manually install it: https://store.xamarin.com/account/my/subscription/downloads. Download the individual installation package per platform (and not the universal installer). At the time of writing this there isn’t a direct link to cycle 9, so download cycle 8 and update it.

Set up the SDK paths within Visual Studio. There is a setting for both the path to the NDK and SDK previously installed. The location of the Java SDK should be set here too. Visual Studio will need to be restarted for this to take effect.

Note: If Xamarin was previously installed via the Visual Studio or the Xamarin Universal Installer. There will be another Android SDK installed. This is most likely: C:\Users\<user>\AppData\Local\Xamarin\Universal\AndroidSDK. If the steps above were followed, this previous path can be safely removed. This folder can be used to share the SDK with Android Studio, however personally I don’t think it’s a great location for doing that.

The Xamarin Cycle 9 installation is complete and should now work with the new SDK location.

Visual Studio has become a one stop shop for any type of development. But did you know you can do Arduino development as well? There is a Visual Studio extension called Visual Micro (http://www.visualmicro.com) which will allow Arduino development and debugging within Visual Studio IDE, with the full development experience you have become used to. This is a high level overview of what is provided.

Arduino and Visual Studio

What’s really great about having Arduino support within Visual Studio is, you can group together all the various different projects that makes up your solution all together within a Visual Studio Solution.

Multi-platform Solution

In a world of Iot and cross platform (or multi platform) development this is perfect. You could have one or more Arduino projects, .NET Micro framework projects, a Xamarin Mobile client and the back-end (be it an on-premise ASP .NET WEB API solution, or in the cloud with something like Azure Mobile Services) all managed together in a single Visual Studio solution.

Installing Visual Micro

Visual Micro can be downloaded here: http://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx It is a Visual Studio extension which will be installed within Visual Studio. There is a version for both Visual Studio 2015 and 2017 RC. Be sure to have the standard Arduino IDE installed as well, as it uses this tooling under the hood. Arduino version 1.06 – 1.8 is supported.

The IDE Experience

Visual Micro Toolbar

Visual Micro Menu

Both a toolbar and a new menu is added to Visual Studio. The toolbar allows access to quickly configure the connected board and COM port used (via USB). It also allows quick access for building and debugging, however if the Arduino project is the startup project the debugging and build options work as usual direct from the Visual Studio hotkeys, toolbars and menu items. The menu allows for deeper configuration of the compiler, debugging options and other integration options.

File New Dialog

Templates are provided to easily create a new Arduino Sketch or Library. Standard Arduino INO files are supported. These standard file types are also used when opening and saving to existing Arduino Sketch files, which ofcourse can be ported back to the Arduino IDE if need be.

Solution Explorer

The solution explorer is quite neat for the Arduino. All the source files, header files and external dependencies are presented in much the way you have grown accustomed to in Visual Studio.

The Visual Micro Explorer provides a visualization of all libraries installed. There is also reference material and documentation provided along with a collection of Example code. This is great for both learning and quickly looking up something.

The live tracing works great. There is also the standard port monitor which does live logging of the Com ports. In the screenshot provided the codes displayed are being reported from an infrared remote control in real-time. The ability to see everything happen, and be visible, at once in an IDE saves a whole load of time.

Conclusion

I’ve been using Visual Micro for a few Arduino related Iot projects and can definitely recommend using it.

.NET core is really easy to get up and running. Download the installer relevant to your environment from https://www.microsoft.com/net/download/core An IDE such as Visual Studio is optional. I’m going to start with the command line version as it’s really quick to get running. It also doesn’t need much resources for a development environment, which is great as I’m currently using a Samsung Tablet with 2 Gig of RAM to write this blog post.

There is a “Current” and a “LTS” version. Choose which version suites your support needs. “LTS” versions are supported for 3 years. “Current” is the latest version, and is supported for 3 months. I’m going to use “Current” here as it contains all the new juicy bits.

.NET Core Installer

The installer will take a minute or two to run. Once installed, the executable “dotnet” will be added to the path. Also different version of .NET will be installed side by side.

To create a new app, there’s a “new” command. On first execution it will extract and expand, which may take a moment.

Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
Configuring...
-------------------
A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
Decompressing 100% 2294 ms
Expanding 100% 4502 ms

By default, the “dotnet new” command will create a console app. Issuing a “dotnet restore” command, all required packages will be fetched.

There are various project types: console, web, lib and xunittest. The type can be specified with the -t parameter. The language can be specified with the -l parameter. The available languages are C# and F#