HTML5 vs Native App : Which to choose ?? [closed]

戏子无情 提交于 2019-12-20 10:46:26

问题


This question is quite popular, and there are already lot of questions pertaining to it. But some of them are old (like 6 months back), and for the current date - May 2012 ... it will be awesome if you can type out which one is better as of now !

I am working on some apps right now, and cross-platform functionality is a major deal here. I would like to know if I can use HTML5 for the following features.

  1. Creating a music player in my app (will need to read all playlists and play them) - HTML5 (or) Native ?

  2. Accelerometer usage - HTML5 (or) Native ?

  3. Camera usage - HTML5 (or) Native ?

  4. Using gestures (swype, etc..) - HTML5 (or) Native ?

  5. Multi-touch capabilities & gestures - HTML5 (or) Native ?

  6. Developing 3D game (or) 2.5D with physics - HTML5 (or) Native ? (Native might be the best deal here, but I am curios to know how HTML5 would do in multi-platform game dev)

If you can number the options with the correct answer, and give a reason as to why I would have to use native / html5, that would be awesome :)


Also, what are your thoughts on Phone-Gap for native support ?


回答1:


Creating a music player in my app - Both. HTML5 might be tedious.

Accelerometer usage - Native. Html5 won't support it

Camera usage - Native. Html5 won't support it

Using gestures - Native. Html5 can support it, but you'll have to use an external library

Multi-touch capabilities & gestures - I'd say native, for the ease of development

Developing 3D game (or) 2.5D with physics - Both, some great libraries are now available for both systems. However doing what you want in HTML5 is probably not easy at the moment.

More generally, HTML5 gives you the possibility to write you code once for every system and then wonder if it'll work in the same way everywhere. Native apps require a specific development for each platform, with the costs and the problems of maintaining many softwares at different stages of maturity that it leads.

However if you don't need specific features, go for HTML5. It's still a bit tedious to write code on it so far, but the quality and the amount of available libraries is increasing every day. Use CoffeeScript, it'll save you headaches.

If your application is designed with responsive design in mind, you'll also be able to support computers, tablets and smartphones in one application.




回答2:


Unless your app is extremely simple then avoid the so-called cross-platform solutions and build native for each platform. If you do, you will be glad.

If you don't then you will be very sorry when something breaks on some devices but not others, or when you get a request to add certain capabilities that some devices won't support.

Basically using a cross-platform solution is lowest common denominator / only suitable for simple apps / false economy in my experience.

Just my humble opinion based upon 12+ years of commercial software development and experience of trying both approaches myself.



来源:https://stackoverflow.com/questions/10648459/html5-vs-native-app-which-to-choose

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!