1

What is the best way to upgrade a MonoDroid app to a java Android app and/or to an HTML/js app? E.g. the project has a bunch of .axml files which are just .xml Android layout files when you look at them, .xml style/choice stuff put into Drawable, and the .cs files are clearly just Android in C# such as AsyncTasks and such. Now, the Web References folder must be the service/AJAX calls. Stuff like this: CFM.Service.User, Web References.Service.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

How can I code for this in Java or else in javascript? What's the best way to get off this c# code base and get to either a Java Android app or to an HTML/js (e.g. PhoneGap) app? Anyone done this?

Similar [unanswered] questions here: Call SOAP webservice(Made in .NET) through Javascript and How to call .NET WSDL call in jQuery Javascript?

Community
  • 1
  • 1
maxweber
  • 576
  • 1
  • 5
  • 12
  • 5
    You can't upgrade it to Java Android or Phonegap. That itself is a downgrade. – Cheesebaron Apr 28 '13 at 21:04
  • 4
    What makes you think a Xamarin/MonoDroid app isn't a "real" Android app? It's certainly far more "real" or native than an HTML/PhoneGap app. – Daniel Plaisted Apr 28 '13 at 22:27
  • 1
    Do yourself a favour and acquaint yourself with Xamarin.Android. It's so much more fun to work with than Java! – Redth Apr 29 '13 at 00:33
  • Thanks for the feedback. Do you have an example of calling a .NET SOAP webservice without using .NET AJAX (using just javascript or jquery)? – maxweber Apr 29 '13 at 16:37
  • Also, a cursory research shows an additional 4MB and also an additional translation layer. The reason we are visiting the app is it doesn't run correctly on various devices. Perhaps the original programmer messed up or perhaps its an issue with the translation layer and framework. Experience has taught me that fewer layer to debug means faster conclusion. Any other reasons to use/not use one of these three technology approaches? – maxweber Apr 29 '13 at 16:49

1 Answers1

0

No. Migrating to either would largely be a rewrite. The C# code in Xamarin is fully Android-integration and exactly parallel to what one would write in Java; so, a mid-career programmer who knows both C# and Java could do it. I.e. AsyncTasks, ProgressDialogs, all the normal stuff one uses in Java and as provided by Android are also called from Xamarin.

The layouts and other assets would not be a rewrite: just rename them according to the restrictions (lowercase etc) of android Java build. One can look into ./obj/Debug/android/src and see the full tree of Java classes, so could use this as a starting reference. These simply proxy to the DLL; so, are not the end solution if one were migrating to Java. I do suspect one could toss Java code into the mix here if for some reason one wanted to integrate Java and C# in Android. That may be interesting. (Or use Intents may be a more Android-standard approach.)

The other answers are correct, the Xamarin IDE is a first class IDE and works well. Especially apropos if one also has .net services as the backend for the app (menu click import of the wsdl into callable classes, easy to look through code in both projects, etc).

Short answer is Xamarin works fine for letting you write C# and produce an Android app.

maxweber
  • 576
  • 1
  • 5
  • 12