Live data from Hacker News

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

news.ycombinator.com

41–50 of 54 posts

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

#41

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…

Agreed,

PhoneGap + jqtouch (or perhaps jquery mobile as it matures) is an awesome way to get going fast but that last mile can be torture, especially if you're working with an uncompromising customer/designer/etc.

At some point someone is going to throw on the brakes because "x doesn't y like an iPhone app" and then it gets ugly.

I think that you can do some very cool stuff using the "web app in a can" approach and I think it's appropriate for a lot of the typical "corporate"-type apps as long as you can manage expectations and stress the cross-platform angle (which can be almost zero-effort, check out https://build.phonegap.com/faq).

But pistoriusp is right, if you're breaking new ground then time invested in learning the native way is well spent.

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

#42

Ive been going through the same issue and unfortunately there isnt a clear cut answer. Initially i was looking at phonegap, titanium and rhomobile. The problem with them is each has pros and cons and its very confusing to really understand what they are. Theres also fanboys of each which makes it even more difficult to understand what separates each. You can also go the jquery mobile/sencha touch/mobile rails route w…

Actually, as mentioned here already, you don't have to go native if you're writing a game. You can use Corona with great success, or Unity3D if you're going the 3D route.

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

#43

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…

Had the same experience with Appcelerator. Not knowing Objective-C it was a lot easier to get ideas into code quickly for prototyping, but when I ended up having to read all of their source and writing custom modules to get what I wanted done I decided it was not worth it. (Side benefit: this is how I got comfortable w/ Objective-C)

If your app is brochureware or a simple web app port to mobile it probably works well. If you are pushing anywhere on the edges it starts to get difficult.

Organize your application really well and it will be easy to port between the two platforms for any models/libraries you write where the concepts are the same.

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

#44
Shameless but on-topic plug: If you have content that needs to be displayed within both apps you could check out the flexible CMS my startup just created for mobile applications: http://storageroomapp.com.

We are currently testing the system, let me know if I should invite you to the beta.

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

#45

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…

To get an idea how terrible PhoneGap can work in practice, check out the O'Reilly iPad app. The performance just isn't there for some applications.

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

#46

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…

I'm also going the native route and have briefly experimented with PhoneGap, Sencha, Appcelerator.

I recommend you analyze what features you're trying to leverage: camera, GPS, OpenGL ES/Rendering. Also, try and see what code you can reuse to be consistent across both platforms: the AR feature, wi-fi triangulation, and UI (UX will inherently have differences between iOS/Android).

My experiences with the camera include low-level image processing algorithms that 3rd party applications can't really optimize for. This is something from my own codebase that's fairly independent from everything else.

GPS/wi-fi triangulation is tricky because it's more understanding how iOS and Android track your location and maintain state. Whether or not you use a 3rd party application or your own code to parse it is up to you. As with a lot of things, the more you understand, the better decisions you can make ;).

Finally, UI (because I haven't done a lot of Open GL/rendering)... it's a pain to work with across different platforms, so leverage whatever you can to simplify this process. If all you're using 3rd party applications for is to translate iPhone UI to Android UI, go for it.

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

#47
post #45

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…

To get an idea how terrible PhoneGap can work in practice, check out the O'Reilly iPad app. The performance just isn't there for some applications.

Not just the performance. A lot of the UI behavior was just wrong. Scrolling in particular was a disaster. Maybe they were using PhoneGap badly, but still--in a native iOS app it's quite easy to get scrolling to work right, and apparently in PhoneGap it's not.

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

#48

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)…

UI layout in code can be a pain because you can't see what you're doing until you do the compile-install-run which can be 30 seconds. That's a hefty amount of time if you're just tweaking one visual element and need to run through 1-10 possibilities.

Normally I would agree- ALL my iOS apps are done in Interface Builder. But if you add more than 50 PNGs to an Android/Eclipse project, the iteration cycle is well over a minute long compared to a 5 second recompile. That's not counting the slowness of the Android emulator (hardware was faster for debugging for me)

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

#49
post #45

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…

To get an idea how terrible PhoneGap can work in practice, check out the O'Reilly iPad app. The performance just isn't there for some applications.

no idea why you would get downvoted for this, it is clearly just a well stated opinion without flame etc.

However, PhoneGap shouldn't be completely to blame for any one applications performance. If many PhoneGap applications performed poorly, then you could make the case. PhoneGap apps should perform as well as any web-based app on the same device. It is up to the developer to make efficient use of javascript animations, etc. in order to provide the best user experience.

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

#50
post #45

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…

To get an idea how terrible PhoneGap can work in practice, check out the O'Reilly iPad app. The performance just isn't there for some applications.

Remember that PhoneGap really isn't anything more than a thin wrapper around a web app. Performance/usability is going to be heavily influenced by how you write that web app.

I'd be more interested to know what web framework O'Reilly used that was slow, rather than it being PhoneGap per se.

Post reply on HN