The following section describes how Android and JavaScript are called each other, so our UI interface is much simpler to design, and the UI is designed to be cross-platform. There are a lot of web app foreground frames, such as Sencha and jquery mobile. Believe in the future with the development of web apps, we can also use HTML to design the same beautiful interface as the local application. Although these are beautiful, but now there are many drawbacks, such as the call than the local framework is much slower, because the mobile phone is a limited device, so the processing and response are relatively slow, expect a greater development in the future. Ha ha!
Nonsense not much to say, below to write a Webviewdemo implementation of Android and JavaScript to call each other.
Let's take a look at what controls Main.xml uses:
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
android:orientation= "Vertical" >
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:text= "@string/hello"/>
Android:id= "@+id/webview"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
/>
Android:id= "@+id/button"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:text= "Invoke JavaScript"
/>
And then give us our demo.html page.
insert Title here Www.cxybl.com
name |
Telephone |
Xiao Ming |
123 |
Xiao Wang |
456 |
html raw data
this article link http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20130110/35823.html