April 4, 2020
Cross Platform Mobile Development (iOS, Android, WP8)

Cross Platform Mobile Development (iOS, Android, WP8)

John: Hey, everyone. John Sonmez from simpleprogrammer.com
and today, I do not have an inspirational video for you. That’s right. I’m going to
be talking about a technical topic, one that, I think, is really important that’s pretty
relevant on a lot of people’s minds today. That’s right. I’m going to be talking cross
platform mobile development, and I’m going to share with you some of my thoughts around
this area and some of the techniques you can use to be successful if you’re trying to
create a mobile application and you want it to be cross platform.
Cross platform mobile development. What does this mean? Basically, hey, let’s say that
you’re trying to build an app, right? What do you do? Your first step is you got to say,
“Well, what am I going to build this for? Am I going to build this for iOS? What about
Android or am I going to touch Windows phone even if it has a small market share? What
am I going to build this for? Am I still going to try and do Blackberry?” I hope not.
Basically for the most part, most developers, most companies considering this choice are
basically choosing between, “Should I do Android or iOS, or I should do this Native
and should I create a web version of this application, or even try to go to the Windows
8 platform for this?” How do you decide? Well, let’s talk about the different options
and I’ll give you an idea of what I think is the best way to go today.
First of all, you have Native. Now, if you go Native here’s the thing. For iOS, you’re
going to be developing an Objective C. You’re going to be using the Cocoa frameworks and
you’re going to be developing on a Mac. For Android, you’re going to be doing Java
and you can develop Mac or Windows, but you’re probably going to be using an emulator. Your
code bases are not going to be shared. This is something really important to consider.
Now when you go Native, you’ll of course have all of the Native UI elements. You’re
able to make an application that feels like an application for that platform. That’s
why a lot of times people choose to go Native. You can hit the 2 biggest markets if you just
did iOS and Android. If you’re doing a paid type of application, if you just hit iOS,
that’s an option that a lot of people start with. It’s just hitting iOS. That sometimes
makes sense. That’s option 1. Option 2 is to do something
in between Native and let’s say full HTML or full cross platform. One option in there
and this is the one that I’d probably recommend the highest is the Xamarin tools. Xamarin
tools let you write an Android and an iOS application in C#. You can use the portable
class libraries in C# to make a lot of your code portable so you could reuse some of that
code. Now, the difference here between Native and Xamarin is small because Xamarin just
sits on top of these Native APIs and it basically just gives you a C# way of writing this code.
There’s a little bit more going on under the cover, but you’re still using the Native
controls. It’s still very much Native at the end even though you’re using this other
layer and this other tooling to do this. Then you can go up from there and there’re a
couple of other things that are in between here. You have things like Titanium. You’ve
got things like PhoneGap where you could actually build a hybrid application. That’s going
more towards this HTML5. We can traverse all the way down the path to HTML5.
You can build an HTML5 application and you could basically host it on your website, and
you can make it work on the mobile platforms. Maybe you could use something like Kendo UI
from Telerik or Sencha Touch. Then what you would have is basically an HTML5 application
that’s responsive and works on the different mobile platforms. If you wanted to make an
installer and application, you could wrap this with something like PhoneGap and then
it would basically just wrap that Native or that HTML5 application.
Those are your choices, and here’s the pros and cons when you’re thinking about this
choice. If you go full Native, you’re probably going to get the closest to that platform’s
experience, but you’re going to need experience and tools, and developers that can write in
those platforms. Writing Objective C, if you’ve never done it before, is not that easy. There’s
a big learning curve there. Even on the Java side and working in Android, there’s a learning
curve there as well. If you do want to touch Windows phone, then that’s a whole another
platform or if you want to go Windows 8, that’s a whole another platform.
If you go the full HTML route, right now I don’t think we’re there yet. I think we’re
going to be there. I think things like Firefox OS are going to drive us forward, and as phones
and tablets become more powerful that we’ll eventually want to go full HTML5 on the mobile
platforms. But we’re not quite there. Right now, the experience is still a little bit
crippled. It’s still a little bit hard to get things to work on each of the devices
that look right, and there’s a little bit of lag. Things are not as fast. They’re
not quite as performing as when you go Native. Now if we take a hybrid approach and this
is the one that I recommend right now. For most developers, especially the ones that
are watching this video because I know a lot of you are probably C# and .NET guys, you
probably are going to be doing best by doing Xamarin. Because the thing about Xamarin and
the reason why I like it so much is that you can write one language, C# and then you can
basically use portable class libraries to share a lot of your code. If you use something
like MvvmCross, MvvmCross is basically another library that works with Xamarin, it can allow
you to use up to 90 or more percent of your code, where the only thing that’s different
between the different platforms is just the views.
I definitely would lean towards the Xamarin route. You still have to learn the Native
APIs so you’re still going to have to learn iOS development and Android development, and
Windows phone or Windows 8 development, but you’re going to be able to share a lot of
the code. You’re going to be able to basically write in one programming language instead
of trying to spread it out and trying to learn all these different programming languages
and not be able to share any code. Then you’re not going to have the problems that you do
with HTML5. That’s my advice for now. I think in the
future it’s going to change. Like I said, I think we’re going to go more into HTML5.
I think that’s going to become more of a viable option. Right now, I would stick with
either going Native or using something like Xamarin, and possibly using something like
Titanium where you are writing JavaScript code that ends up getting compiled down to
Native. Of the two, of Titanium and Xamarin, right now my bet is on the Xamarin side. There
are a lot of great things coming from Xamarin. I’m not plugging. I’m not affiliated with
Xamarin in any way. I am an insider on their program, but I don’t get paid to promote
them. I just happen to like the tools. If you like this video, if you thought this was
useful don’t forget to subscribe to my channel. Check out my blog at simpleprogrammer.com.
I also have some videos on Pluralsight, not just on Xamarin but I have some videos on
iOS, on Android development natively. I have Xamarin videos on how to develop with Xamarin
and then I have videos on Titanium, and even Firefox OS. A whole bunch of different mobile
things in cross platform development there, so don’t forget to check that out as well.
I hope this was useful to you. Take care, have a nice day and I will talk to you again
next week.

21 thoughts on “Cross Platform Mobile Development (iOS, Android, WP8)

  1. If i go with xamarin way don't i need to learn different markup languages for different platform to create view??

  2. if you are going for full html5, I don't think we require all these titanium, or senchatouch, or jquery mobile, but you can write simple html5 to get things done, and it will be much more faster if we go from scratch

  3. Hi John, I would like to let you know that there is another option to go multi platform in mobile. With Delphi or C++ Builder from Embarcadero. It compiles natively for IOS or Android from the same source code written in Object Pascal or C++. I think it would be great to have it in Pluralsight!

  4. I echo Rafael Ribas Aguilo – I'm writing an app that needs to be iOS, Android and possible Windows and Mac, and I'm using XE5 (upgrading next week to XE6) which is Delphi from Embarcadero. It seemed, in my research, to be the most seamless and easiest way to accomplish that.

    I'm not affiliated with Embarcadero in any way, but I did start with Delphi back before 1.0 came out and fell in love with it over VB. Stuck with it until version 6 and never upgraded beyond that and got out of programming for many years and am now getting back into it with this app development.

  5. What do you think about C++ Qt framework for cross-platform (Android / iOS / WP8 / Blackberry / Mac / Windows / Linux) ?

  6. How come you did not mention C++?
    You can do this in Visual Studio 2013 using C++ for coding the model, introducing a platform independent view model and a platform dependent view. You will need wrappers here like C++ CLI and JNI. Microsoft Office and Dropbox apps are written using this approach. They discussed it at CppCon.

  7. Great video! Thank you. Just wondering what would be your recommendation today. I have build a web app on AngularJS and I want to build the mobile app version of my application. Do you still recommend going the Xamarin route? What about reactJS. Any comments, I appreciated, thanks!

  8. you know what. I could learn most of what i need for java in 15 minutes and learning java with building robots with my teacher too ,so I think I should just hit swift and tackle that big monster once I get my mac book pro this Wednesday while getting introduced and learn java tomorrow night. I am almost done with learn on the basics of python and hopefully can get the advanced stuff done tomorrow morning .

  9. When native, how the different platforms share data, each other?
    For ex. if we want android studio for android, and xcode for iOS, how they share same features? they just code in totally different databases, with different features? Don't they need to share data?

Leave a Reply

Your email address will not be published. Required fields are marked *