1. Cross Platform App Development Where, What and Do You Need it
8/19/2013 10:45:48 AM
Cross Platform App Development Where, What and Do You Need it
https://news-cdn.moonbeam.co/cross-platform-dude_yvo1vpy5.png
App Developer Magazine
Mobile Tech

Cross Platform App Development Where, What and Do You Need it


Monday, August 19, 2013

Richard Harris Richard Harris

The problem of cross-platform development is as old as computer programming itself. Cross-platform software can be divided into two types. One requires individual building or compilation for each platform that it supports, and the other can be directly run on any platform without special preparation, e.g. software written just once in an interpreted language for which the interpreters or run-time packages are common. 
In mobile, cross-platform sounds like the "cure all" to device fragmentation but in reality it means "danger ahead" due to the confusion on what cross-platform really implies when talking about an app. 

Having said that, let me state for the record that there isn't any such thing in mobile development as writing an app just once, and have it magically work on any device anywhere, with the exception of an HTML5 app running in a web browser. 

There are more universal languages to write mobile apps when compared to native – but in the end, you still have to compile those apps into a binary that will run on each platform including iOS, Android, BlackBerry, Windows, Tizen, etc. if you want the app to exist in their respective app stores. Furthermore, each platform still requires its own rules governed by the OS the app will be running under. That creates limitations and restrictions for every single cross-platform IDE or language out there today. 

Okay, so then what about HTML5 apps? The buzz around HTML5 is the language is more browser interpreted than OS interpreted which means when you write the software it would technically run on any browser (mobile or desktop) the same way everywhere. But not all browsers will read your HTML5 code the same even though HTML5 is more universal than other languages and it also comes with it's own set of restrictions. Things such as native device functionally that are not entirely available to the HTML5 interpreter since they are deemed more client side markup and have restrictions when it comes to accessing anything outside of the web layer because of security that must exist between any OS and a web browser. You can use the Phonegap library to help with this in some situations but it's restricted as well and can't give you full access to everything native. 

But couldn't you just put the HTML5 in a "wrapper" and deliver it all by itself outside of a web browser or UIWebview? Sure – that's been tried (not quite embedded HTML5) but Flash and Action Script does just that but it's not well suited for cross-platform mobile apps, especially since iOS won't allow any Flash, anywhere, ever! 

How to Solve the Problem 
Unfortunately, you can't. Crossplatform mobile app development will always be a thorn in our side as long as there is more than one device people use. It's imminent that more devices, more platforms, and more languages are going to come into the mix which will further complicate things. 

The good news is that there are some cutting edge solutions that WILL make your life easier when it comes to developing cross-platform. I'm going to list out the big players, what languages they use, how they work, and on what platforms they can be deployed. 

Corona is one of the most popular cross platform SDK out there. It uses LUA as a backend language with a plethora of APIs to utilize that translate to every facet of mobile hardware. You can compile for iOS, Android, Amazon Apps, Android Play, Nook, and Kindle. Corona is really big with game developers because of its ease of physics. They also have a really nice simulator to test on every device you can deploy (handy for scaling issues). 

Titanium is another big player, you write mostly in the Java language and there are a host of APIs available to you to talk back to the hardware layers. You can deploy on iOS, Android, and initial Blackberry support has been implemented, plus Windows Phone is coming soon. 

GameSalad is mostly HTML "drag and drop" based and is designed to be in the hands of non-programmer types for creating mobile games, though it can also get extremely complex as well. You can publish for iPhone, iPad, Android, Kindle, Nook, Windows 8 and Mac desktop. Keep in mind – this is a gaming platform so much of the hardware layer between your game and device will be absent (GPS, camera, etc.) 

Marmalade offers three basic flavors of cross-platform languages. You can code natively using C++, use HTML based language, or even use LUA through their "Marmalade Quick" solution. Regardless of which language you choose, you can deploy to iOS, Android, Windows Phone 8, BlackBerry, Windows and Mac, as well as selected Smart TVs. 

Appery.io is HTML and Java based that lets you build enterprise class applications and compile them. It has an online IDE you use to actually create your apps. It's not intended to do complex gaming apps, but if cross-platform business/ utility apps are your thing Tiggzi might be it. They also support PhoneGap libraries for native device access. 

PhoneGap is now owned by Adobe and lets you build for mobile devices using JavaScript, HTML5 and CSS3. It's mostly written just like you would any webapp, but there are some really nice bridge layers they have in place that let you access most of the device core functions such as accelerometer, network, native alerts, geo location, camera, and more. You can deploy to iOS, Android, Windows, BB, WebOS, and more. 

SnAPPii is a cloud based developing platform that has some powerful features like drag and drop UI, live testing, and other visual editor controls that let you create an app in no time. You can publish directly from the interface "submitter" to iOS, Android, HTML5, and other Enterprise stores. When you build an app, it builds it in the native language, which is a nice quality in cross-platform development. 

MoSync is an HTML5 and JavaScript SDK for iOS, Android and Windows Phone. It comes with its own IDE, which is handy because along with web code you can write C++ along side it for some really hybrid functionality to get as close to native as possible, but still staying cross-platform. Another nice thing about MoSync is the built-in emulator and Bluetooth testing to device. They also support PhoneGap libraries for native device access as well. 

RhoMobile by Motorola is another HTML based cross-platform solution that is essentially identical to most other HTML based builders. They do have some nice add-ons such as RhoConnect, which lets you plug into some built-in REST API stuff, as well as RhoElements that lets you build a nice interface that will be universal across multiple devices, and RhoStudio that is a nice emulator package. 

Beachfront Builder offers a unique solution for any developer needing to build a video or multimedia based crossplatform app. They have a browser based IDE that lets you plug into existing YouTube (and many other) feeds, customize the app look and feel, and even monetize. Their deployment goes over any HTML based channel, iOS, Android, Windows Phone, and Blackberry. 

A final one not really ready for prime time yet, but worth a mention is famo.us which is a really nice GPU HTML5 based solution that looks to have great promise as it relates to universal runtimes that have a small code footprint backend. It's still in closed beta, but when it releases to the developer community I think we'll see an awakening on what is possible in HTML based apps. 

Each given solution has their strengths and weaknesses, but also have a unique way of getting things accomplished, so you need to fully investigate the capabilities of each before deciding. To me cross platform development starts and ends with the tools you can use to target as many devices and platforms as possible, with the smallest amount of effort between them. 

The Great Divide
Many years ago when web development was gaining traction as a replacement for compiled software code a friend suggested to me that one day the web would be the perfect platform for delivering software because of its universal viewing capability – the web browser. No matter where you were in the building, all you had to do was pull up a web browser, regardless of the machine, and the software written over HTML would appear identical. I didn't think much about it at the time but fast forward 10 years and start delivering apps across a myriad of mobile devices and that truth starts to ring more true. 

There has been a battle brewing for a long time over native vs. HTML5. It's really a moot point to me because it's clear HTML5 is more universal but constraining when it comes to device function access, whereas native code is more drilled down to the specific platform of the device but gives you full control over device functions. That is where it's been for a couple of years and I don't see it going anywhere anytime soon because hardware manufacturers are going to continue to push the envelope of what is available in a device and unless someone comes along and builds a universal layer between them, HTML5 will always be a step behind – a small step, but a step none-the-less. 

Support
Developing an app is a journey. Rarely do you just sit down and start hammering out the code without hitting a support forum, a web search, or experimenting with code samples. Having said that, when you tie in cross-platform development into the mix and you are trying to hit a target of multiple devices, it's good to have some people in the trenches with you that are holding the same weapon and are taking the same journey, so they can offer up advice and support for you when those inventible "gotcha" moments occur during development. 

With that in mind, you need to remember that not all cross-platform solutions have the same following of people as others, and you might wind up in a tough spot if you can't find easy answers to your code problems. Make sure before selecting a tool to use that you can "do with it what your intentions are," especially with any HTML based environment. 

Wrapping It Up
Targeting as many devices and platforms as possible might seem like exactly what you want to do at first when building an app because the potential marketing exposure can be greater. While this might be true, it's also worth noting that not all apps need to be built for all platforms and you might waste precious time attempting it. 

App marketing 101 says to first learn the audience you are building the app for, and then decide on which platforms you want to deploy. For example, if 95% of your intended audience uses an iPad, then why would you spend time building other versions of your app? Cross-platform development is supposed to save you time when you need to target more than one platform, but it will cost you time in the long run if you are supporting platforms where your app is seldom downloaded and you might be able to support your app better if it were built natively or targeted on fewer platforms. 

After all, even if you can build for all of those platforms and app stores, often publishing an app in them seems more futile than building the app itself. 


Subscribe to App Developer Magazine

Become a subscriber of App Developer Magazine for just $5.99 a month and take advantage of all these perks.

MEMBERS GET ACCESS TO

  • - Exclusive content from leaders in the industry
  • - Q&A articles from industry leaders
  • - Tips and tricks from the most successful developers weekly
  • - Monthly issues, including all 90+ back-issues since 2012
  • - Event discounts and early-bird signups
  • - Gain insight from top achievers in the app store
  • - Learn what tools to use, what SDK's to use, and more

    Subscribe here