WEX5 Tutorial Web site Android Native mode package

Source: Internet
Author: User

If there is a form of Web site, want to make mobile app, how to use WEX5 to package into apk? For example, Baidu video, I want to package into a self-apk installed on the mobile phone, how to do?

The official offers four packaging models, all of which require a service address, which means a server to serve. I just want to encapsulate the web address, the APK opens and jumps to the Web page, obviously the service address is not required.

What if I load a Web page with the WEX5 page frame component?

After testing, this method is feasible, the problem is, W page is wex5 self-created page, not HTML Document page, will appear video format can not play, no falsh plugin problem.

So how to properly use WEX5 to package a Web site?

The answer is: Android native mode.

Let's take a look at today's results:

Measured: Both video and live broadcast can be played perfectly. If someone uses Max to create a video site, you can pack the website into an apk and download it to the app market. One thing that's super-hard. Just a packaging function, small white with me step by steps to set up, do not need to go from scratch to learn the basics of Android, 10 minutes to fix the site packaging.

Two design ideas:

Native generation using the WEX5 integrated Android SDK.

Three codes and logic

1 Switch to Java view

Select Java View in the title bar window

2 new Android Project

Left blank area right button, new Android application Project

Fill in the project name, the first pinyin capitalization, automatically generate the package name

Default options, create custom app icons icon, page activity, workspace workspace

Icon selection and Style

Page activity Style

Main Page activity and home page layout name

After successful creation, the file directory structure is as follows:

3 Modify Permissions

Android Access portal, starting with the Androidmanifest.xml file, all permissions are configured here.

It is important to note that android:minsdkversion do not set too high, otherwise the lower Android version cannot be installed.

Need to configure network permissions, plus <uses-permission android:name= "Android.permission.INTERNET"/> to the following location

4 Modifying the page title

Hit the res-values-strings.xml, modify it.

5 Add the WebView component to the page to load the Web page.

Locate the WebView in the composite collection and drag to the right view page

Modifying the WebView Property

6 Logic Code

6.1 Open the Java page Mainactivity.java

In the Java file, the system automatically generates OnCreate (create), Oncreateoptionsmenu (lower-left control menu), onoptionsitemselected (3-Point selection menu in the upper-right corner). OnCreate method must have, others can be removed.

Define a WebView in the OnCreate side. The method in the note is that the page does not have a webview container to jump directly, the jump page test will have a search bar. This problem is not present in this example with WebView.

6.2 Get WebView to the image and set the relevant parameters.

6.3 Taking over the physical return key

Quad Build APK Package

1 Project right-click to export exported Android application

Project selection

2 Create KeyStore, if already created, use existing KeyStore

3 alias settings, if available, direct use existing key

4 Choose the build apk name and storage path, finish to see the generated apk, install the test.

Five Project Import

1 Select Android esistion android Code into Workspace

2 root driectory, after selecting the root directory, select project in all the project lists in the directory, import

Vi. Summary

1 wex5 Packaging Web simple and convenient, need some Android native basic knowledge

2 from the Java view, WEX5 can work like Eclipse, create Android,web, servers, and more, as shown in. The benefit is that the system configuration and SDK are omitted, and the package installation

WEX5 Tutorial Web site Android Native mode package

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.