It is always fun for me to program in C# (besides C++). If so, how would I feel if I was able to program for Android in C#? You may be wondering what in the world I am talking about. Android development environment is all Java and open source stuff. How could this Microsoft thing fit onto it?
Well, it seems that some clever guys had huddled up and ported Mono for Android, developed .NET libraries for the Android SDK, and also supplemented it with a 'Mono for Android' project template in Visual Studio; and called it mono for android. Thus we end up writing C# code happily for Android.
After a bunch of installations, fire up your Visual Studio (2010) and you should be seeing a new project template 'Mono for Android' under C#.
Create a new 'Mono for Android' project, which by default comes with an activity - C# code.
Modified the orginal code to try starting a new activity from the default one... |
The project layout for most of the part is similar to the native Android project. The layout resources files are named *.axml, and the strings.xml is really clean with named string constants with the ugly behind the scenes of ids and stuff in the Resource.designer.cs. The way to code is straight forward and needs no special explanation. A good to see thing for me was .NET coding style.
A similar set of addins and plugins have been developed for MonoDevelop too; although I did not try that.
It is really a wondrous thing to know, program and relish such an attempt. However, there are sad curves in the story:-
- Mono for Android is available only for Windows (and Mac). It is not available for Linux.
- The installation of the application from Visual Studio and application response for the few clicks is pig slow. It is not Visual Studio's fault. It seems Mono takes quite a bit of time for JITting. After each part of the code is JITed, the application response for that part is fairly ok, but not as good as Android's native\custom VM Dalvik.
- The trial version does not allow deploying on the device. You can play around and deploy only on the emulator. If you want to use it on the device, it costs. Yes, it costs somewhere between $400-2500, depending on the licesing and support. Pretty expensive!
Try it out (the trial one or the full version if you are rich), at least for fun!
Comments
I think Mono For Android is a better option for learning, but if we are to go with real time project and later deploying on a device, Java is the better option, though we may not enjoy the luxuries as in VS and C#.
We have a project running here, which is planned to move to the Android platform in near future. Some folks here argue to go with Mono, but I feel down the road we might realize support will be limited. Mono claims they support Silverlight in Linux using Moonlight, but it has many pitfalls.
.Net Support using Mono Android
Mono for Android enables developers to use Microsoft Visual Studio to create C# and .NET based applications that run on Android phones and tablets.
Developers can use their existing skills and reuse code and libraries that have been built with .NET, while taking advantage of native Android APIs.
Mono does not support Windows Form/XAML/Silverlight or Visual Basic.
To reuse existing .NET code with Mono for Android, you must recompile your libraries with Mono for Android base assemblies.
Mono for Android will support the C# language, garbage collection, multi-threading and many features of the core of .NET 3.5 including C# 3.0 and LINQ
The following assemblies are part of Mono for Android 1.0:
· mscorlib.dll
· System.dll
· System.Core.dll
· System.Json.dll
· System.Runtime.Serialization.dll
· System.ServiceModel.dll
· System.ServiceModel.Web.dll
· System.Web.Services.dll
· System.Xml.dll
· System.Xml.Linq.dll
In addition, the following Mono assemblies are part of Mono for Android 1.0:
· Mono.Security.dll
· Mono.Data.Sqlite.dll
· Mono.Data.Tds.dll
· Mono.Android.dll
And the following third party assemblies are part of Mono for Android 1.0:
· OpenTK.dll
Database Support:
SQLite is supported as Database which is serverless. XML is also supported.
Installation of MS Access & SQL Server is not possible. So MDF & MDB files are not accessible. However connecting Remote SQL Server database is possible using Web services.
Communications:
It supports wireless communications using GSM mobile-phone technology, 3G, Edge, 802.11 Wi-Fi networks.
I am not sure if we can take the road of Mono for Android. There may not be issues support wise but the performance of the application seems not to be proven.
Not all portings work well. For instance, there is Firefox and Opera for Android. Both suck. They may not be ported but rewritten. Not sure!
If someone has already treaded that road and made success, it would be safe for us to choose. Or if we are to choose, it should not be a critical project on which the company bets.
But it is really exciting to know about such attempts. And who knows it may turn out to be a big success one day.
So Its great article to read here and with the help of screenshots it makes us better understand.build an iphone app
http://www.kellermansoftware.com/p-43-ninja-net-database-pro.aspx