Michael DeSimone | 3 Feb 03:50 2012
Picon

A network error occurred

Hello,

When I use the following to navigate to another page, I receive the
network error occurred:

navigator.app.loadUrl(file:///android_asset/www/pageB.html?
st=12&ut=15);

Only happens when I use Android ICS.  All other version I don't get
the error.

Error:
Unknown chromium error: -6
DroidGap: GapViewClient.onReceivedError: Error code=-1 Description= A
network error occurred.  URL=file:///android_asset/www/pageB.html?
st=12&ut=15

Michael DeSimone | 3 Feb 04:47 2012
Picon

Re: A network error occurred

Hello,

So, the issue is with the URL parameters.  Without passing URL
parameters, I can load the page.  Is URL Parameters not allowed
anymore?

On Feb 2, 9:50 pm, Michael DeSimone <michaelhdesim...@...>
wrote:
> Hello,
>
> When I use the following to navigate to another page, I receive the
> network error occurred:
>
> navigator.app.loadUrl(file:///android_asset/www/pageB.html?
> st=12&ut=15);
>
> Only happens when I use Android ICS.  All other version I don't get
> the error.
>
> Error:
> Unknown chromium error: -6
> DroidGap: GapViewClient.onReceivedError: Error code=-1 Description= A
> network error occurred.  URL=file:///android_asset/www/pageB.html?
> st=12&ut=15

--

-- 
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap@...
To unsubscribe from this group, send email to
(Continue reading)

Simon MacDonald | 3 Feb 13:11 2012
Picon

Re: Re: A network error occurred

Go star the issue on Google and hopefully they will get around to fixing it.

http://code.google.com/p/android/issues/detail?id=17535

Our own Joe Bowser has submitted a patch to Google on this.

Simon Mac Donald
http://hi.im/simonmacdonald

On Thu, Feb 2, 2012 at 10:47 PM, Michael DeSimone
<michaelhdesimone@...> wrote:
> Hello,
>
> So, the issue is with the URL parameters.  Without passing URL
> parameters, I can load the page.  Is URL Parameters not allowed
> anymore?
>
> On Feb 2, 9:50 pm, Michael DeSimone <michaelhdesim...@...>
> wrote:
>> Hello,
>>
>> When I use the following to navigate to another page, I receive the
>> network error occurred:
>>
>> navigator.app.loadUrl(file:///android_asset/www/pageB.html?
>> st=12&ut=15);
>>
>> Only happens when I use Android ICS.  All other version I don't get
>> the error.
>>
(Continue reading)

fanboyphonegap | 9 Apr 00:10 2012
Picon

Re: Re: A network error occurred

What is the current workaround for this issue?

On Friday, February 3, 2012 4:11:16 AM UTC-8, Simon wrote:

Go star the issue on Google and hopefully they will get around to fixing it.

http://code.google.com/p/android/issues/detail?id=17535

Our own Joe Bowser has submitted a patch to Google on this.

Simon Mac Donald
http://hi.im/simonmacdonald

On Thu, Feb 2, 2012 at 10:47 PM, Michael DeSimone
<michaelhdesimone-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello,
>
> So, the issue is with the URL parameters.  Without passing URL
> parameters, I can load the page.  Is URL Parameters not allowed
> anymore?
>
> On Feb 2, 9:50 pm, Michael DeSimone <michaelhdesim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>> Hello,
>>
>> When I use the following to navigate to another page, I receive the
>> network error occurred:
>>
>> navigator.app.loadUrl(file:///android_asset/www/pageB.html?
>> st=12&ut=15);
>>
>> Only happens when I use Android ICS.  All other version I don't get
>> the error.
>>
>> Error:
>> Unknown chromium error: -6
>> DroidGap: GapViewClient.onReceivedError: Error code=-1 Description= A
>> network error occurred.  URL=file:///android_asset/www/pageB.html?
>> st=12&ut=15
>
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> To unsubscribe from this group, send email to
> phonegap+unsubscribe <at> googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
Ramesh Ponnuru | 5 May 08:21 2012

Re: A network error occurred

fanboyphonegap <ysongfinance <at> ...> writes:

> 
> 
> What is the current workaround for this issue?On Friday, February 3, 2012 
4:11:16 AM UTC-8, Simon wrote:
> Go star the issue on Google and hopefully they will get around to fixing 
it.http://code.google.com/p/android/issues/detail?id=17535
> Our own Joe Bowser has submitted a patch to Google on this.
> Simon Mac Donaldhttp://hi.im/simonmacdonald
> 
> On Thu, Feb 2, 2012 at 10:47 PM, Michael DeSimone<michaelhdesimone-
Re5JQEeQqe8AvxtiuMwx3w@...> wrote:> Hello,>> So, the issue
is with 
the URL parameters.  Without passing URL> parameters, I can load the page.  Is 
URL Parameters not allowed> anymore?>> On Feb 2, 9:50 pm, Michael DeSimone 
<michaelhdesim...@...>> wrote:>> Hello,>>>> 
When I use the following to navigate to another page, I receive the>> network 
error occurred:>>>> navigator.app.loadUrl(file:///android_asset/www/pageB.html?
>> st=12&ut=15);>>>> Only happens when I use Android ICS.  All other version I 
don't get>> the error.>>>> Error:>> Unknown chromium error: -6>> DroidGap: 
GapViewClient.onReceivedError: Error code=-1 Description= A>> network error 
occurred.  URL=file:///android_asset/www/pageB.html?>> st=12&ut=15>> --> You 
received this message because you are subscribed to the Google> Groups 
"phonegap" group.> To post to this group, send email to phonegap-
/JYPxA39Uh5TLH3MbocFFw@...> To unsubscribe from this group,
send 
email to> phonegap+unsubscribe <at> googlegroups.com> For more options, visit 
this group at> http://groups.google.com/group/phonegap?hl=en?hl=en>> For more 
info on PhoneGap or to download the code go to www.phonegap.com
> 
> 
> 
> 
> 
> 
> 
> 

Hello,

We have faced a similar issue with Android 4.1 (ICS) when loading html pages 
using urls having parameters.  It does not even accept one single parameter.  Is 
it the way Google Android wants it and pass the url parameters through some 
other elegant mechanism or is it a bug?

Anyone has any workaround to get over this issue till Google patches this up it 
would be a great help.

Rgds,
Ramesh

--

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

For more info on PhoneGap or to download the code go to www.phonegap.com

Kerri Shotts | 6 May 00:08 2012
Picon

Re: A network error occurred

In the meantime, you could use localStorage to pass parameters around. 

On Saturday, May 5, 2012 1:21:42 AM UTC-5, Ramesh Ponnuru wrote:

fanboyphonegap <ysongfinance <at> ...> writes:


>
>
> What is the current workaround for this issue?On Friday, February 3, 2012
4:11:16 AM UTC-8, Simon wrote:
> Go star the issue on Google and hopefully they will get around to fixing
it.http://code.google.com/p/android/issues/detail?id=17535
> Our own Joe Bowser has submitted a patch to Google on this.
> Simon Mac Donaldhttp://hi.im/simonmacdonald
>
> On Thu, Feb 2, 2012 at 10:47 PM, Michael DeSimone<michaelhdesimone-
Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello,>> So, the issue is with
the URL parameters.  Without passing URL> parameters, I can load the page.  Is
URL Parameters not allowed> anymore?>> On Feb 2, 9:50 pm, Michael DeSimone
<michaelhdesim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote:>> Hello,>>>>
When I use the following to navigate to another page, I receive the>> network
error occurred:>>>> navigator.app.loadUrl(file:///android_asset/www/pageB.html?
>> st=12&ut=15);>>>> Only happens when I use Android ICS.  All other version I
don't get>> the error.>>>> Error:>> Unknown chromium error: -6>> DroidGap:
GapViewClient.onReceivedError: Error code=-1 Description= A>> network error
occurred.  URL=file:///android_asset/www/pageB.html?>> st=12&ut=15>> --> You
received this message because you are subscribed to the Google> Groups
"phonegap" group.> To post to this group, send email to phonegap-
/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> To unsubscribe from this group, send
email to> phonegap+unsubscribe <at> googlegroups.com> For more options, visit
this group at> http://groups.google.com/group/phonegap?hl=en?hl=en>> For more
info on PhoneGap or to download the code go to www.phonegap.com
>
>
>
>
>
>
>
>

Hello,

We have faced a similar issue with Android 4.1 (ICS) when loading html pages
using urls having parameters.  It does not even accept one single parameter.  Is
it the way Google Android wants it and pass the url parameters through some
other elegant mechanism or is it a bug?

Anyone has any workaround to get over this issue till Google patches this up it
would be a great help.

Rgds,
Ramesh


--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
Rui Gomes | 17 May 16:54 2012

Re: A network error occurred

For us, localStorage is not a good solution since it requires a lot of re-writing.

The workaround we did was to download phonegap 1.7 source code and change CordovaWebViewClient.java in the method shouldOverrideUrlLoading
from:

            // If our app or file:, then load into a new Cordova webview container by starting a new instance of our activity.
            // Our app continues to run.  When BACK is pressed, our app is redisplayed.
            if (url.startsWith("file://") || url.indexOf(this.ctx.baseUrl) == 0 || ctx.isUrlWhiteListed(url)) {
                this.ctx.loadUrl(url);
            }


to:

            // If our app or file:, then load into a new Cordova webview container by starting a new instance of our activity.
            // Our app continues to run.  When BACK is pressed, our app is redisplayed.
            if (url.startsWith("file://") || url.indexOf(this.ctx.baseUrl) == 0 || ctx.isUrlWhiteListed(url)) {
                if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB)
                {
                    //[RUI] - fix for Honeycomb (3.0) and greater...
                    view.setWebViewClient(new CordovaWebViewClient(this.ctx)
                        {
                            <at> Override
                            public WebResourceResponse shouldInterceptRequest (WebView view, String url){
                                if(url.indexOf("file:///android_asset") == 0 && url.contains("?")){
                                    String filePath = url.substring(22, url.length());
                                    filePath = filePath.substring(0, filePath.indexOf("?"));
                                    try {
                                        InputStream is = ctx.getAssets().open(filePath);
                                        WebResourceResponse wr = new WebResourceResponse("text/html", "Cp1252", is);
                                        return wr;
                                    } catch (IOException e) {
                                        return null;
                                    }
                                }else{
                                    return null;
                                }
                            }
                    });
                }
                this.ctx.loadUrl(url);
            }


Hopefully this will help others with the same problem.

Cheers,
Rui


On Sunday, 6 May 2012 01:08:29 UTC+3, Kerri Shotts wrote:

In the meantime, you could use localStorage to pass parameters around. 


--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
Ah Wirayudha | 14 Apr 14:14 2013
Picon

Re: A network error occurred

mr Rui.. how i can find or download the phonegap source code..???

On Thursday, May 17, 2012 9:54:56 PM UTC+7, Rui Gomes wrote:

For us, localStorage is not a good solution since it requires a lot of re-writing.

The workaround we did was to download phonegap 1.7 source code and change CordovaWebViewClient.java in the method shouldOverrideUrlLoading
from:

            // If our app or file:, then load into a new Cordova webview container by starting a new instance of our activity.
            // Our app continues to run.  When BACK is pressed, our app is redisplayed.
            if (url.startsWith("file://") || url.indexOf(this.ctx.baseUrl) == 0 || ctx.isUrlWhiteListed(url)) {
                this.ctx.loadUrl(url);
            }


to:

            // If our app or file:, then load into a new Cordova webview container by starting a new instance of our activity.
            // Our app continues to run.  When BACK is pressed, our app is redisplayed.
            if (url.startsWith("file://") || url.indexOf(this.ctx.baseUrl) == 0 || ctx.isUrlWhiteListed(url)) {
                if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB)
                {
                    //[RUI] - fix for Honeycomb (3.0) and greater...
                    view.setWebViewClient(new CordovaWebViewClient(this.ctx)
                        {
                            <at> Override
                            public WebResourceResponse shouldInterceptRequest (WebView view, String url){
                                if(url.indexOf("file:///android_asset") == 0 && url.contains("?")){
                                    String filePath = url.substring(22, url.length());
                                    filePath = filePath.substring(0, filePath.indexOf("?"));
                                    try {
                                        InputStream is = ctx.getAssets().open(filePath);
                                        WebResourceResponse wr = new WebResourceResponse("text/html", "Cp1252", is);
                                        return wr;
                                    } catch (IOException e) {
                                        return null;
                                    }
                                }else{
                                    return null;
                                }
                            }
                    });
                }
                this.ctx.loadUrl(url);
            }


Hopefully this will help others with the same problem.

Cheers,
Rui


On Sunday, 6 May 2012 01:08:29 UTC+3, Kerri Shotts wrote:
In the meantime, you could use localStorage to pass parameters around. 


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane