0

I've been developing an Android application with Android Studio and now I need to be able to open it with Xamarin.forms in Visual Studio (it's a task that my teacher gave me, and it's because a classmate has been creating the iOS version and now we will combine them into one project).

I have to say that I'm pretty much a noob and been looking a few tutorials that talk about Dependency Service and other stuff, but don't seem to quite cover what I'm looking for (or, at least, not clearly enough).

If you have a precise video that explains simply how to do this, I would be grateful if you share it with me.

I thank you for your time and wish you a great day :)

Timo Salomäki
  • 7,099
  • 3
  • 25
  • 40
Jorvan
  • 109
  • 2
  • 13
  • 1
    That's not going to work. You can't just convert an Android native project to Xamarin. There are some specific, narrow ways you can reuse Android libraries in Xamarin, but not entire apps. – Jason Oct 24 '19 at 18:18
  • Neither part by part? – Jorvan Oct 24 '19 at 18:54

1 Answers1

0

It is impossible at even now in current version of Visual Srudio .

Every file in Xamain is different with Native Android . The Java code can not be directly copyed to use in Xamarin , you should translate them to C#.

Having a look at this document: Porting Java to C# for Xamarin.Android .

There are two ways to port Java code to C#. The first way is to port the code manually. ..The second porting methodology is to try and automate the process by using a code converter...There is often a non-trivial amount of work involved with bootstrapping an automated code conversion tool, and this may prove to be a barrier to use. In many cases, it may be simpler and easier to port Java to C# by hand.

Junior Jiang
  • 12,430
  • 1
  • 10
  • 30
  • Uf, that's bad news, but thanks. In any case, do you know a tutorial that specifically highlights the files of an android project that I should translate to C#? – Jorvan Oct 25 '19 at 13:31
  • @Jorvan Here is a official document abou [Xamarin for Java Developers](https://learn.microsoft.com/en-us/xamarin/android/get-started/java-developers) .Maybe this will be helpful for you . If answer be useful , thanks for marking or voting in advance. – Junior Jiang Oct 28 '19 at 01:39