HTML5 Plus Application Overview

Source: Internet
Author: User

HTML5 Plus specification

When you develop mobile apps through HTML5, you'll find that HTML5 has a lot of capabilities. In order to compensate for the shortcomings of HTML5 ability, under the guidance of China, the establishment of www.HTML5Plus.org organization, the introduction of html5+ norms.

html5+ extension of JavaScript object Plus, so that JS can invoke a variety of browsers do not implement or implement poor system capabilities, equipment such as cameras, gyroscopes, file systems, such as uploading and downloading, QR code, MAP, payment, voice input, message push and so on.

Hbuilder's phone native capability calls are divided into 2 levels:

A) ability calls across mobile platforms are in the html5+ specification, such as two-dimensional code, voice input, use

Plus.barcode and Plus.speech. Written once and can be run across platforms.

b) JS Bridge is another innovative technology, via JS can directly adjust the iOS and Android native API, which is no longer cross-platform, such as the iOS Game Center, or create a shortcut on the Android phone desktop. The use of JSB is that var obj= plus.android.import ("Android.content.Intent"), a native object android.content.Intent mapped to a JS object, obj, and then manipulated in JS The method property of the Obj object is available.

html5+ App

Mobile apps developed using html5+ are not mobileweb pages. This is the easiest place for novices to confuse. MobileWeb files are stored on the Web server, while the mobile app's files are stored locally on the phone, and the HTML, JS, and CSS files for the mobile app are packaged in a native installation package such as an IPA or apk to run on the mobile client.

Of course, some pages in these mobile apps can continue to go down the Web from the server side.

So mobile web, when you create a new project in Hbuilder, belongs to the Web project. Do not place it under a mobile App item. Mobile Web projects also cannot be truly machine-linked and packaged.

Give a few examples.

Example 1: A mobile Web project that wants to be packaged into an App.

A) Create a new Web project in Hbuilder and put the mobile Web code in.

b) New mobile App in Hbuilder

c) Locate Manifest.json under the new mobile APP and configure the portal page to be the MobileWeb network address.

d) Then click Release Package to get a mobile APP installation package. In addition to having a shortcut to the AppStore and desktop, there is no other difference from the browser experience.

e) In addition, in fact, mobile Web code can also judge their own operating environment, if the UA contains "Html5plus", you can also write plus object to invoke the native ability.

HTML5 Plus Application Overview

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.