Banyan Tree under the website itself is not many technical staff, so the task of app development to the parent company Grand Literature side. Shanda Literature Wireless Business Center is responsible for this specific development task.
As always, the development situation is: Time is tight, the task is heavy, the manpower is few
Technology Selection In order to launch the Android and iOS platforms at the same time, I chose hybrid this native and HTML5 hybrid way. The advantage of native is relatively high efficiency, but the disadvantage is that the development speed is relatively slow, not conducive to self-updating; HTML5 's advantage is the development speed, can realize self-updating, cross-platform, the shortcomings are obvious, inefficient, slow loading speed;
- Use native to solve the efficiency problem, mainly used to switch the interface frame, picture browser components, etc.
- Use HTML5 to solve the development time problem, mainly used for page layout, rendering
Background Server API provides a unified JSON data format for native and HTML5 seamless use, the server can no longer care about whether the client is HTML or native,html can be changed to native Client and server communication data Exchange Unified use JSON, If necessary native can be replaced with HTML5, or HTML5 can be replaced native
the HTML5 part of hybrid My responsibility is HTML5 this part, is actually the Web page, the layman now sees the cool page or other effect the page to think this is HTML5. Well, it's called HTML5.
Javascript1, Zepto.js used for basic DOM operation and Ajax selection using custom zepto.js, custom zepto.js reason is that I have been accustomed to deferred this writing, so need to use the deferred module. For specific custom methods please refer to Https://github.com/madrobby/zepto 2, arttemplate.js for template rendering, simple syntax, high efficiency. Https://github.com/aui/artTemplate 3, cloudary.js the entire Project Web-side framework, why is called cloudary, in fact, the name after several changes, and finally used the grand literature of the website domain name Www.cloudary.com.cn as to why the word cloudary, well, who knows how it was set up in the English word of this combination. Its role:
- Package, bridge JS and native communication, provide unified operation interface to the business layer
- Encapsulates the Ajax method provided by Zepto.js, the main function is to cache the interface data for unified error handling
- The framework layer's business processing after the page initialization is complete
- Provides a global general operating method or interface, such as: System information, storage operations, etc.
4, the business logic of each page itself is written directly on the page, because the code is not much
CSSWrite CSS with sass a few months ago also wrote a sass library, called Sasshat, Project address: Https://github.com/willian12345/sasshat app Sasshat after the implementation of some web interface effects such as: The following is a Web-enabled animated launch page with the benefits of sass:
- Write CSS Faster
- Adaptable to frequent needs changes (-_-!)
- Faster, pure CSS for cool animations
- More sexy
It's time to talk about shortcomings.
1, load slow first entry page more slowly, the higher the complexity of the page, the more resources required, load resources slow, render dom slow. On the mobile side especially, with the lower end of the mobile phone, the performance of the more severe 2, low-end mobile phone CSS3 support varying sometimes have to give up some good CSS properties, and change the other implementation of the scheme. Because some android2.x phones really lag behind. Have to remove some effects for these phones or special judgment after the use of ordinary pictures instead of the effect 3, cross-platform is beautiful web is indeed cross-platform, but WebView browser CSS compatibility than the browser in the mobile phone is more bad. So to achieve full compatibility is only the goal. It takes less time and effort than using native, so why not choose a more appropriate native?
the last to say
(App is not officially released yet.) Still in beta) no picture no true image. I still like to use my own writing in my present company. Although there are a lot of mobile web frameworks available, but which one to choose, or to use, or according to their own project environment: staffing, technical level, Company B. For web developers, developing hybrid-style apps depends on the level of native developers or familiarity with webview knowledge. For the general technician, the Web is not native, and native also do not understand the web ======================================
Reprint Office Please specify: Blog Park ( in the pool, Wang Yidou) [email protected]
"Under the Banyan tree • That year" mobile app (hybrid) Development summary