android - 最近火起来的h5app是否已经能够完美转化原生控件?
迷茫
迷茫 2017-04-17 17:29:25
0
15
1221

最近发现很多H5app的框架,如react-native,wex5,phoneGap等。开发者只要写html5+js+css就可以了,网页端打开无可厚非,而打包成android客户端,iOS客户端的时候,上面的按钮文字等界面,用的是网页加载的还是全部转化成原生的控件呢?如iOS的UIView UIbutton

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(15)
Peter_Zhu
  1. Most frameworks (such as PhoneGap) do not convert html5 into native controls, but use native
    webview to load html, which is the same as opening a browser to browse the web. In this way, cross-platform is achieved. But these frameworks also provide the ability for js to call native code, so that business logic developed in front-end languages ​​can access some of the system's native functions (power, positioning, etc.). Building in this way is a hybrid application. In terms of UI, simple layouts and spaces are developed using HTML5, and complex layouts and controls are developed using native language. The framework provides the ability to instantiate controls developed in native language and add them to the application layout, so The hybrid method is flexible and low-cost.

  2. Since the performance of browsers in rendering HTML pages is still not comparable to native, frameworks like react-native use native controls directly, but the description of the controls is based on the framework's custom js syntax rather than html5, because html5 is converted into native controls. It is too complicated (html standards are very complicated), and most frameworks are designed to be cross-platform (android ios). Conversion must be done for each platform. What is the difference between this and developing a web browser?

阿神

So none of you have ever written fuse native binding html objc

大家讲道理

Currently, the smoothness of HTML5 on mobile devices is not as smooth as some of the original controls.
It is a better choice to combine the two to develop an app.
Use the source API for commonly used and fixed content, and use HTML5 for content that is not commonly used or has a high page update frequency to improve development efficiency and data update timeliness.

黄舟

First of all, h5app doesn’t know whether your understanding is that web pages are nested in the app. =. =! Actually it's not all like this.
For example, ReactJS Navite actually uses a "curve to save the country" method. After you write the JS code, you still have to parse it into native code.

黄舟

At least react-native is converted to native components
See the link -- Hello React Native paragraph

Ty80

At least APICloud still uses some of the underlying things of Android and iOS through native. Some interface things can also be implemented using js, but they are not as flexible as the original ones

小葫芦

At least there is still a difference in experience, but it is also related to the level of developers. I feel like there will be great progress in half a year. Still very optimistic about this aspect

伊谢尔伦

It depends on what type of App it is. If it is just an ordinary news client and does not seek to call any system functions, it is enough to directly set a WebView in the App to access the WAP station, and remember the password and automatically log in locally.

小葫芦

Currently, h5 cannot replace native development. Hybrid development may be a better choice, which can combine the advantages of both.

刘奇

It seems impossible to use h5 to replace Yuansheng in the past few years. At least I can say that there are many limitations. It is not cocos or unity that makes games so popular with h5. I know there are many applications, but among the applications that do not burn money, games make the most money. Large companies have no shortage of Android and iOS engineers
, but small companies still have no problem building an information publishing application

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template