The WebView component can be used by embedding HTML5 into the Android mobile app.First, import WebView related libraries and jar files into the Android project.Then, add a WebView element in the XML layout file, get the element in the code, and set its attributes.Next, assign the HTML code to the htmlText attribute of WebView. Before actual operation, you need to determine whether the current APP supports the WebView function.If supported, the following code examples can be used: ``` //Get WebView Object WebView webview = (WebView) findViewById(R.id.webview); //Set web page style webview.getSettings().setJavaScriptEnabled(true); // Enable JavaScript webview.getSettings().setAllowJavaScriptInWebApps(true); // Enable Allow JavaScript Code Execution in Web Pages webview.getSettings().setAllowFileAccess(true); // Enable Allow Reading Local Files //Embed HTML5 code into WebView String html="Test Hello, World!"; webview.loadDataWithBaseURL(null, html, "text/html", null); ``` The above code loads a simple HTML page in WebView and outputs a piece of text in it.When running the APP, users can see the text "Hello, World!". Note that you may encounter cross domain problems when using WebView.When the domain name of the web page is different from that of the APP, cross domain problems will occur.This problem can be solved by adding cross domain allowed attributes in the WebView settings. In addition, if you need to execute JavaScript code in WebView, you need to first obtain the inputText property of WebView and assign it to a string variable.Then you can use this variable to perform some operations. To sum up, it is very simple to embed HTML5 into WebView in Android development.Just judge whether the current APP supports the WebView function, and then set the relevant properties.I wish all developers can successfully embed HTML5 into their own APP.
Use wow.js, which is a plug-in, to add scrolling effect animation to the page. If you write, you can listen to the mouse scrolling event, and use the ANIMATE of JQUERY to write it. It is very simple,
Method of embedding HTML5 into APP: 1. The android webview control loads html5; 2. That is, webview supports html5 based on the webkit kernel; 3. Do custom screen adaptation debugging and testing!