Android

Uno Platform 4.1 – 30% Perf Boost, Android 12, .NET 6 Mobile Preview 13 and more

It has been just over 3 months since our 4.0 release, and we’ve used that time to focus on performance as well as bringing the latest .NET 6 innovation to Uno Platform. By simply updating your application to the newest bits you will notice a significant boost to your app performance. This release packs over 200 new feature requests, bugs, and issues you raised. We welcomed a few great contributions from our community, which is now over 210 contributors strong! Thanks for all you bring to Uno Platform. Let’s unpack the 4.1 release. Performance updates For this release, we’ve made numerous changes to a wide range of parts from the Uno Platform, such as Style resolution, layout and measure pass performance, memory consumption and allocations which result in up to 30% performance improvements in some scenarios. Measure Dirty Path The measure pass (MeasureOverride and InvalidateMeasure) is an important contributor to the computations performed to layout the UI, and any optimization performed in this area can significantly improve the time to show the first UI or improve binding update. We’ve changed the way MeasureOverride is invoked when InvalidateMeasure is called, where previously all ancestors of a control would be re-executing MeasureOverride,

Uno Platform 3.11: Support for .NET 6 RTM, VS 2022 17.1 Preview 1

It was a busy week with 3 full days of .NET Conf – the exciting launch of .NET 6 and Visual Studio 2022. The scalability, reliability, and performance of Visual Studio 2022 have all been significantly improved. On our side the first tests of Uno Platform on .NET 6 RTM are showing great performance improvements on Visual Studio 2022 across several fronts, including Android and WebAssembly. More on this at our UnoConf…. Uno Platform 3.11 release ships 160+ features and bug fixes and adds support for  .NET 6 RTM with all related improvements.   As Microsoft had announced the delay for .NET 6 support for Android and iOS, we’ve re-introduced Xamarin-based templates for Visual Studio 2022. Additionally, the support for preview .NET 6 Android and iOS has now been moved to 17.1 Preview 1. In Visual Studio 2022, you’ll find now two templates: One named Multi-Platform App (UnoPlatform|xamarin), which uses the existing stable Xamarin “Classic”. It is the same as found when using Visual Studio 2019. One named Multi-Platform App (UnoPlatform|net6), which uses the .NET 6 preview support for iOS, Android, macOS and Catalyst and requires Visual Studio 17.1 preview 1. To use this new release, you can setup your

Native Badges Come to Progressive Web Applications

  W3C’S recent first draft publication of web badging API, a feature that was previously only available on iOS and macOS targets of Uno Platform, has finally made its way to Android and web platforms. The Badging API gives web developers a means of setting a badge on a document or application, to act as an identifier that the state has changed without displaying a more distracting notification. In this article we will share with you how Martin Zikmund, a mobile/cloud developer and Uno Platform contributor, implemented the BadgeUpdateManager API in Uno Platform WebAssembly using this new API. Web Badging API The web Badging API provides a very simple set of methods to set and clear the badge: await navigator.setAppBadge(42); // Sets the app badge to 42 await navigator.clearAppBadge(); // Clears the app badge There is also a similar set of methods setClientBadge and clearClientBadge – these are very similar, but can only be used when the app is running (whereas setAppBadge and clearAppBadge can also be utilized from service worker). It is also important to note, that the badge is only set when the app is running as PWA on the device – it will not be applied when the app is just running as a tab

Uno Platform 3.3 – Day 0 support for WinUI 3 Preview 3, Android 11

WinUI 3.0 Preview 3 is a big step towards shipping the final version of WinUI. We at Uno Platform team are happy to report that Uno Platform already works with the latest WinUI preview. Our sincerest thanks to WinUI team who keeps us posted on their progress and allows us to make modifications to Uno so that our joint developer base can use the latest and greatest bits right away. In addition to shipping support for Preview 3 the team also managed to ship additional features in our 7th release in 2020. About the Uno Platform For those new to Uno Platform – it allows for creation of pixel-perfect, single-source C# and XAML apps which run natively on Windows, iOS, Android, macOS, Linux and Web via WebAssembly. Uno Platform is free and Open Source (Apache 2.0) and available on GitHub. The best way to get started with the Uno Platform is to check out the Getting Started guide (< 10 minutes to complete) WinUI 3 Preview 3 support We’re aligning the API surface from WinUI 3.0 Previews in Uno, alongside adding support for the WinUI Desktop project template. The Desktop template enables WinUI applications to use the full Win32 and

Porting an UWP app to iOS, Android and Web. A 5,000,000-app-downloads developer story

Just recently I have converted one of my UWP games to Uno Platform – The Minesweeper 10 and I wanted to share my experience. In just about 4 hours I was able to have it run cross-platform on iOS, Android and Web! The Challenge I have developed many apps and games using UWP. To date I have almost 5 million app downloads in the Microsoft Store which are played by thousands of users on daily basis. To keep my development going most of my games use Ads for monetization. Unfortunately for me, and developers like me, in February Microsoft announced that they would stop supporting Ads in UWP in June. This would mean that I would lose most of my income and that I needed to act fast. In addition, I regularly get emails from my users asking if my games are also available on Android and iOS. They were not, which always made me feel like I was missing out on a bigger opportunity to monetize the work I already did for UWP and will continue with WinUI. Moving Minesweeper and other UWP apps I made the decision to try to move my apps to Android and iOS as

Announcing Uno Platform 2.3 – Android 10, Android X, WinUI and more!

  The wait is over! Uno.UI for Android now supports compilation for API level 29 (Android 10). It is now possible to use all the new APIs available like the new location permissions and improvements to the Biometry and foldables support.   Using the API level 29 allowed us to review our TextBlock implementation for Android and use official APIs now available to replace some reflection code required to access hidden APIs for MaxLines. While being safer going forward, this approach also provides performance gains for this crucial control. Applications have only 1 or 2 TextBlocks right? 🙂 Exit Android Support Libraries, Welcome Android X Like all Android and Xamarin developers before, we were using the Android Support Libraries. Those packages can sometimes cause developers some headaches but they achieve a pretty awesome feat. Among other things, they allow us to use new features on devices running older Android versions. The Android team started a huge refactor to break those libraries into even smaller pieces, now called Android X (or JetPack) and then the Xamarin team released their stable bindings for them last February. Logically, we had to migrate Uno to them! Shout out to the Xamarin team, their migration tooling worked

How to use custom fonts in Android, iOS, and WebAssembly via Uno Platform

Credit: This article originally appeared at https://blog.mzikmund.com/2020/01/custom-fonts-in-uno-platform/, written by Uno community champion Martin Zikmund. Custom fonts are super useful to make your application match company brand and to create vector-based font icons. Let’s take a look at how we can use custom fonts in UWP, Android, iOS, and WebAssembly with Uno Platform! Get a font (or create one) There are many on-line sources for free custom fonts, including: Google Fonts 1001 Fonts Font Squirrel Always make sure the license for the font allows packaging it with your application. We can also create a new font. This is especially useful for icon fonts – we can choose a custom set of vector-based icons, compile them into a font and use this for iconography in your app. Niels Laute wrote an excellent article on creating custom icon fonts for apps. I highly recommend it! For this article, I have chosen a font called Sniglet, which is available on Google Fonts: Font formats We require two different font formats – TrueType .ttf for UWP, Android and iOS, and Web Open Font Format (.woff) or its newer version (.woff2) for WebAssembly (WASM). All current versions of major browsers which support WASM support .woff2 as

Microsoft Surface Duo: Researching Android Development

Guest Blog Post by Andrew Hoefling The other week (10/2/2019) Microsoft had a special Surface event in New York City where they unveiled multiple dual-screen foldable devices. The Surface Neo, running a new Operating System, announced Windows 10X at the event, and the Surface Duo, a smaller device running Android OS. Both devices are being announced a full year prior to their release to give developers time to update their apps to support the dual-screen form factor of the new Surface devices. Since then developers have been looking into APIs and asking the following questions: When will there be a public simulator or emulator? When can we get a development kit? Where is the documentation on the new APIs? Panos Panay, Chief Product Officer at Microsoft, stated in an interview: We’ve got probably a couple months before developers are going to have their hands on it and be running. While we wait for the official documentation, I took it upon myself to start researching the Android APIs and how I would attempt to write a native Android App to support a dual screen device. As the research unfolded, I would share it on Twitter to discuss with others in the

A Piece of Windows 10 is now running on WebAssembly, Natively on iOS and Android

A few months ago, Microsoft open sourced the Windows Calculator, the very Calculator that ships with Windows 10. We decided to port it to C# and the Uno Platform, so that iOS and Android users could use it, but also use it from the Web using WebAssembly. Why – well that’s what we at Uno Platform do ? – enable the same C# and XAML code to run on the Web, Mobile and Desktop.   You can use it today on: Apple App Store Android Play Store WebAssembly: https://calculator.platform.uno Windows 10 – well, just open it on Windows 10 ? Anatomy of the Windows Calculator The Windows Calculator is an interesting and not-so-simple piece of software. The simple initial UI you see upon launch can be deceiving. Of course, that is a good UX choice Microsoft made as most uses of the calculator are rather simple ones. However, the calculator is complex both in the way it was coded over the years, as well as the advanced functions it has. First, it’s built entirely using standard C++ 11 and C++/CX, with a calculation engine that dates back from 1995. Historically, parts of the C++ code were actually built in C. Second, the calculator contains features such as: