News

No Java Required: Write Android Apps in C#

XobotOS is a Xamarin-developed project that translated millions of lines of Java to C#.

Java is the underlying code for the Android OS. But one company has changed all that, ripping out most of the Java and replacing it with C#.

That means .NET developers can code in a familiar language and produce apps that leverage C#'s advantages, including speed increases.

It started as a skunkworks project for Xamarin. Xamarin's claim to fame is Mono, an open-source framework allowing Android and iOS apps to be built using C# running on top of Java. Now, with what the company calls the XobotOS Research Project, the Java layer has been removed via a "machine translation of Android from Java to C#," according to a blog post from Xamarin CTO Miguel de Icaza.

Building XobotOS involved converting more than a million lines of Java code into C#, de Icaza wrote. A tool called Sharpen was used to help in the translation, and the project resulted in an improved version of Sharpen, de Icaza says. Most of Androids layouts and controls, de Icaza says, have been converted, and to demonstrate, the post includes a Java-free screenshot of  XobotOS running on a Linux desktop.

In terms of speed improvements, the blog includes a bar chart of a benchmark from a simple binary tree implementation in Java and C#. The chart shows a huge increase in performance between the two languages.

Xamarin has made XobotOS available on github. de Icaza says that XobotOS won't be "a focus" going forward, as the company wants to put its efforts toward its core products, Mono for Android and MonoTouch.

One other possible benefit of using XobotOS for Android development is that it would eliminate the kind of potential legal entanglements that Google finds itself in with Oracle, the patent-holder for Java. Replacing Java with C# would, of course, inoculate developers from the clutches of Oracle's lawyers.

About the Author

Keith Ward is the editor in chief of Virtualization & Cloud Review. Follow him on Twitter @VirtReviewKeith.

comments powered by Disqus

Featured

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube