Can HTML5 replace local programs in mobile development

Source: Internet
Author: User

As mobile devices become more advanced and support for HTML5 is becoming more and more high, when we move into the mobile world, we encounter the problem of choosing HTML5 and native (native programs written in native code). The prospect of HTML5 is undoubtedly tempting, and a "Write once, run anywhere" can kill everything in seconds. In the last two years, the author has a more in-depth study on HTML5 and native, and it is not only the two-way choice, but also the comprehensive selection according to the situation of the enterprise, the composition of the team, the strategy of the company and the characteristics of the product.

HTML5 development Prospects I am undoubtedly very optimistic, the major companies also spared no effort to promote, the current mainstream of the three major smart computer operating systems iOS, Android and Windows Phone have supported most of the HTML5 features. The arms race for mobile devices hardware also clears the HTML5 of hardware barriers. According to the current pace of development, I judged that within three years or even faster, mobile device running HTML5 will be completely free of pressure, whether it is standard or hardware. Now the mainstream of the smart machine has been configured dual-core processor (previously clerical error browser) and 1G and above the memory, this year again out of the smart machine without this configuration you are embarrassed to publish.

Talk about HTML5

1.HTML5 allows you to get rid of the reliance on the platform, the user opens the browser, directly can access your application, without having to go through a variety of store audit.

2. Real-time update, usually the platform audit will take seven business days or so, what if you find the problem after publishing? There is no such problem with Web mode.

3.Write once, run anywhere?

This is the dream of many programmers, but also used to be the heart of Java, but the people who have really done cross-platform solutions know that this is just a slogan, cross-platform is not so easy to play around. Yes, HTML5 can implement write once, run anywhere, but we can't always write a Hello world to run anywhere. Different platforms have their own characteristics, different platform users have their own operating habits, if you want to please everyone, it means you can not please anyone.

4. Reduce development effort or make development easier?

For the boss, this is a very tempting topic, because the reduced workload means more money, no bosses don't like to do more with less money. And now a very big problem is that mobile device developers, especially iOS developers are very difficult to find, because the technology is good to do their own applications, people can earn a monthly salary of tens of thousands or more, why to enter your company? How to say also their own business, have unlimited possibilities, can also fully enjoy freedom. But if you can make the most of HTML5, then we can recruit web front-end developers to build mobile apps, so there's no problem with hiring. Because in many people's eyes, html5/css/javascript are not much technical content of things, really can not find people, find some interns learn to learn also will.

But the question is, will the workload really be reduced? Is the technology threshold really that low? The answer is no!.

I've spent half a year developing a HTML5-based mobile framework to emulate native applications, so that HTML5 apps look as if they look like local apps, note: it's like. This is a bit like jtouch, but unlike the native program, it can interact well with native resources, and so on. But the final result is not so satisfactory, such as HTML5 in the animation switch, sometimes there are some inexplicable problems, of course, you can tell me to turn off the animation effect, but it seems very rigid, and finally I have to close some animation. and write the program with objective-c not so much, a few simple code can achieve cool animation, with HTML5 need more code, and even can not achieve.

and HTML5 development on mobile devices has very high requirements for developers, not the general web front-end people can solve, usually have such technology talent, salary level is not much lower than the native developers. This can be a lot easier if you're just going to develop a website on a mobile device, but if you want to emulate a native app and have a high level of efficiency and an elegant user experience, it's a technical one. Do not underestimate the Web development language of JavaScript, usually my view is that the simpler the language will reflect the level of technical staff, especially planning and design capabilities.

5. Other issues, resource invocation restrictions, such as JavaScript running in iOS can not exceed 15 seconds limit, cannot call local hardware devices (such as cameras, etc.), cannot use the push service and so on.

How to choose?

If so, do we not choose HTML5? I said earlier: "In accordance with the company's own situation, the composition of the team, the company's strategy and product characteristics to comprehensive choice", I recently in the HTML5 discussion on the microblog also said: "HTML5 is a strategic direction, Facebook and Google have been laid out and Google Mobile's experience on the iphone is comparable to native. Basically native+web apps can kill most apps in seconds, and a separate Web app is a good way to go if you don't want to be constrained by the various stores. For game classes and applications that are heavily dependent on the hardware environment, they can only be native ". There is only such a problem, but HTML5 is a trend, in the next 3-5 years, HTML5 will replace a lot of local applications, but as we have been talking about the B/s architecture years ago, the same as the C/s framework, which requires a process.

Usually between HTML and Native, we have three options--HTML5, Native app, and HTML5+NATIVE,HTML5 are all web-only mobile apps, users need to open a browser and enter the URL of the app to access. Native refers to applications that are based on specific platform development. NATIVE+HTML5 is actually a shell-and-wrap approach that encapsulates HTML5 with the browser, but this is invisible to the user, and the user has no sense of any foreign matter, and the app downloaded from the store is no different.

Personally, I am a more respected html5+native, this shell-like way, you can enjoy the double benefits of native and HTML5, but the disadvantage is the high technical content requirements. Of course, what I'm referring to here is not simply to encapsulate HTML5 into a browser, native and HTML5 will have a lot of interaction, in fact it's a bit like a hybrid drive, we even enjoy the fast SSD, but we want to get the cost-effective mechanical hard drive. I think in 5-10 years, this will be a good solution, when HTML5 and hardware development to a certain level, we then completely turn to HTML5 cost will be very low.

How to do?

Assuming that there is a project that is less critical to the local environment, such as microblogging clients, various social cuisines and even lbs applications, we can use html5+native. , we can encapsulate the core code-core layer, which is independent of the platform, primarily the business logic and the interaction with the shell, and the code is written in the Web language. On the core layer, we create different UIs based on different mobile platforms. Finally, we put the above two layers into the shell of each platform, the shell is mainly by the browser to complete the work, of course, also includes some hardware operations and read local resources, such as GPS, gravity sensor, camera calls, maps, push notifications or IAP.

We can deploy the Web upgrade to the server, after the user runs the app, the app will be to the server to get the latest Web program and download run, so that you can skip the various store update audit, to achieve the purpose of rapid update. And if users do not have access to the Internet, we can let users use the previous version of the program, will not be like a pure web app that requires users must be networked

Benefits

1. Users can use offline

2. Update download volume and less, can update all, you can also choose to replace some files

3. The code is safe and secure, it is well known that Web applications have a big problem is the problem of code security, but now we can all encrypt the web code, the local application decryption and then run, greatly provides the security of the code.

4. You can use the browser as an intermediary to make full use of the benefits of native, such as using GPS, camera, local photo albums, reading local contacts, can also use push function, and most importantly, some of the web can not be implemented by the function, we could use native to achieve.

5. Cross-platform, most of the core code is not rewritten, JavaScript code used well, in many places can be used, including mobile applications, mobile sites, PC sites, a variety of browser plug-ins, and even can be used in WebKit encapsulation as a cross-platform application. Admittedly, this approach is not entirely cross-platform, but it is also enough to reduce the workload, especially for later maintenance. and completely cross-platform is meaningless, different platforms have their own style, in order to better user experience, the interface layer needs to be targeted development.

Harm

I think the biggest disadvantage is the technical difficulty, if it is just a simple browser package a few HTML files, it is not technically difficult, but if you want to build a system-level things, it is very technical difficulty. This requires someone to understand the browser features of three mainstream platforms, proficient in the development of native programs, to be proficient in html5/css3/javascript, and most importantly, to have strong architectural design capabilities.

If we want to find another disadvantage, it is not enough to meet all the needs, it can not replace native, but I think he can replace the large part of the native.
This article turns from: H5 Newang code Please add a link description www.yasewl.com

Is it for us?

First of all, from the perspective of the product, whether your product is heavily dependent on the local environment, such as image processing and gorgeous games and so on. The second consideration is the composition of your technical team, if your team has a cow who can solve these problems, and there are some qingtong web front-end people, then I think you can consider this way. Technology selection is very important, slightly careless, endless. The third is to consider your company's strategy, on the future development of HTML5, willing to pay the price of the mobile Internet, whether willing to do forward-looking things, whether willing to invest more resources upfront, whether to allow trial and error and so on.

Can HTML5 replace local programs in mobile development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.