Develop Uno Platform projects on Linux with Visual Studio
by Rhys Davies on 13 August 2020
Uno Platform is bringing their support to Linux. Uno allows you to build native mobile, desktop, and WebAssembly apps with C# and XAML from a single code base. You can build Linux applications with Uno using Visual Studio and Ubuntu on WSL. In collaboration with Uno, we built a mock-up snap that measures and adjusts the speed of an IoT device to demonstrate what you can do. You can see Uno’s commentary over in their announcement. Or in the video at the end of this article.
Develop with Uno on Ubuntu
Maintaining separate code bases for each platform requires a lot of time and work. Building for each platform (Windows, Android, macOS or Ubuntu) and then committing to support and maintain your application makes true cross-platform development daunting. Issues such as feature disparity, incompatibilities, and duplication of work can become common practice.
Uno presents a solution. You can build your C# and XAML codebase with Uno to make it more portable. Using WebAssembly, Uno dynamically adjusts your application to look and feel the way it should regardless of the operating system. All you need is to maintain that one codebase
Support for building Linux applications on Visual Studio is powered by Ubuntu on WSL and the open source Mono AOT-wasm project. Uno also supports WASM development in Code. On Linux, Uno platform projects use the Skia rendering engine to draw graphical elements. Uno applications then integrate into the Ubuntu desktop with a GTK shell. And it’s all open source, built on the Mono Project.
Deploy Uno with snaps
Once you have your application, support and maintenance become a challenge. And, if like our demo application, your application is for IoT devices, support and maintenance are key factors for security. Users of your apps or your devices should be able to trust the developers to keep applications up-to-date and patched.
Enter, snaps. On Ubuntu, or any major Linux distro, you can use snaps to keep your Uno Platform projects patched and up to date automatically and remotely. You can model a release strategy to fit your project or device needs using snap channels. A brave user could follow your bleeding-edge channel, while others live on a stable channel, or subscribe to a special channel in-between.
Build Uno IoT appliances
Once you have your application running on all OSs and it’s easy to support, what’s next? With your Uno Platform project published as a snap, you can deploy to workstations or servers without issue. And, you can go one step further and create an Ubuntu Core-based appliance.
Uno and snaps both run on x86 and ARM so developers can target and test IoT applications on Raspberry Pi. The Uno Platform IoT demo is one example, it works on armhf and amd64. As a strictly confined snap, it can easily be made into a production-ready device using Ubuntu Core; a minimal, containerised version of Ubuntu that is entirely made of snaps for security and the same updatability you have in your application.
Developing Uno projects with snaps also gives you access to other tools and features that exist in other Ubuntu Appliances. For example, our demo snap uses Mir for well-defined window management and display for your Uno Platform application.
What’s next?
If you’re not already familiar with Uno Platform, we recommend you read their announcement too. Browse their site and check out our demo snap. Bear in mind it is a simple demo to show what’s possible, we’d love to see other Uno projects utilise the benefits of snaps in the future.
If you’re interested in what else you can do with Ubuntu Core and snaps, or want to build an Uno project for the Raspberry Pi, there are a few places you can go. You can read up on building snaps, learn how to build your own Ubuntu Core image, to distribute your software, or get involved with Ubuntu Appliances. Talk to us about your application and we can help you snap it up, publish it, and find new users.