How to Use android studio to create the first android program to load html5 pages (1) and androidhtml5

Source: Internet
Author: User

How to Use android studio to create the first android program to load html5 pages (1) and androidhtml5

Preface

Software Version:Android studio v1.0 official version, because the software has been changing a lot since v0.x, many problem search solutions are also in the v0.x version era, so first declare the version.

Motivation:As we need to conduct a comparative study on several methods of software development on mobile terminals in our work, we have produced this article, and it is estimated that there will be other technical solutions published in the future.

Objectives:To meet cross-platform requirements, it is an alternative technical path to compile pages with html5 and load html5 pages with webview. This article uses android studio to create an apk program and load compiled html5 pages to quickly generate cross-platform programs.

Body

  • 1. Create an android Project

Specify the project name and Path

2. Load a remote page

Here is an example of opening a Baidu page.

Open the MainActivity. java page and modify the oncreate function.

3. Open the local page

Bytes

Create an assets Directory to store html pages. Right-click app-> new-> folder-> assetsfolder

4. Publish an apk

  • Follow the steps shown in the figure to perform step-by-step operations.
  • 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.