Write Once, Run Everywhere
As mobile OSes grow and shrink, sprout and vanish, the pressing question remains. How do you choose which mobile development platform to focus, and which ones you should omit / put on hold ?
Well, there’s still no answer for this question, but the bright side is that, if you actually don’t want to choose a single platform / target OS, you can develop for all of them. Using the same code (in theory).
This whole “Write Once, Run Everywhere” (AKA W.O.R.A) is neither new, or perfect but it’s definitely on it’s best moment with the HTML 5 hype.
Web Application vs Native App
When it comes to targeting mobile market, there are three and only three options, as we will see now each one of them has it’s own place and level of capabilities.
Web Applications (aka WebApps) are basically mobile version of websites, which are not platform-specific. Sites that got scaled / redesigned to fit the small screens of the handsets that we all have in our pockets. As this is only a remodeled site, it must be accessed through a browser, rendering an HTML/CSS/Script bundle. Because of today’s security patterns, each browser will have a “sandbox” that prevents any code from reading/writing directly from/to your device. Since your WebApp runs on top of a sandbox it will not be capable of accessing any feature of the phone/tablet itself, and this is the biggest limitation of the WebApps, since this will generally lead to a much “less immersive” experience for the user.
Native Applications, on the other hand, are platform specific, meaning that if you want it to work an specific platform/OS, you will have to code it in the target’s platform language (Objective-C for iOS, Java for Android, C# for Windows Phone), which is called Native Code. If you want to target multiple platforms, you will have to write the same application on each one of the languages in order to be able to distribute it to the target OSes. Well, the bright side is that, because you are so close to the OS itself, you have access to every feature the phone has to offer you, be it camera, geolocation/geofencing or receiving calls/sms, for instance.
According to the dictionary, Hybrids are : anything derived from heterogeneous sources, or composed of elements of different or incongruous kinds. What the dictionary does not say is that, generally, the result is not better than any of the sides, and it’s usually worse than both.
Here are some of the Frameworks that works this way:
Non Web Frameworks
As we have covered before, the “Web Hybrids” cannot access all the hardware features the phone may have to offer. Say, for example, you need hardware acceleration or a specific GPU command for a game, the Web Hybrids will not be able to access them, but there is someone who can.
When it comes to non-web frameworks, you can still find some W.O.R.A solutions for mobile, and i will try to cover them really quick. The reason behind those tools is the same : Write your app using a single programming language, and compile/deploy it to multiple platforms using the same code. Of course you will still have to build different UI’s most of the cases, but the “core” code still reusable on multiple platforms once it’s compiled correctly.
Most of those frameworks are focused into mobile game development, anyways, lets see what we have available.
One of the players of this market is the Corona SDK. The language used here is Lua programming language, and it’s main focus is building games, but you can still build anything from business, to education apps and even Ebooks.
Recently Ansca Mobile announced that a free version of Corona would be released, so you can use it without paying a dime for it, with it’s own limitations of course. The Pro version is priced at 599 USD per year and the Enterprise one ranges from 999 USD per year to 2.499 USD per year.
No matter which licence you acquire, you can always compile your code to iOS, Android, Nook (Barnes and Noble) and Kindle. Unfortunately, no Windows Phone here.
There’s no way to mention cross-platform gaming development without mentioning Unity 3D Framework. Unity is, no doubt about it, the biggest player in this market, mainly because it is a Game Engine with a built-in IDE. Using the Unity 3D allows you to compile your code to basically any platform available out there, including XBOX, PS3, Wii-U, Web (using unity web player), Android, iOS, Windows Phone, Linux, Windows and OSX.
There are free licence options for Android and iOS, with their own limitations but the Pro one is 1500 USD per platform (one time fee). It may also worths noting that there is an “Assets Store” on their site, meaning that you can buy sprites, logos, 3D scenarios and characters for your game from their store, created and maintained by it’s own developers community. Kudos to Unity.
Moai SDK is a relatively new player, competing directly with the Corona SDK, targeting iOS, Android and Chrome as possible outputs and also using LUA as the main programming language for writing the apps, but the main difference is that, this guy is Open Source.
The prices range from Free, to up to 499 USD per Month, depending on your scale. Seems like it’s only possible to build games using it, which automatically puts it behind Corona since both of them have a free licence option.
The last competitor from today’s list is Mono Touch, from Xamarin. In my opinion, this is hands down the best framework for building non-game apps. Mono is a very robust framework, using C# as it’s input language and allowing you to deploy either to iOS and Android (but since the code must be written in C#, you can basically copy and paste the code and use it to build a Windows Phone version of your app).
For deploying to Android, you will need a Windows PC. As for iOS, you will need a MAC. This is the only downside of the framework, but the reason for this limitation is that it uses XCODE integration as it’s IDE for iOS. That’s right, you can use your beloved XCODE to code using C#, and even the Interface Builder will work just as you expect.
For the Android version, you can either use it’s own IDE (Xamarin Studio) or, if you want to pay for it, Visual Studio. The same integration is found here, allowing you to code into the best C# IDE out there.
The prices start from Free (but trust me, you don’t want this. This is basically a joke since you can’t build apps with more than 120kb, which is ridiculously small), to 1899 USD. The cheapest licence allowing visual studio integration is priced at 999 USD. Every price is bound to one Platform, so multiply it by 2 if you want to target two platforms.
The post was long, i know, but i’ve been willing to write about it for two weeks, and there was no way i could make it smaller without ommiting content.
If you have managed to reach this section, it means that you know now that there are lots of options for you to build your app using cross-platform deploying technology, be it Web Based or Close to Native.
I hope this helps someone, someday.