[android-developers] Re: WebView request monitoring

2010-12-10 Thread Neilz
Thanks Mark.

I notice this call works when I use loadData() but not when I use
loadUrl(). In this case, it never gets called.

I've searched a number of posts with people asking this, but haven't
found a solution. Any ideas?

On Dec 10, 1:24 pm, Mark Murphy mmur...@commonsware.com wrote:
 WebViewClient and shouldOverrideUrlLoading().



 On Fri, Dec 10, 2010 at 7:31 AM, Neilz neilhorn...@gmail.com wrote:
  Hi all.

  I open up an Activity with a WebView, and load up a URL which allows
  the user to fill in a form, going through a series of pages.

  I need to monitor the requests, to look at what stage of the process
  they're at, then act at a certain point.

  How can I get hold of the requests made by the WebView please?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  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 App Developer Books:http://commonsware.com/books

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


Re: [android-developers] Re: WebView request monitoring

2010-12-10 Thread Mark Murphy
On Fri, Dec 10, 2010 at 9:28 AM, Neilz neilhorn...@gmail.com wrote:
 I notice this call works when I use loadData() but not when I use
 loadUrl(). In this case, it never gets called.

It does not get called for the initial URL. I suppose they assume that
if you are telling Android to load the URL, you don't need to be
notified about it again.

But it most certainly gets called for any normal links you click on. I
just tested this to confirm.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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


[android-developers] Re: WebView request monitoring

2010-12-10 Thread Neilz
Hmm. You're right, of course, at least for some normal URL.

But it doesn't work for mine. The URL I'm using is https... would that
make a difference?

On Dec 10, 2:42 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Fri, Dec 10, 2010 at 9:28 AM, Neilz neilhorn...@gmail.com wrote:
  I notice this call works when I use loadData() but not when I use
  loadUrl(). In this case, it never gets called.

 It does not get called for the initial URL. I suppose they assume that
 if you are telling Android to load the URL, you don't need to be
 notified about it again.

 But it most certainly gets called for any normal links you click on. I
 just tested this to confirm.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android App Developer Books:http://commonsware.com/books

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


Re: [android-developers] Re: WebView request monitoring

2010-12-10 Thread Mark Murphy
On Fri, Dec 10, 2010 at 9:57 AM, Neilz neilhorn...@gmail.com wrote:
 Hmm. You're right, of course, at least for some normal URL.

 But it doesn't work for mine. The URL I'm using is https... would that
 make a difference?

Conceivably. I haven't tried that combination.

Also, I think shouldOverrideUrlLoading() only works for GET requests.
POSTing a form may not trigger it. I seem to recall running into the a
loong time ago, so I do not know if things changed since then.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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


[android-developers] Re: WebView request monitoring

2010-12-10 Thread Neilz
Ah... that would be it then. This form is definitely posting data.

Sooo... where do I go from here!

On Dec 10, 3:08 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Fri, Dec 10, 2010 at 9:57 AM, Neilz neilhorn...@gmail.com wrote:
  Hmm. You're right, of course, at least for some normal URL.

  But it doesn't work for mine. The URL I'm using is https... would that
  make a difference?

 Conceivably. I haven't tried that combination.

 Also, I think shouldOverrideUrlLoading() only works for GET requests.
 POSTing a form may not trigger it. I seem to recall running into the a
 loong time ago, so I do not know if things changed since then.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android App Developer Books:http://commonsware.com/books

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


Re: [android-developers] Re: WebView request monitoring

2010-12-10 Thread Mark Murphy
On Fri, Dec 10, 2010 at 10:20 AM, Neilz neilhorn...@gmail.com wrote:
 Ah... that would be it then. This form is definitely posting data.

 Sooo... where do I go from here!

If you have control over the Web content, you could use
addJavascriptInterface() and arrange for communications that way. Note
that addJavascriptInterface() is broken in the 2.3 emulator, though
apparently not on the Nexus S.

Or, switch to using GET on your forms.

Beyond that, I have no ideas off the top o' my head.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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


[android-developers] Re: WebView request monitoring

2010-12-10 Thread Neilz
No, unfortunately I have no control over the web content. Hmm!

On Dec 10, 3:25 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Fri, Dec 10, 2010 at 10:20 AM, Neilz neilhorn...@gmail.com wrote:
  Ah... that would be it then. This form is definitely posting data.

  Sooo... where do I go from here!

 If you have control over the Web content, you could use
 addJavascriptInterface() and arrange for communications that way. Note
 that addJavascriptInterface() is broken in the 2.3 emulator, though
 apparently not on the Nexus S.

 Or, switch to using GET on your forms.

 Beyond that, I have no ideas off the top o' my head.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android App Developer Books:http://commonsware.com/books

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