Follow Us

We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message

Xamarin ports Android to C# to prove OS is not Java dependent

Code could be used to build Android phones that don't rely on Java

Article comments

Android has been ported to C# by Xamarin in an effort to improve its own development tools and show that the OS doesn't have to be dependent on Java.

Development tools vendor Xamarin was started in May last year to take care of the Mono project, an open source implementation of the .NET framework, after Attachmate decided to drop it following its deal with Novell, where Mono had its home previously.

Today, Xamarin offers cross-platform development tools for iOS and Android.

When working on how to improve the performance of its tool for Android, the company hit a wall because of performance issues with Dalvik, which is Android's virtual machine.

One idea the Xamarin team had was to translate Android's source code to C#. A few months later skunkworks project XobotOS was born.

The result of the project's efforts is that most of Android's layouts and controls have been ported to C#, and the code is available on GitHub.

"Turning XobotOS into something that can run on phones can be done. Someone like Google or Amazon could do it and get 10 years of performance optimisation," said Miguel de Icaza, CTO at Xamarin.

As big proponent of C#, de Icaza thinks Google was a little premature when it decided to go with Java for Android. Google is now embroiled in a court battle with Java owner Oracle over whether it violated patents and copyrights in its use of Java.

"I think that C# gets overlooked because it came from Microsoft originally. But today it is an ISO standard," said de Icaza. He contrasts that history with Java's, which Sun submitted for standardisation but then withdrew.

Microsoft has also included C# in its Community Promise, which states that the company "irrevocably promises not to assert any" claims against it.

In the end, Xamarin wants to concentrate on improving its development tools, and so XobotOS will not be a focus going forward, the company said.

However, a few technologies that have come out of the effort will be included in future versions of its products.

For example, today, Mono for Android accesses the underlying graphics libraries via Java, but with the code Xamarin built for XobotOS it can skip that step and get straight to the native rendering code in Android's graphics engine.

"Graphics applications will run faster with Mono and C# than they do with Dalvik and Java," said de Icaza.

Xamarin now has the tools necessary to replace some chunks of Java code with C# code where performance is critical and when C# can offer an improvement, as well.

The translation was made easier using a tool called Sharpen, which was originally created by db4object. Xamarin improved the tool, making it more scalable and updating it to work with modern Java idioms, while doing the actual translation work, according to de Icaza.

"Sharpen has a lot of benefits, not only for us but for other people, so we open sourced all of our code. We are hoping it will be useful for other people that are looking at doing Java to C# translations for whatever needs they might have," said de Icaza.

Along with XobotOS, the new version of Sharpen was also published on GitHub.



Share:

More from Techworld

More relevant IT news

Comments



Send to a friend

Email this article to a friend or colleague:

PLEASE NOTE: Your name is used only to let the recipient know who sent the story, and in case of transmission error. Both your name and the recipient's name and address will not be used for any other purpose.

Techworld White Papers

Choose – and Choose Wisely – the Right MSP for Your SMB

End users need a technology partner that provides transparency, enables productivity, delivers...

Download Whitepaper

10 Effective Habits of Indispensable IT Departments

It’s no secret that responsibilities are growing while budgets continue to shrink. Download this...

Download Whitepaper

Gartner Magic Quadrant for Enterprise Information Archiving

Enterprise information archiving is contributing to organisational needs for e-discovery and...

Download Whitepaper

Advancing the state of virtualised backups

Dell Software’s vRanger is a veteran of the virtualisation specific backup market. It was the...

Download Whitepaper

Techworld UK - Technology - Business

Innovation, productivity, agility and profit

Watch this on demand webinar which explores IT innovation, managed print services and business agility.

Techworld Mobile Site

Access Techworld's content on the move

Get the latest news, product reviews and downloads on your mobile device with Techworld's mobile site.

Find out more...

From Wow to How : Making mobile and cloud work for you

On demand Biztech Briefing - Learn how to effectively deliver mobile work styles and cloud services together.

Watch now...

Site Map

* *