Going Universal

Continuing on the Universal Windows Platform track, last fall I started working with Xamarin Forms in Microsoft’s Visual Studio. I had done several apps using .NET and Microsoft Forms but Xamarin offered a way to create one app using the UWP (Universal Windows Platform) to create an app for Android, Windows and iOS.

I’ve had a number of requests for iOS apps over the years but I shied away from doing them because 1) I didn’t own a Mac and 2) nor did I want to invest time in learning Objective C which has little use outside of Apple products. UWP offered a way to do this.

I wasn’t all that foreign to Xamarin cross development having done apps using Mono on Linux and compiling them for Windows using Xamarin. With Visual Studio Community being available first when I did an app for Unity 3D and then available for other development I jumped in.

Initially it was for a much requested version for 7” tablets of my popular Indian astrology app. I had a landscape layout for 10” tablets but people wanted that on a their 7”. The problem is that the layout that worked for 10” tablets would be difficult to navigate sized down to 7”.

Hence I used Xamarin to create a new tablet layout. This grew into a new version for phones as well as tablets. These are going to be two separate “pro” versions with the extra features that people have requested that would be difficult to add to existing versions.

Another thing about “forms” is they are much easier to work with than the Android development environment. As other developers have noted it’s often difficult when spending some time away from Android development to remember how it all works. Not so if time is spent away from Xamarin. It’s all very straight forward with a lot of options.

There are, of course, some things missing that I need. One was popup dialogs that could used more than just text. Turns out there was an XLabs popup module that could handle that. And on the other hand was something available missing on Android: Formatted Text. On Android many of my text was all just drawn as a graphic and a bit of a pain to program. Formatted Text is much more like using HTML where I could change color and text attributes programmatically.

Also I have the ability to just change the Xaml layouts to get a portrait phone and tablet landscape version from the same code. However my experience with Android users is these are best offered as separate apps. There have been tablet users who wanted the portrait phone layout on their 10” tablet. Now this will be possible.

Next up will be an article on my experience of using Visual Studio 2017 to port an SDL2 C++ developed game to Android. I hope to offer some example source too for some of the underdocumented or tricky things to do with these environments.