16

I want to run C# programs on my HTC Magic, I can find the mono app on the Android market but I have no clue on how to run C# using.

The code is just for fun, I don't want official support and such. After coding Visual Basic on windows mobile, I really want to code C# on Android, whether directly using some sort of editor if exists, or compiling it on a PC then installing it on Android.

If anyone knows a way to do such please let me know.

Thank you

Hamid Pourjam
  • 20,441
  • 9
  • 58
  • 74
0xFF
  • 4,140
  • 7
  • 41
  • 58

4 Answers4

15

There's the androidmono project, which I gather pretty much works but is in relatively early stages.

EDIT: More recently: Mono for Android

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • @Shimmy: It wasn't when I posted it :) – Jon Skeet Mar 18 '12 at 07:22
  • @Shimmy: So do you think no-one should charge anything for software? (It's not actually clear to me that androidmono *is* a commercial project, by the way... what made you think it is?) – Jon Skeet Mar 18 '12 at 08:53
  • Cool now checking your link,.it's open source:) shame they charge 400 bux I sure rather learning Java and get used to eclipse quirks – Shimmy Weitzhandler Mar 18 '12 at 08:54
  • 2
    @Shimmy: You seem to be getting confused between the open and free androidmono project, and the commercial Mono for Android project. They're not the same thing. (You should also think about how long it takes to earn $400. *If* paying for something saves you a few days work, it earns its cost back immediately.) – Jon Skeet Mar 18 '12 at 09:19
  • Yes, I was confused. Anyway, I'm young I like to learn rather than pay :p Just started to get into Android development (I'm telling you, the best modern development platform is VS & .NET with C#/VB - MSFT is really spoiling its developers compared to other technologies). – Shimmy Weitzhandler Mar 18 '12 at 23:48
  • I know this is an old discussion, but nevertheless I wanted to add this one the discussion: http://www.dot42.com. Compiles C# to Android deployable code (no runtime/mone required). Comes with free and commercial license. – Frank Rem Feb 01 '13 at 22:05
  • Did you take a look at dot42? The approach is different from that of Xamarin in the sense that C# is compiled to dex. I would be intersted to learn what you think. Note that it is in tech preview stage. – Frank Rem Feb 02 '13 at 07:31
  • 1
    @FrankRem: I haven't looked at dot42 yet, but I'm pretty impressed with what Xamarin has been doing... – Jon Skeet Feb 02 '13 at 08:23
  • @JonSkeet: I agree. For one thing, Xamarin is a mature product with a large community. dot42 is a new product but it does take a unique approach that makes it worth looking at imho. dot42 compiles C# to dex code executed by the Dalvik VM which is found in every Android system. Because of that, you only need one deployment package for all Android systems out there today and tomorrow. Furthermore, dot42's implementation of the .NET Framework classes makes extensive use of available Android API's, avoiding large quantities of extra code in your deployment package. – Frank Rem Feb 02 '13 at 09:45
8

As I originally answered this over two years ago...

These days I would look at Mono for Android, developed by the Mono team.

It's a commercial product, but yes, you can then sell your app on the Android Marketplace (aka Google Play store).

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • I have seen that [xamarin android](http://xamarin.com/android) will load Mono Runtime which will take 6MB size, read [this answer](http://stackoverflow.com/a/15078945/1559213). Still xamarin is the best option for developing android app using c#? I have seen VS2013 supports[android development](http://msdn.microsoft.com/en-us/library/windows/apps/dn275875.aspx). But I cant upgrade my office PC to Windows 8 :( – Murali Murugesan Feb 07 '14 at 14:25
  • @Murali: I think you've misread that article - it's comparing writing Windows Store apps with writing Android apps. But yes, I believe Xamarin.Android is still the best option for developing for Android using c#. – Jon Skeet Feb 07 '14 at 14:30
3

Xamarin supports C# coding for both Android and iPhone, and is based on Mono. For more details, check out: http://xamarin.com/

pierceboggan
  • 317
  • 5
  • 21
Mahesh
  • 2,731
  • 2
  • 32
  • 31
3

You may want to have a look at dot42 at https://www.dot42.com/ I've never tried it myself, tough looking at various articles, it seems that this may be a valid option.