Xamarin, React Native, Ionic, ... why so many mobile development platforms!? Why do they make our work that difficult!? Don't they know us!?We are those people who put hours to pick a good name even for a local variable, what do they expect us while picking a development platform! It is so hard!!
I am working with lots of companies, teams, and developers either working with these platforms or in the process of picking one. So I think it is a good time to share their experience (and so mine) here.
First of all, if you want to develop a mobile application, you have these 2 main options:
- Native Language: Java for Android, Objective C or Swift for iOS, ...
- Cross Platform: Xamarin, React Native or Ionic
As there are lots of articles on the web with pros and cons format, I don't want to focus on their pros and cons. Instead, I want to describe the situation that each of them is useful. When to use Native? When to use React Native, Xamarin or Ionic?
Native Approach
In the native approach, development is much easier and everything is more straightforward. There are lots of good documentation and articles available on the web.
Pick the native approach if:
- You are targeting just a single platform, like Android or iOS.
- You already have multiple teams for each platform and you can handle its complexity, the complexity of different skills, different teams and more people to hire. If you already handled everything you are just fine, keep it!
- It doesn't bother you that after fixing a bug on one platform, there is no guarantee not to have it on the others.
- It doesn't bother you to write same logic on different devices repeatedly because no code sharing option is available.
Cross-Platform Approach
If you want to target different platforms and devices, the cross-platform approach is a good option.
Pick a cross-platform solution if:
- You are tired of having different teams with different skill sets, struggling with different bugs.
- The rule of "Small team, big impact" is important to you.
- The long-term maintenance of your application is important to you. Code sharing between multiple platforms increases reusability and makes maintenance drastically easier for long-term projects.
And now, time to pick one among the solutions: Xamarin, React Native and Ionic. Here is when the real war begins between different approaches, different teams, and different opinions!
Being a part of this war in many teams and companies, I still don't believe that one of them is the best, so I want to assure you there won't be a final winner in this post. They are just different tools with different approaches which work best if utilized in a proper situation. Instead of making more fire for this war, here in this post, I want to describe the best situations that match each platform.
Ionic
Ionic is a great solution if you want to be fast in development. It is a great solution to create prototypes of your application which works on different platforms. Pick Ionic if:
- You want to rapidly develop your app for different platforms with the minimum effort.
- You are not going to use special platform-specific features. Some of them are not supported in Ionic at all.
- As Ionic doesn't use the native controls of each platform, make sure that it doesn't bother you or your customers.
React Native
React Native is great when you want to be fast, and also benefit from the native controls. Also, you have access to all platform-specific features. The only problem is when you are using those platform-specific features you should write them in corresponding languages: Java for Android and Objective-C or Swift for iOS. So if your app requires lots of platform-specific features, your code would be like 40% in JavaScript, 60% in Objective-C and another 60% in Java! Different languages in different IDEs would make a horrible headache. As you see, it is as hard as Native approach plus some extra complexity! Also, as the app execution is not native (unlike its native UI controls) there will be lots of situations that you should jump to native IDEs.
Pick React Native if:
- You want to rapidly develop your app for different platforms.
- You want to benefit from the native controls of each platform.
- You are going to use very few platform-specific features. Because there is no code sharing available for this part of your code.
Xamarin
Xamarin is great when you prefer maintainability and performance over easiness. So it is not good for creating a prototype rapidly. It is useful when you want to create a fully commercial product. I have worked with some teams that they had their prototypes in Ionic and started to design their commercial product in Xamarin. In Xamarin everything is Native. All of the code is in C#, even the platform-specific codes. So you can reuse your code even in platform-specific parts. Additionally, as you are using a single IDE instead of dealing with lots of them (at least XCode and Android Studio), debugging experience will be much easier and enjoyable.
Pick Xamarin if:
- You prefer maintainability over the speed.
- Having a native UI is important for you.
- Code re-usability is important for you (for all parts of the code, even the platform-specific parts).
Finally
Finally what!? I've described everything and there is no more compact version! This post is a summary itself!
Here I just want to thank Yaser Moradi for his great help in validating the content and also Maryam Kamali for her great work in revising this post.
salam man emtiaz bishtar az 400 mikham chikar konam 🙁
Nice article about using these platforms in their right place. However, in my opinion including some tests make this post more practical. Some tests for evaluating performance under various program (like comparing usage of resource and speed for specific project).
best.