Live data from Hacker News

Ask HN: Best way to write an app for both Android and iOS?

news.ycombinator.com

11–20 of 54 posts

Re: Ask HN: Best way to write an app for both Android and iOS?

#11
Depending on what you need your application to do, I would definitely go down the web app + PhoneGap route.

It's extremely easy to develop and test the app in a webkit browser, and then in the relevant phone simulators, and PhoneGap will very very easily wrap your web app into a native application - it also provides extra JavaScript APIs to access some hardware features, like the camera and geolocation and so on.

You can use any of the existing common mobile web app frameworks (I actually wrote about my experiences with several of them just last weekend: http://semantici.st/archives/223:ios-webapp-frameworks-round...), or do something entirely custom. You can certainly get a 'native enough' UI experience on iOS - I've not tried Android yet.

However, if you're planning to do anything that's really performance-limited this approach won't work. The performance is exactly as you'd get in a normal mobile web app, and if you're expecting to do, say, gaming or perhaps something complicated using the camera (like 'Layar' or 'Word Lens' type AR), you'll need to be writing native code.

Re: Ask HN: Best way to write an app for both Android and iOS?

#12
post #2

Is there a particular reason why you can't or don't want to write it as a web page instead?

The performance and feel of Google maps inside a WebView is terrible compared to the native maps applications. I recently attempted this and was incredibly disappointed. Decided eventually after fighting with Titanium before trying Phonegap to just do native versions.

Re: Ask HN: Best way to write an app for both Android and iOS?

#13
I have written 7 apps for iPhone, 2 of which also run on Android. These two apps are however, primarily graphics apps, and its quite possible to share C++ code between the two platforms now. The whole GL ES engine is in C++, and for both Android and iPhone I have 'casing' code that provides the outer interface for the 3D engine ..

This is pretty easy to do if you plan it right.

Re: Ask HN: Best way to write an app for both Android and iOS?

#14
I would say use Appcelerator. It generates native apps for iOS and Android, so runs fast and can access all the hardware features, or at least more so than Phonegap can. I'm pretty certain Appcelerator can export to iOS, Android, WebOS, Windows7 and Blackberry (for a fee).

Re: Ask HN: Best way to write an app for both Android and iOS?

#15
Depends on what kind of app I suppose, but if it is anything to do with 2D gaming, I'm totally loving Corona so far.

I come from a web background (php/javascript) and I'm lost on Objective-C. But I picked up the basics of Lua in about a day and the next day had built a simple game. It's wickedly fast to get to grips with and the documentation is detailed and easy to read.

http://www.anscamobile.com/corona/

Re: Ask HN: Best way to write an app for both Android and iOS?

#16
Nothing beats native.

I've tried Appcelerator and you'll get to a point near the end where you've got to do the other 80% of your application and the third party framework is going to fight you till completion, or some state of completion that you're ok with.

One of the problems is that the simplification also requires you to give up your power.

If you're doing a simple application then maybe a third party tool will help you, but in my experience I would rather work slowly and remain sane.

I would consider Appcelerator again if I needed to prototype something very quickly.

Re: Ask HN: Best way to write an app for both Android and iOS?

#17
I created a website for toddlers in HTML5 +JS http://microangels.in . The website works great in safari, firefox & chrome but when I tried to use phonegap the page would not show up. Debugging in phonegap is a pain and I did not find much help in documentation, mailing list or IRC . I ended up using the android webview + Jquery mobile and the app works great I will need to look at the iOS next. So I would say that go with html5 and the native webview and it should be easy to add in the parts that need to be written in Obj-c or java easily instead of trying to figure out the frameworks

Re: Ask HN: Best way to write an app for both Android and iOS?

#20
If you want the best user (and developer) experience, write 2 different codebases and share graphical assets.

Even though you could write portable C++, the API for getting to the hardware is going to be pretty different. I have worked on a project where we developed an app with identical look and feel on both Android and iOS simultaneously. The UI was basically completely custom (designed in Photoshop by a 3rd party).

My biggest advice is to do the Android UI layout IN CODE. The iOS version was completed in about 70% of the time of the Android project mostly because of the slowness of developing the UI with XML/Eclipse and Android's immature layout API.

Post reply on HN