Last stop before MAUI: Xamarin Forms 5.0 released for cross-platform mobile, new features, new bugs

Microsoft's cross-platform .NET tools get a refresh, but with a relatively short life before newer tools sweep it away

Microsoft has flung open the doors to Xamarin Forms 5.0, a major new version of its cross-platform framework targeting iOS, Android, and Windows 10.

Other target platforms such as macOS and WPF (Windows Presentation Foundation) are in varying degrees of readiness.

However, the company stated that the forthcoming Multi-platform App UI (MAUI) will replace Xamarin Forms, so jumping in now is only worth it for developers who plan a MAUI migration later.

The first release of Xamarin Forms was in 2014 when Xamarin was still an independent company. The firm's technology, based on the Mono open-source implementation of the .NET Framework, included C# compilers for Android and iOS.

The company's original line was that only non-visual code should be cross-platform, and developers were asked to create a native user interface for each target platform. While good for native look and feel, this approach is a lot of work, and Xamarin Forms was introduced in 2014 to enable basic user interface code to be shared across platforms. It was taken up with enthusiasm by Xamarin developers, and subsequent releases increased its scope. The firm was acquired by Microsoft in 2016.

Back in 2016, it looked as if Xamarin and Xamarin Forms might be important for Microsoft and for the .NET ecosystem. The ability to write .NET code and run it on mobile as well as desktop platforms seemed to solve a big problem for the company. Within Microsoft, though, it was one of many development options, with the Windows team putting its weight behind the Windows 8 Modern platform, which evolved into UWP (Universal Windows Platform) as well as JavaScript-based cross-platform options.

There were also some annoyances with Xamarin Forms, including the fact that the XAML dialect it uses is different from that used for Silverlight and WPF. UWP was added as a target platform for Xamarin Forms, but it still had gaps, such as Windows Desktop and macOS (announced in early 2017 but still in preview).

Another point of confusion is that the variant (or, more accurately, variants) of .NET used by Xamarin Forms is different both from the Windows-only .NET Framework and from the open-source .NET Core.

Xamarin Forms will converge with .NET Core with the release of .NET 6.0, whereupon it will be evolved into MAUI.

According to Scott Hunter, Microsoft Director, Program Management, MAUI will provide "a single stack that supports all modern workloads: Android, iOS, macOS, and Windows."

Thanks to Blazor and WebAssembly, there may eventually be web application support as well.

Hunter also revealed that the newly released Xamarin Forms 5.0 will have a short life. "Xamarin.Forms will ship a new major version later this year, and continue to ship minor and service releases every 6 weeks through .NET 6 GA in November 2021. The final release of Xamarin.Forms will be serviced for a year after shipping, and all modern work will shift to .NET MAUI," he said.

Version 5.0 is the "new major version" he was referring to, and active support for Xamarin Forms (any version) is scheduled to end November 2022, according to the MAUI notes on GitHub.

The transition from Xamarin Forms to MAUI should be smooth, but will nevertheless be a migration and not just a recompile of the source. "We intend to provide try-convert support and migration guides similar to what we have today for migrating to .NET Core," said Hunter.

While the above means that Xamarin Forms 5.0 is at best a transitional release, it is something that developers enthused by the prospect of MAUI can use now. Google's Flutter is an obvious competitor, but has a different philosophy, drawing its own user interface controls rather than using what is native to the platform it runs on. The merits of this approach are eternally debated, but for developers who prefer to render the UI using native controls, Xamarin Forms is an attractive solution.

5.0 has a bunch of new features, including support for app themes such as Dark Mode, Brush classes for painting an area, new Shapes and Paths for drawing, more sophisticated radio buttons including control templates for rich effects, and a SwipeView container for menus revealed by a swipe gesture. Drag and drop gestures are also now supported, subject to a minimum version of iOS 11 on Apple's mobile platform.

A new CarouselView is for displaying a collection of items that the user can swipe through. Developers targeting iOS are being asked not to use the UIWebView control, which has been replaced by a WKWebView control; Apple has deprecated UIWebView. Further, some elements which used to be in the core Xamarin Forms framework have been moved to a Community Toolkit library. This includes MediaElement and Expander. Some "experimental" packages including DataPages and Themes have been removed from the framework.

Users commenting on the post introducing Xamarin Forms 5.0 have noted some problems with the first release. "There are many Bugs and Issues related to Right To Left Layout," said one. Another "ran into two pretty obvious issue[s] with Shell. The first is that if you have a Shell.FlyoutBackgroundImage it is shown on top of the menu items such that they are not visible. The second is that Shell.TitleView is not shown at all in iOS."

David Ortinau, Microsoft principal program manager for mobile tools, responded that "those issues are both addressed and shipping very soon in a service release," but the existence of such issues suggests caution in adopting the new release immediately.

Master-detail forms are now renamed Flyouts for reasons of sensitivity - as well as being, according to Ortineau, a more accurate name.

Despite all the caveats, Xamarin Forms is a fast route for getting an existing .NET application ported to a mobile application. ®

Broader topics

Other stories you might like

  • FTC urged to protect data privacy of women visiting abortion clinics
    As Supreme Court set to overturn Roe v Wade, safeguards on location info now more vital than ever

    Democrat senators have urged America's Federal Trade Commission to do something to protect the privacy of women after it emerged details of visits to abortion clinics were being sold by data brokers.

    Women's healthcare is an especially thorny issue right now after the Supreme Court voted in a leaked draft majority opinion to overturn Roe v Wade, a landmark ruling that declared women's rights to have an abortion are protected by the Fourteenth Amendment of the US Constitution.

    If the nation's top judges indeed vote to strike down that 1973 decision, individual states, at least, can set their own laws governing women's reproductive rights. Thirteen states already have so-called "trigger laws" in place prohibiting abortions – mostly with exceptions in certain conditions, such as if the pregnancy or childbirth endangers the mother's life – that will go into effect if Roe v Wade is torn up. People living in those states would, in theory, have to travel to another state where abortion is legal to carry out the procedure lawfully, although laws are also planned to ban that.

    Continue reading
  • Zuckerberg sued for alleged role in Cambridge Analytica data-slurp scandal
    I can prove CEO was 'personally involved in Facebook’s failure to protect privacy', DC AG insists

    Cambridge Analytica is back to haunt Mark Zuckerberg: Washington DC's Attorney General filed a lawsuit today directly accusing the Meta CEO of personal involvement in the abuses that led to the data-slurping scandal. 

    DC AG Karl Racine filed [PDF] the civil suit on Monday morning, saying his office's investigations found ample evidence Zuck could be held responsible for that 2018 cluster-fsck. For those who've put it out of mind, UK-based Cambridge Analytica harvested tens of millions of people's info via a third-party Facebook app, revealing a – at best – somewhat slipshod handling of netizens' privacy by the US tech giant.

    That year, Racine sued Facebook, claiming the social network was well aware of the analytics firm's antics yet failed to do anything meaningful until the data harvesting was covered by mainstream media. Facebook repeatedly stymied document production attempts, Racine claimed, and the paperwork it eventually handed over painted a trail he said led directly to Zuck. 

    Continue reading
  • Florida's content-moderation law kept on ice, likely unconstitutional, court says
    So cool you're into free speech because that includes taking down misinformation

    While the US Supreme Court considers an emergency petition to reinstate a preliminary injunction against Texas' social media law HB 20, the US Eleventh Circuit Court of Appeals on Monday partially upheld a similar injunction against Florida's social media law, SB 7072.

    Both Florida and Texas last year passed laws that impose content moderation restrictions, editorial disclosure obligations, and user-data access requirements on large online social networks. The Republican governors of both states justified the laws by claiming that social media sites have been trying to censor conservative voices, an allegation that has not been supported by evidence.

    Multiple studies addressing this issue say right-wing folk aren't being censored. They have found that social media sites try to take down or block misinformation, which researchers say is more common from right-leaning sources.

    Continue reading
  • US-APAC trade deal leaves out Taiwan, military defense not ruled out
    All fun and games until the chip factories are in the crosshairs

    US President Joe Biden has heralded an Indo-Pacific trade deal signed by several nations that do not include Taiwan. At the same time, Biden warned China that America would help defend Taiwan from attack; it is home to a critical slice of the global chip industry, after all. 

    The agreement, known as the Indo-Pacific Economic Framework (IPEF), is still in its infancy, with today's announcement enabling the United States and the other 12 participating countries to begin negotiating "rules of the road that ensure [US businesses] can compete in the Indo-Pacific," the White House said. 

    Along with America, other IPEF signatories are Australia, Brunei, India, Indonesia, Japan, South Korea, Malaysia, New Zealand, the Philippines, Singapore, Thailand and Vietnam. Combined, the White House said, the 13 countries participating in the IPEF make up 40 percent of the global economy. 

    Continue reading
  • 381,000-plus Kubernetes API servers 'exposed to internet'
    Firewall isn't a made-up word from the Hackers movie, people

    A large number of servers running the Kubernetes API have been left exposed to the internet, which is not great: they're potentially vulnerable to abuse.

    Nonprofit security organization The Shadowserver Foundation recently scanned 454,729 systems hosting the popular open-source platform for managing and orchestrating containers, finding that more than 381,645 – or about 84 percent – are accessible via the internet to varying degrees thus providing a cracked door into a corporate network.

    "While this does not mean that these instances are fully open or vulnerable to an attack, it is likely that this level of access was not intended and these instances are an unnecessarily exposed attack surface," Shadowserver's team stressed in a write-up. "They also allow for information leakage on version and build."

    Continue reading

Biting the hand that feeds IT © 1998–2022