Develop Android app using C#
Solution 1
You could use Mono for Android
:
http://xamarin.com/monoforandroid
An alternative is dot42
:
dot42 provides a free community licence as well as a professional licence for $399.
Solution 2
Having used Mono, I would NOT recommend it. The Mono runtime is bundled with your app, so your apk ends up being bloated at more than 6MB. A better programming solution for C# would be dot42. Both Mono and dot42 are licensed products.
Personally, I would recommend using Java with the IntelliJ IDEA dev environment. I say this for 3 reasons:
- There is so much Java code out there for Android already; do yourself a favour and don't re-invent the wheel.
- IDEA is similar enough to Visual Studio as to be a cinch to learn; it is made by JetBrains and the intelli-sense is better than VS.
- IDEA is free.
I have been a C# programmer for 12 years and started developing for Android with C# but ended up jumping ship and going the Java route. The languages are so similar you really won't notice much of a learning curve.
P.S. If you want to use LINQ, serialization and other handy features that are native to C# then you just need to look for the equivalent java library.
Solution 3
Here is a new one (Note: in Tech Preview stage): http://www.dot42.com
It is basically a Visual Studio add-in that lets you compile your C# code directly to DEX code. This means there is no run-time requirement such as Mono.
Disclosure: I work for this company
UPDATE: all sources are now on https://github.com/dot42
Solution 4
Mono Touch is the answer.
Solution 5
I have used the Unity 3D game engine for developing games for the PC and mobile phone. We use C# in this development.
Related videos on Youtube
CoolArchTek
Updated on May 09, 2020Comments
-
CoolArchTek almost 4 years
Is it possible to write an android app using C#? Is there an API or something? Is it free for personal and commercial development?
What do I need to install to have android project template in my Visual Studio?
-
Dheeresh Singh almost 12 yearsnot sure about any way that C# can be used but you can try HTML5.....(but have some limitation)
-
Todd Davies almost 12 yearsC# is more similar to objective C than java. iPhone's use the former, Android uses the latter, and so it would make more sense to try out iPhone development than Android development if you already know C#.
-
Darren almost 12 years@ToddDavies I would disagree entirely and say Java and C# are the most similiar languages. Infact I would say Objective C does not reflect C# at all.
-
Todd Davies almost 12 yearsWell, each to his own opinion, but I'm sure that Java is to Objective C as I am to my most hated fifth removed cousin :P
-
Danyal Aytekin about 11 years+1 @DarrenDavies The Mono bindings for iOS struggle to represent their Objective-C equivalents in some places (e.g. protocols) but they are straightforwardly 1-1 against Android.
-
-
CoolArchTek almost 12 yearsIs it free for commercial development? I want to develop an app that is for a company (their users).
-
CoolArchTek almost 12 yearsPlease take a look at the comment I added to Seva Alekseyev's reply.
-
FoamyGuy almost 12 yearsThey have it so that you can use lots of it for free. But there is a licence fee of some sort iirc
-
Darren almost 12 years@CoolArchTek - you can download the evauluation for free, however Mono for Android Professional is $399 and Enterprise is $999. store.xamarin.com
-
CoolArchTek almost 12 yearsIs Mono is the only way? Are there any opensource options avail?
-
Seva Alekseyev almost 12 yearsMono is open source IIRC. Also, do you realize the effort of porting the whole C# (CLR) runtime to a different platform, with little support from Microsoft? It's a miracle even Mono exists. Google and MSFT are direct competitors in the mobile space, C# is a MSFT-backed technology. Go figure.
-
cmroanirgo over 11 yearsTo write a few apps for yourself and your mates $399 is exceedingly prohibitive. I would wish there was something 'in between'. Considering that Android+Eclipse is FREE and Visual Studio Express is FREE, xamarin are missing out on a lot, simply because of their prices
-
Frank Rem about 11 yearsI don't think this is the right place to discuss pricing, but make sure to compare the correct licenses. I do want to note that dot42 comes with a free Community License for non-commercial use.
-
Dave81 about 11 yearsFrank, you are absolutely right and I must admit that I did not notice the community license.
-
citykid about 11 yearsnice. any comments if you will ever consider creating c code for ios?
-
Frank Rem about 11 years@thomas You mean compile C# to iOS executables? If so, yes it is on the roadmap but it this point we can not give any realistic date. We have our hands full with all the feedback coming from the Android community since we launched. We first want to make sure we get this part right.
-
Den almost 11 years@FrankRem it's a shame your licensing doesn't make a difference between a commercial hobbyist and a sole developer from a large business.
-
Den almost 11 years@FrankRem are there any limitations at all, like docs.xamarin.com/guides/ios/advanced_topics/limitations
-
Frank Rem almost 11 years@Den re license model. although you could argue whether a commercial hobbyist is a contradiction in terms, I understand your point. we prefer to keep our license model simple, both for you and us. we have just 2 types: community (free) and professional ($). we can only hope it strikes a good balance.
-
Piotr Kula over 10 yearsThis is awesome! Are there any plans for putting in a UI designer? Or can I use another tool to do this? Excellent work !
-
Frank Rem over 10 yearsActually, there are no such plans at the moment. You can use Android Studio for designing the UI. You can then import those resources in Visual Studio.
-
James over 10 years@cmroanirgo Xamarin now supports a subscription based model with a free option - you no longer need to buy Mono for Android.
-
Redoman over 10 years@james that's only true for small apps which don't P/Invoke third-party libraries: store.xamarin.com
-
James over 10 years@jj_ yeah I know, I wasn't going into the details of the free subscription the point I was making was you can release apps without having to purchase a license (where as before you did)
-
Sandeep Singh Rawat over 10 yearstoo expensive to be useful for individual developers. I personally am gonna try dot42 first and if that doesn't work use native Java.
-
nightcoder almost 10 yearsThanks, your experience seems useful
-
Krupal Shah over 9 yearsnice answer but what to do if android application have C# as backend?
-
Jesse Chisholm over 9 yearsA link to which version of the Unity 3D Game Engine you use would be nice.
-
renakre almost 9 yearswhat if I want to create an app for a web application built with Web API ?
-
JabberwockyDecompiler almost 9 yearshttp://www.dot42.com/ has this on their site
dot42 has been discontinued and is no longer supported. All sources are availabe on GitHub. The latest build is available as a binary setup.
as of 5/29/2015. They did have a source download and a GitHub. -
Mr doubt over 8 yearsThanks, your means, if we work with android using java then i will get more blogs and materials from googling. Only start up will get heard later everything fine. Thank you, I am C# developer but i will start my app with using java.