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.