Reputation: 8575
I have some useful code written in C# and I want to use it in my android app. Can I use it directly, or it is nesessary to rewrite it on Java?
Upvotes: 7
Views: 2892
Reputation: 1052
Depending on how many lines of code you are talking about, I would start with one of the size limited demo versions of the several 'csharp to java' code converters available. Google 'csharp to java'. You won't necessarily get perfect, runnable, java code but it will break the back of the conversion exercise for you.
Upvotes: 1
Reputation: 4633
If you are looking to mix C# and Java, then it will probably be more trouble than it is worth. However using Mono for Android and reading this similar question you can find the Droid you are looking for.
Upvotes: 1
Reputation: 2752
You will need to rewrite it. Or Run your C# code as a web service (WCF or Web API) and have your java application talk to the web service
Upvotes: 9
Reputation: 3846
If you are looking to do it for free, you probably have to just rewrite it in Java.
Upvotes: 4
Reputation: 21887
There's a project called Mono for Android
, and it gives you the ability to write android apps in C#:
http://xamarin.com/monoforandroid
Upvotes: 5