I am starting a project in Xamarin. As of now it will be Android only but later I am planning to port it to iOS. Should I start with Xamarin.forms (that will require me to buy an Indie license) or should I first finish up android application and later port it to iOS ?
-
Also what's the rough idea on percentage of code base that can be shared in between iOS and Android apps ? – Priyanshu Nov 24 '15 at 14:53
-
You need an Indie license even without using Xamarin.Forms. It's almost impossible to build a *real* app with the starter edition. Take a look here to prepare your decision about using Xamarin.Forms: http://stackoverflow.com/questions/32204807/when-to-use-xamarin-forms-vs-xamarin-native – Wosi Nov 24 '15 at 16:09
-
1This question is primarily opinion based and I have marked it for closure. Instead of asking such a question, maybe invest some time and try out different things first? Then you have some facts to back up your question. – Cheesebaron Nov 25 '15 at 09:17
-
@Cheesebaron : I have already tried other things like phonegap, ionic framework, cocos2d-x ,etc for development. Only after that I am here to ask some thing about Xamarin to save my time prior starting my work. And yes this is opinion based and I wanted suggestions on the same. :) – Priyanshu Nov 26 '15 at 06:27
2 Answers
It depends...
The best way - extract logic to the crosplatform PCL project. Then create 2 solutions for ios and android where you will make UI part + our crosplatform logic. In any way using Xamarin.forms it's good desicion only for small simple projects, in my opinion in most cases native UI code it's the better solution

- 1,537
- 10
- 12
-
Yes I agree but I can't go native. I don't have any experience on Java, plus I hate it too :( and I need to save time in development so that iOS app gets developed easier and faster. However PCL sounds like a good choice, so should I go with PCL rather than forms ? – Priyanshu Nov 24 '15 at 15:20
-
2
Xamarin.Forms is no silver bullet and I would not recommend it for all apps. Maybe, I would even not recommend it for most apps. As mentioned in my comment to your opening question, the answer is primarily opinion based.
To me, Xamarin.Forms is a nice tool to create simple proof of concept apps, also a way of creating prototype apps. However, as soon as you need to do something more complicated. Like, very custom UI or something that inherently is difficult to do on all the supported platforms. Then, you will have to battle the framework and write code for all platforms anyways. So using Xamarin.Forms, at least in my opinion, really depends on the application you are making.
Now, I am super biased towards MvvmCross and the likes, but in any case you should strive to cram in as much logic and behavior into a shared base. For this I usually use the MVVM pattern inside of a PCL. So all my ViewModels, classes for fetching data, behavior etc. goes inside of that PCL. All views go into the platform specific Application project. So in the end the platform specific project will in best cases only contain UI + some platform specific services such as how to access sensors etc.
There are several MVVM framworks for Xamarin apps. Some of them are MvvmCross, MvvmLight, ReactiveUI and MugenMVVM.
Which approach you take is entirely up to you. However, before you commit to something, consider trying out various things to get a feel for it yourself.

- 24,131
- 15
- 66
- 118