Mark - on a related note, does the Android native browser include a
WebChromeClient
implementation in it? I have been trying to run Ajax on those browsers
and I ran into
two issues - first one is same origin policy issue. I found out that
the Webkit package
in Android actually had the cross-origin resource policy implemented
in it since
before Android OS v 1.6 unlike what most people kept stating. However,
whoever
coded it skipped a couple of words in the http authentication header
strings so
unless you use those words it won't work. In any case I can now do
cross-origin
calls with the Android native browser either in Android 1.6 or 2.3,
The second
problem is that I cannot still return the response of the service
calls back to the
browser in the form of Javascript alerts- the Webkit implementation
"swallows" it.
I tried going over the source code but it is getting a bit too
convoluted to follow.

Now I am trying to either use QuickConnect or plain Webviews that
implement
the Http transport aspect of Ajax to be able to send and receive
messages to
remote services and eventually using WebChromeClient implementation to
display
them as javascript alerts ...

Thanks

On Mar 11, 3:46 pm, Mark Murphy <[email protected]> wrote:
> Add a WebChromeClient implementation to your WebView via
> setWebChromeClient(), then override onJSAlert() to do whatever you
> want.
>
> On Fri, Mar 11, 2011 at 5:44 AM, Kapil <[email protected]> wrote:
> > Hi All,
> >         In my application I am using WebView and in that I am using
> > javascript alert( ) method but its not working, no pop-up appears.
>
> > in my manifest file I have added
> >    <uses-permission android:name="android.permission.INTERNET"></uses-
> > permission>
>
> > and in activity file I have added
> >        mWebView = (WebView) findViewById(R.id.webview);
> >        mWebView.getSettings().setJavaScriptEnabled(true);
> >        mWebView.loadUrl("file:///android_asset/demo.html");
>
> > In layout xml file I have added
> > <WebView
> >    android:id="@+id/webview"
> >    android:layout_width="fill_parent"
> >    android:layout_height="fill_parent"
> > />
>
> > Any clue how to enable full Java script in WebView.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training in NYC:http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to