From WPF to Android

BrghtBrght USMember

I have an app written in WPF with class library which implements some kind of a comunication protocol (mainly by using TCPClient and SSLStream classes, server certificate, etc.). Now, my client wants to have an Android app like this WPF app, where It would be nice to reuse that class library. Is this possible to do in Xamarin for Android, or I need to reimplement an application and the communication library from scratch in native Android enviroment ?

Tagged:

Best Answers

Answers

  • rmaciasrmacias USBeta, University ✭✭✭✭✭

    Very hard to say without more information. A good place to start is by uploading your library to:

    http://scan.xamarin.com/

    Select your targets and it'll point out areas that are not cross platform. From there you can evaluate how to proceed.

  • BrghtBrght USMember

    I scanned my library, and it says:

    Scan Results

    99% of your code is ready for mobilization!

    Xamarin analyzed the following assemblies for compatibility with Xamarin.Android: Core.dll

    100%

    Android

  • rmaciasrmacias USBeta, University ✭✭✭✭✭
    edited May 2015

    Cool! Looks like you only need to make a few minor modifications. It should have also pointed out which parts of your code is not cross platform. So you'll need to take a look at those and plan on how to either make it cross platform, or use dependency injection to inject an Android specific or WPF specific implementation into your library.

  • BrghtBrght USMember

    It didn't find anything. Everything is compatible. When I tried this scan for Windows Phone, it found some classes which are not available on phone, which is weird. .NET class library 100% compatible with Android but not with Windows Phone ?

  • BrghtBrght USMember
    edited May 2015

    O.K. So it's (easily) possible to port my library to Android by using Xamarin for Android. I need only to do forms and menus. As I'm new in Xamarin, from where should I start to port my .net library/app to Android by using Xamarin ? In addition, would I loose something if I not use native Android approach (I'm .NET developer) ?

  • BrghtBrght USMember

    Great, thanks! No, my design is not complicated, at all. I have just two more questions:

    1. For #1, in what tehnology I do android forms there ?
    2. If I understand you correctly, I just need to reference my class library from Xamarin.Android project and to add forms ?
  • rmaciasrmacias USBeta, University ✭✭✭✭✭
    edited May 2015

    Just open up Xamarin Studio (activate a trial) and then either create an Android Project (1st suggestion) or create a Xamarin.Forms (2nd suggestion) project. From there you can look at the tutorials and start by creating prototype or mock UIs to get your feet wet.

    If you activate a Trial, you can use Visual Studio. But after your trial ends, you'll need a Business License to use Visual Studio. Alternatively you can continue to use Xamarin Studio.

Sign In or Register to comment.