Android Javascript:android and JavaScript call each other

Source: Internet
Author: User
Tags html page interface

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

Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.