0

i am developing an android app.. in between i want to add mobile jquery..

There is already a jquery project developed by somebody else. i want to call that html page in my activity..

whether i need to create an webview and call that one?? or can i directly call that html page directly form activity?

And one more thing.. how to add the jquery project in to my project, i mean... in which folder can i place that?? please me help out...

here is my xml code

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

<WebView
    android:id="@+id/webView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentRight="true"
    android:layout_centerVertical="true" /> </RelativeLayout>

thanks in advance.

4

1 回答 1

0

您必须将 Jquery-Mobile 页面(+css/scripts)放在assets/www文件夹中。然后您可以webView.loadUrl("file:///android_asset/www/index.html");在任何 WebView 中调用 ,。不要忘记打电话webView.getSettings().setJavaScriptEnabled(true);确保您有INTERNET权限Manifest以防万一。

于 2013-02-09T08:41:33.067 回答