• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps What are your thoughts on cross-platform Android and iOS development?

badlogic

Lurker
I'm the guy behind libGDX (http://libgdx.badlogicgames.com) and am currently also working on RoboVM (http://www.robovm.com) which allows you to run Java/Scala/Kotlin/... on iOS. Just like with libGDX, my main concern with RoboVM is to make cross-platform app development for Android and iOS easier for people coming from a Java/JVM/Android background. We want to get input from the broader Android developer community to help us shape the future of RoboVM. It would mean a lot to us, a team of 4 devs, if you find the time to comment on the below blurb.

A lot of people here are working in app shops that probably create apps for customers or themselves that need to work on both iOS and Android. Some may only focus on Android but may wish to expand to iOS.

There are a few frameworks/platforms out there that can help with sharing code between both Android and iOS (C#, Java, JS, Ruby, pick your poison).

Some of these frameworks/platforms allow you to share business logic and use the native UI APIs on each platform. This means you'll have to write the UI for each platform separately. The UX will most likely be better, but at the expense of more development time. Let's call this the "native UI" solution.

Some frameworks allow you to share both the business logic and the UI code. A cross-platform UI API either wraps the native UI API (lowest common denominator between the two platforms), or it uses something like a webview, emulating the native UI. The UX will most likely be worse, but development time can be reduced. Let's call this the "cross-platform UI" solution.

I'd be super happy if you have any input on the following questions
1. Do you think cross-platform development is viable at all? Why/Why not?
2. Would you rather use the "native UI" solution or the "cross-platform UI" solution? Why?

Our focus with RoboVM at the moment is on the "native UI" solution and making the code-sharing of the business logic as easy as possible. Once this is complete, we also want to offer a "crossplatform UI" solution. We are currently evaluating different approaches:

1. JavaFX. That's already alpha quality, there's a whole community around it and we enable them to work on iOS. But it isn't the most natively looking & feeling option. It also carries the Swing heritage with it.
2. Webview. Quite flexible but shares all the same problems that Phonegap et. al. have (performance, look & feel).
3. Custom cross-platform UI. Gives us the most freedom. Maps a common API on top of native UI APIs, so the look & feel is native. Might be a leaky abstraction though.

I do have my preferences regarding the above 3 options, but i'd really love to get input from you folks on that.

Thanks for your time, really appreciate it.

Ciao,
Mario
 
Hi Mario,
I've been intimately involved in cross platform development done in several different ways:

1) Google Earth - shared C++ code base, QT for user interface (works similarly to JavaFX). This ran on Windows, OS X, Linux, Android, iOS and some other unusual platforms including Solaris at one time. To this day it's the most cross platform product at Google.
2) Picasa - used WINE for support on Linux
3) Startups - several investments in startups using PhoneGap and similar systems

Regardless of what system you use, it's incredibly important to have a strong engineering culture, automated builds and automated testing. Without that, it's too easy to descend in to development chaos where developers on one platform break the other. For Google Earth, we would have scores of those builds running simultaneously to catch problems early. I'd say that 95%+ of the time, we were build successful on all platforms simultaneously.

I think it comes to a spectrum of choices, where you're making different trade offs between skills, strength of engineering, UX and speed.

JavaFX - this may well be the best option if you're coming from an enterprise background and are already familiar with the tools. I'd consider this where you need to build a larger number of applications, build them at speed and didn't care as much about UX quality. So think of this as the "long tail" but limited functionality apps.

Webview - this works better for people coming from a web world. Think of RoR systems and lots of UI that you want to be cross platform between the web and mobile. You might already have a good mobile site and want to make it more performant and offline.

My personal preference is for shared business logic and then native UI on each platform. It takes the most disciplined engineering culture but produces the best results. In the case of Google Earth, though we used QT, we ended up doing a lot of customization to make the interface more Mac like. That ended up being a pain fighting through the layers of abstraction of Qt. So perhaps a wrapper can work but it needs to be minimal friction and up-to-date with the native UI.
 
Cross platform development is a great idea. Coming from the Java world, this is my preferred language and development environment. It would be great if I could write my code once and deploy it on multiple platforms.
Separating out the UI part of the application is a good approach, but yes it does require discipline, and a good system architecture. All too often I have seen code which does not have this, and business logic pollutes the UI layer. It's therefore harder to separate out, and develop for alternative platforms. I think that is probably the biggest problem, particularly for legacy systems which have suffered feature creep and code bloat.
I think a cross platform common UI API sounds nice, but might be quite difficult to achieve.
 
Hi Mario,
Based on our own experience of developing cross-platform mobile apps using Cordova/Phonegap, we would recommend you to quit the idea. Native solutions give you the possibility to use each platform's potential to the full, keep the code clean and avoid unnecessary workarounds. Native applications work faster and smoother.
 
Hi Mario,

I've already released two libGDX powered games, both Android and iOS and the third is already in development. I totally love libGDX and it's approach to cross platform development. Thank you!

For non-game apps however, I prefer the native UI solution, simply because it enables the highest degree of flexibility. It would however be nice if some common tasks could be handled in a cross platform manner. The robopods would be an elegant solution for this. A robopod could, for example, provide a cross platform access that's striped down to the lowest common denominator. And if the underlying (iOS/Android) classes are exposed, it would not even sacrifice flexibility...
I think that would be quite a good compromise between flexibility and comfort, while keeping the RoboVM class library clean.
Just my two cents,
Thanks again.
 
Back
Top Bottom