iOS / Android cross platform development

AndroidIosCross Platform

Android Problem Overview


I've been playing around with developing Android apps in Java for a while and am starting to get a handle on it. However if I want to on start on an iOS version I need to code everything from scratch - which is, well, undesirable.

I was wondering on what cross platform solutions there are available and how well they work in practice. I've been thinking about web applications - perhaps using jQuery Mobile or Titanium, or Adobe Flash/Flex/Air. I also don't yet have a Mac, which I'll probably have to invest in.

So my Questions :

  1. What cross-platform development environments exist for iOS / Android (and/or other devices)?

  2. What has your experience been with these tools? (this is what I'm really keen to know)

Android Solutions


Solution 1 - Android

Disclaimer: I work for a company, Particle Code, that makes a cross-platform framework. There are a ton of companies in this space. New ones seem to spring up every week. Good news for you: you have a lot of choices.

These frameworks take different approaches, and many of them are fundamentally designed to solve different problems. Some are focused on games, some are focused on apps. I would ask the following questions:

What do you want to write? Enterprise application, personal productivity application, puzzle game, first-person shooter?

What kind of development environment do you prefer? IDE or plain ol' text editor?

Do you have strong feelings about programming languages? Of the frameworks I'm familiar with, you can choose from ActionScript, C++, C#, Java, Lua, and Ruby.

My company is more in the game space, so I haven't played as much with the JavaScript+CSS frameworks like Titanium, PhoneGap, and Sencha. But I can tell you a bit about some of the games-oriented frameworks. Games and rich internet applications are an area where cross-platform frameworks can shine, because these applications tend to place more importance of being visually unique and less on blending in with native UIs. Here are a few frameworks to look for:

  • Unity www.unity3d.com is a 3D games engine. It's really unlike any other development environment I've worked in. You build scenes with 3D models, and define behavior by attaching scripts to objects. You can script in JavaScript, C#, or Boo. If you want to write a 3D physics-based game that will run on iOS, Android, Windows, OS X, or consoles, this is probably the tool for you. You can also write 2D games using 3D assets--a fine example of this is indie game Max and the Magic Marker, a 2D physics-based side-scroller written in Unity. If you don't know it, I recommend checking it out (especially if there are any kids in your household). Max is available for PC, Wii, iOS and Windows Phone 7 (although the latter version is a port, since Unity doesn't support WinPhone). Unity comes with some sample games complete with 3D assets and textures, which really helps getting up to speed with what can be a pretty complicated environment.

  • Corona www.anscamobile.com/corona is a 2D games engine that uses the Lua scripting language and supports iOS and Android. The selling point of Corona is the ability to write physics-based games very quickly in few lines of code, and the large number of Corona-based games in the iOS app store is a testament to its success. The environment is very lean, which will appeal to some people. It comes with a simulator and debugger. You add your text editor of choice, and you have a development environment. The base SDK doesn't include any UI components, like buttons or list boxes, but a CoronaUI add-on is available to subscribers.

  • The Particle SDK www.particlecode.com is a slightly more general cross-platform solution with a background in games. You can write in either Java or ActionScript, using a MVC application model. It includes an Eclipse-based IDE with a WYSIWYG UI editor. We currently support building for Android, iOS, webOS, and Windows Phone 7 devices. You can also output Flash or HTML5 for the web. The framework was originally developed for online multiplayer social games, such as poker and backgammon, and it suits 2D games and apps with complex logic. The framework supports 2D graphics and includes a 2D physics engine.

NB: > Today we announced that Particle Code has been acquired by Appcelerator, makers of the Titanium cross-platform framework. > >... > >As of January 1, 2012, [Particle Code] will no longer officially support the [Particle SDK] platform.

Source

  • The Airplay SDK www.madewithmarmalade.com is a C++ framework that lets you develop in either Visual Studio or Xcode. It supports both 2D and 3D graphics. Airplay targets iOS, Android, Bada, Symbian, webOS, and Windows Mobile 6. They also have an add-on to build AirPlay apps for PSP. My C++ being very rusty, I haven't played with it much, but it looks cool.

In terms of learning curve, I'd say that Unity had the steepest learning curve (for me), Corona was the simplest, and Particle and Airplay are somewhere in between.

Another interesting point is how the frameworks handle different form factors. Corona supports dynamic scaling, which will be familiar to Flash developers. This is very easy to use but means that you end up wasting screen space when going from a 4:3 screen like the iPhone to a 16:9 like the new qHD Android devices. The Particle SDK's UI editor lets you design flexible layouts that scale, but also lets you adjust the layouts for individual screen sizes. This takes a little more time but lets you make the app look custom made for each screen.

Of course, what works for you depends on your individual taste and work style as well as your goals -- so I recommend downloading a couple of these tools and giving them a shot. All of these tools are free to try.

Also, if I could just put in a public service announcement -- most of these tools are in really active development. If you find a framework you like, by all means send feedback and let them know what you like, what you don't like, and features you'd like to see. You have a real opportunity to influence what goes into the next versions of these tools.

Hope this helps.

Solution 2 - Android

MonoTouch and MonoDroid but what will happen to that part of Attachmate now is anybody's guess. Of course even with the mono solutions you're still creating non cross platform views but the idea being the reuse of business logic.

Keep an eye on http://www.xamarin.com/ it will be interesting to see what they come up with.

Solution 3 - Android

My experience with making something very simple in PhoneGap+jQuery Mobile was fine. I was able to do it quickly for iOS. However, it didn't work on my Android phones without making some changes. The project was a very simple app to take pictures and post them to a web site. And at the end of the day it felt "clunky" compared to a true native app.

I don't believe there will ever be easy cross platform development. I think the browser is as close as you will get. By choosing something like PhoneGap I think you are just trading one set of pain points for a different set of pain points.

Solution 4 - Android

In case you do not want to use a full-fledged framework for cross-platform development, take a look at C++ as an option. iOS fully supports using C++ for your application logic via Objective-C++. I don't know how well Android's support for C++ via the NDK is suited for doing your business logic in C++ rather than just some performance-critical code snippets, but in case that use case is well supported, you could give it a try.

This approach of course only makes sense if your application logic constitutes the greatest part of your project, as the user interfaces will have to be written individually for each platform.

As a matter of fact, C++ is the single most widely supported programming language (with the exception of C), and is therefore the core language of most large cross-platform applications.

Solution 5 - Android

Although I've just begun looking at this area of development, I think it comes down to this basic difference: some tools retain the original code, and some port to native...

for instance, PhoneGap just keeps the HTML/CSS/JS code that you write, and wraps it in sufficient iOS code to qualify as an app, whereas Appcelerator delivers you an XCode project...so if you're not familiar with iOS, then that wouldn't really provide any benefit to you over PhoneGap, but if you DO know a bit, that might give you just a bit more ability to tweak the native versions after your larger coding effort.

I haven't used appcelerator myself, but worked on a project a couple weeks ago where one of our team members made an entire iPad app in about 24 hours using it.

And yes, to actually submit to apple, you'll have to get a mac, but if that's not your primary work platform you can go cheap.

Solution 6 - Android

Cappuccino or PhoneGap.

Sometimes though trying to find a shortcut does not save you time or give you a comparable end product.

Solution 7 - Android

If you've ever used LUA, you might try Corona SDK can create apps that run on IOS and Android

https://coronalabs.com/

I've downloaded it and messed around some, I find LUA a very easy to learn scripting language without the usual scripting language hassles/limitations....

Solution 8 - Android

There's also MoSync Mobile SDK

GPL and commercial licensing. There's a good overview of their approach here.

Solution 9 - Android

There is also BatteryTech which we've been using for the past 18 months and have released several games off of it. http://www.batterypoweredgames.com/batterytech

All C++, Android and iOS support, all users get full source. The new v2 includes lua bindings.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlisterView Question on Stackoverflow
Solution 1 - AndroidDocDudeView Answer on Stackoverflow
Solution 2 - AndroidDerek BeattieView Answer on Stackoverflow
Solution 3 - AndroidEvanView Answer on Stackoverflow
Solution 4 - AndroidyeomanView Answer on Stackoverflow
Solution 5 - AndroidRobot WoodsView Answer on Stackoverflow
Solution 6 - AndroidSK9View Answer on Stackoverflow
Solution 7 - AndroidJeffView Answer on Stackoverflow
Solution 8 - AndroidRoger DahlView Answer on Stackoverflow
Solution 9 - AndroidRobView Answer on Stackoverflow