Difference between Xamarin.Forms and Native apps in 'MobleApps' tab RRS feed

  • Question

  • User166386 posted

    I am new to the Xamarin from Visual Studio. When I tried to create a cross platform application from ‘MobleApps’ tab, I saw Xamarin.Forms and native apps. What is the different between the these apps and when to choose these apps.

    Thursday, October 15, 2015 7:08 AM

All replies

  • User48032 posted

    Use Native when you want to design custom views using the native layouts for each supported platform (ie. Android: axml layouts, iOS: storyboards and viewControllers, Windows Phone: XAML pages).

    Use Xamarin.Forms when you want to design your views one time which will be shared across the platforms. Your views will be added to the Portable Class Library or Shared Project. Xamarin.Forms compile as native views for each platform. So your UI will render using the native controls on each device. Starting off with the Xamarin.Forms templates automatically adds the necessary Xamarin.Forms Nuget packages to your platform specific projects and your Portable Class Library.

    However, whether you choose to start off using the Native or Xamarin.Forms templates, you have the flexibility to use both in your project depending on your view.

    For example, you may have an application that contains views which are data-driven (listviews, data entry fields) which could be developed once using Xamarin.Forms and used across platforms. While other views may require the native layouts (for example, views that require fine-grained UI design or platform-specific interactions).

    Xamarin has a couple of examples on Github about using both Xamarin.Forms and native layouts within a project and how to navigate between them: Native2Forms and Forms2Native

    Before you can determine which approach to take for your UI design, I highly recommend reading the Xamarin.Forms Documentation and becoming familiar with the limitations: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/

    Thursday, October 15, 2015 7:10 PM
  • User228372 posted

    Here are some points which explains the Xamarin Native advantages over Xamarin Forms app,

    1. UI Lagging: we are using XAML for creating UI in Xamarin forms, so the Xamarin Forms will compile and convert the code platform specific.

    2. Third Part Library support: Xamarin Native environment has verity of UI and third party components library, both iOS and Android, there are certain third-party libraries you get used to using, especially UI components that make life easier on your target platform (including some that we’ve created internally). Unfortunately, using these libraries on Xamarin is non-trivial. Even though Xamarin offers bindings for some of the more popular libraries, some developers would need to provide bindings for themselves, and this is not as easy as Xamarin makes it seem.

    3. Cache Management: Xamarin native having more strong mechanism to clear the cache, in android we have certain events / methods which clear the data when the device is running out of memory, in iOS the garbage collector will clear the data when it is not I use.

    4. Non-Portable .NET Libraries: Some of the third party component libraries will not support Xamarin Forms apps, it only supports native environment.

    5. As per my understanding Xamarin Forms apps are not good for large quantity of data and it is also not effective for frequent data update.

    6. Native environment is best for apps which have interaction with native behavior like as calls, Bluetooth, Wi-Fi etc.

    7. Prefer Xamarin Native environment where we required more custom UI elements like as, viewpager, expandable list etc.

    Wednesday, January 11, 2017 7:21 AM
  • User264925 posted

    Hi @veeru3112

    In your opinion is there a scenario where Xamarin.Forms is preferable over Native?

    Tuesday, January 17, 2017 10:55 AM
  • User272016 posted

    @TiagoFreitasLeal said: Hi @veeru3112

    In your opinion is there a scenario where Xamarin.Forms is preferable over Native?

    Simple apps, prototyping (you need a working app, not perfect, just to present and see how it feels - for example for a client).

    Tuesday, January 17, 2017 9:40 PM
  • User228372 posted

    @TiagoFreitasLeal said: Hi @veeru3112

    In your opinion is there a scenario where Xamarin.Forms is preferable over Native?

    Yes sure if you have short time of development and want to build apps for multiple platforms then you can prefer Xamarin.Forms over native, it has a fast development cycle then the native. Here are some advantages of Xamarin.Forms over Native,

    • Development cycle is faster then native.
    • UI is created once and it will used across all the platforms
    • Code is shared across all the project.
    Wednesday, January 18, 2017 9:41 AM