How to package a HTML5 program into an Android app

Source: Internet
Author: User

Problem Analysis:

HTML5 Web site is mainly composed of html+css+js form, need to use the browser to display.

Android needs to use the Java language to develop, for front-end engineers, it is undoubtedly a great increase in difficulty.

A number of packaging tools were then introduced to help us package the elements of our web page into a mobile app, translating the HTML we wrote into the Java language.

Solution:

Recommend a packaging tool that we commonly use: Hbuilder.

This tool not only provides Android app packaging, but also can directly connect to the phone for debugging, with html5+ can achieve a lot of Android native features. For example: Sweep code Two-dimensional code, take pictures, shake a shake and so on.

Specific procedures:

1, the Real machine debugging

After entering the software, the first step is to click "Run", the second step is to click on "Mobile Phone", the third step is to select the connected phone, the example I use an Android simulator to connect. Several of the most commonly used Android analog machines can be connected directly on the market.

By following the steps above, packaging is automatically carried out and the app is installed in a linked phone (simulator), which can be tested with the mobile phone (simulator).

2. Package build android Installation format APK file

Open the software, select Release-to-publish as the native installation package, and the window opens.

Check the Android checkbox, if you use Dcloud public certificate, can be packaged directly, the phone can be installed and used. If you need to upload and publish to a third-party application platform, you need to use your own certificate, self-certificate can use the JRE's own tool to create and manage digital certificates keytool to generate their own certificates, the production process is free.

After checking the Android option, complete the Android package name in the form below, and for uniqueness, you can use the write-back of your own website domain name to add the app names. If you use your own certificate, you will also need to fill out the certificate alias, key password, certificate file.

Once completed, click Package to generate the APK file.

Other precautions:

1, in the development process, do not need to pack, should be more use of the real machine debugging, can save a lot of time.

2, after the development, as far as possible in various versions of the Android machine to do a test, because some Web page style in different versions of the Android version of the effect is slightly different.

3, re-edit the HTML5 website code, some Web features into mobile phone functions, such as page elements <a> tag jump, you should use WebView to complete. Can solve the problem of page switching white screen, but also can improve the efficiency of the website in the mobile phone operation

How to package a HTML5 program into an Android app

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.