Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I choose Xamarin native or Xamarin.Forms for existing Android app?

We have an android application and want to recreate it for cross platform.

What are the facts for or against Xamarin native and forms?

The advantage of native would be, we could reuse all the xml-layouts while we have to recreate the iOS view in either XAML or XIB?

Is there anything what is really a blocker?

like image 224
AliMC Avatar asked Apr 27 '16 19:04

AliMC


People also ask

Which is better react native or Xamarin?

Xamarin prides itself on allowing developers to reuse up to 96 percent of their C# code by leveraging the language. Xamarin also offers forms components, making it better for code reuse than React Native and Flutter which share an average of 60–90 percent of codes.

What are the disadvantages of Xamarin for Android development?

Limited Access To Open Source Libraries. Xamarin requires the use of elements provided by the platform, as well as . NET open source libraries. As you would expect, the choice is not as rich as it is for iOS and Android native development, and you might end up with a lot of native coding.

Is Xamarin forms going away?

With the sunsetting of Xamarin. Essentials, it will continue to be serviced through November 2022, but new features and APIs will only be added to .

Should I use Xamarin forms or Xamarin native?

Generally, the main distinction between the two platforms is that Xamarin. Forms allows reusing the same UI code for multiple OS, whereas Xamarin Native is adapted to APIs, specific to a specific platform – Windows, iOS, Android.


1 Answers

I'll comment based on Giorgi's answer with some actual insight and refer to the copied bullet points:

This is a resume of the experience i've gathered in the past 6 months:

Xamarin.Forms is best for:

  • Apps that require little platform-specific functionality
    • Wrong. With DI you can use any device functionality you could possibly want. Check out XLabs on GitHub if you doubt this.
  • Apps where code sharing is more important than custom UI
    • Kind of nonsense really. You can write your own renderers to represent controls of each platform in the way you want. I've also written more difficult renderers for custom controls such as a SideDrawer. In android i was done in 2 days, iOS about 2 weeks (android renderer was just a wrapper for the native control)
  • Developers comfortable with XAML
    • well yeah and anyone who enjoys convenient UI development. Mind you that there is a learning curve with xaml (which i already knew at the time i started from WPF development). But from what i have seen it's not that different from android.

Xamarin.iOS & Xamarin.Android are best for:

  • Apps with interactions that require native behavior
    • While hacking your solution up natively is certainly faster you can instead be done rather quick if purchase good controls / know a good native implementation and mirror it in C#, since the API in C# is very similar to the native one.
  • Apps that use many platform-specific APIs
    • Not sure why Xamarin is doing anti advertisement against forms. I had little trouble with it so far
  • Apps where custom UI is more important than code sharing
    • Probably true, but it's also harder to keep UI functionality inline and you will need more manpower.

Things to consider about forms:

  • Forms seems to be stabilizing at the moment and i am sure Microsoft will do their best to turn it into a solid, reliable product (build issues have been a nightmare in the past sometimes, but it has gotten better over time)

  • The XAML for Xamarin is less developed compared to WPF XAML, though very similar. Recent nuget updates however provide mirrored functionality at an impressive rate. The vast majority of features you expect and love about XAML are present.

  • List performance is bad if you don't do your research (here). Performance increased loads in that area.

  • If i had to make the choice again i'd still go for forms. While there are sometimes things which seem flawed / bad you can usually figure out a clean fix somehow, while spending most of your time actually developing the app. (sometimes you will still find things which just make you frown why something isn't implemented, like the Margin property being implemented only just after microsoft purchased xamarin)

  • If you end up having a requirement of nested lists, make sure to have a look at embeded native controls in order to achieve the maximum performance - this was essential for a product i was working at. See this
like image 175
Dbl Avatar answered Sep 18 '22 14:09

Dbl