[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
It's been a long time since I've been active on it, but I believe you can 
intercept everything that passes through a url, both what would be loaded 
by navigation, image, and ajax.  Give it a try and implement all the 
callbacks exposed by webview, log a simple message, and see how it goes.

Doug

On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is trying 
 to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Krystian Lewandowski
Hi Doug,
I mean, I can get the page and there is onLoadResource I missed last time, 
but another question is - even if I get a resource, how to inject it? 
Callbacks, in this case, serve kind of notification purpose there is no way 
to replace loaded resource (whatever it actually is) or inject custom 
loader instead. At least at the moment I don't see a solution.

Thank you for ideas,
Krystian

W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you can 
 intercept everything that passes through a url, both what would be loaded 
 by navigation, image, and ajax.  Give it a try and implement all the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
through old code of mine that suggests it will work.  Also, you should try 
searching for WebViewClient shouldInterceptRequest to see what places 
like StackOverflow say.

Doug

On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski wrote:

 Hi Doug,
 I mean, I can get the page and there is onLoadResource I missed last time, 
 but another question is - even if I get a resource, how to inject it? 
 Callbacks, in this case, serve kind of notification purpose there is no way 
 to replace loaded resource (whatever it actually is) or inject custom 
 loader instead. At least at the moment I don't see a solution.

 Thank you for ideas,
 Krystian

 W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you can 
 intercept everything that passes through a url, both what would be loaded 
 by navigation, image, and ajax.  Give it a try and implement all the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done 
 with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Krystian Lewandowski
Hi,
the problem is that it is possible to get HTML skeleton (or whatever it is, 
because we do not control remote side) via specific route with additional 
implementation in shouldInterceptRequest. It is possible to inject loaded 
the content via WebView.loadDataWithBaseURL, but that's it. The question is 
how to inject additional resources to WebView?

Thank you,
Krystian

W dniu niedziela, 14 grudnia 2014 22:33:36 UTC+1 użytkownik Doug napisał:

 Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
 through old code of mine that suggests it will work.  Also, you should try 
 searching for WebViewClient shouldInterceptRequest to see what places 
 like StackOverflow say.

 Doug

 On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski wrote:

 Hi Doug,
 I mean, I can get the page and there is onLoadResource I missed last 
 time, but another question is - even if I get a resource, how to inject it? 
 Callbacks, in this case, serve kind of notification purpose there is no way 
 to replace loaded resource (whatever it actually is) or inject custom 
 loader instead. At least at the moment I don't see a solution.

 Thank you for ideas,
 Krystian

 W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you 
 can intercept everything that passes through a url, both what would be 
 loaded by navigation, image, and ajax.  Give it a try and implement all the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done 
 with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-14 Thread Doug
OK, that's very different than what you first asked.

You will have to write shim to connect your app and the webview.  The page 
hosting the webview will have to provide a function to call that makes the 
necessary adjustments.  Then on the app side you call loadUrl with a 
javascript url to call that function with whatever parameters it needs.

Google android webview inject javascript for more details.  (Google 
answers most of your questions if you just ask it.)

Doug

On Sunday, December 14, 2014 1:45:46 PM UTC-8, Krystian Lewandowski wrote:

 Hi,
 the problem is that it is possible to get HTML skeleton (or whatever it 
 is, because we do not control remote side) via specific route with 
 additional implementation in shouldInterceptRequest. It is possible to 
 inject loaded the content via WebView.loadDataWithBaseURL, but that's it. 
 The question is how to inject additional resources to WebView?

 Thank you,
 Krystian

 W dniu niedziela, 14 grudnia 2014 22:33:36 UTC+1 użytkownik Doug napisał:

 Did you actually try WebViewClient.shouldInterceptRequest?  I'm looking 
 through old code of mine that suggests it will work.  Also, you should try 
 searching for WebViewClient shouldInterceptRequest to see what places 
 like StackOverflow say.

 Doug

 On Sunday, December 14, 2014 10:39:21 AM UTC-8, Krystian Lewandowski 
 wrote:

 Hi Doug,
 I mean, I can get the page and there is onLoadResource I missed last 
 time, but another question is - even if I get a resource, how to inject it? 
 Callbacks, in this case, serve kind of notification purpose there is no way 
 to replace loaded resource (whatever it actually is) or inject custom 
 loader instead. At least at the moment I don't see a solution.

 Thank you for ideas,
 Krystian

 W dniu niedziela, 14 grudnia 2014 18:30:15 UTC+1 użytkownik Doug napisał:

 It's been a long time since I've been active on it, but I believe you 
 can intercept everything that passes through a url, both what would be 
 loaded by navigation, image, and ajax.  Give it a try and implement all 
 the 
 callbacks exposed by webview, log a simple message, and see how it goes.

 Doug

 On Saturday, December 13, 2014 1:53:56 PM UTC-8, Krystian Lewandowski 
 wrote:

 Thank you for the idea. Though, I don't think it will work. What about 
 AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
 called for these.

 Krystian

 W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is 
 trying to fetch and fetch it yourself using whatever API suits your 
 needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski 
 wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to 
 ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done 
 with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would 
 support changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-13 Thread Doug
You could use a WebViewClient to intercept everything a WebView is trying 
to fetch and fetch it yourself using whatever API suits your needs.

Doug

On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost implementation 
 from deprecated one to ConnectivityManager.requestNetwork introduced in 
 Lollipop. It supports Sockets, SocketFactories, URLConnections - this is 
 fine. The only thing missing at the moment is WebView support. 
 Application's requirement is to route WebView.loadUrl requests via specific 
 interface, but I can't see how it could be done with the new API (I can't 
 use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would support 
 changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian


-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: WebView and ConnectivityManager.requestNetwork

2014-12-13 Thread Krystian Lewandowski
Thank you for the idea. Though, I don't think it will work. What about 
AJAX, objects, images requests? I assume shouldInterceptRequest isn't 
called for these.

Krystian

W dniu sobota, 13 grudnia 2014 22:14:33 UTC+1 użytkownik Doug napisał:

 You could use a WebViewClient to intercept everything a WebView is trying 
 to fetch and fetch it yourself using whatever API suits your needs.

 Doug

 On Friday, December 12, 2014 12:15:35 PM UTC-8, Krystian Lewandowski wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost 
 implementation from deprecated one to ConnectivityManager.requestNetwork 
 introduced in Lollipop. It supports Sockets, SocketFactories, 
 URLConnections - this is fine. The only thing missing at the moment is 
 WebView support. Application's requirement is to route WebView.loadUrl 
 requests via specific interface, but I can't see how it could be done with 
 the new API (I can't use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would support 
 changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian



-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.