Apache Cordova
  1. Apache Cordova
  2. CB-246

A blank web browser window is opened on a first interaction with a Sencha Touch 2 app on a Galaxy Tab 2 with Android 3.2

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      Sencha Touch 2 app wrapped in PhoneGap 1.4.1, Galaxy Tab running Android 3.2

      Description

      Please find all the details of the problem and my investigation in the following blog post: http://www.wardnus.com/2012/02/sencha-touch-2-phonegap-blank-web.html

        Activity

        Hide
        Joe Bowser added a comment -

        Calling about:blank causes the CallbackServer to be properly disposed of. However, I'd be more concerned about why onDestroy() was called during the activity's launch, since this suggests that there is something else happening with this issue.

        Show
        Joe Bowser added a comment - Calling about:blank causes the CallbackServer to be properly disposed of. However, I'd be more concerned about why onDestroy() was called during the activity's launch, since this suggests that there is something else happening with this issue.
        Hide
        Alexander Kolesnikov added a comment -

        WebViewClient prevents it from doing anything useful. And I wouldn't say it is minor as it is pretty much able to destroy a presentation.

        Show
        Alexander Kolesnikov added a comment - WebViewClient prevents it from doing anything useful. And I wouldn't say it is minor as it is pretty much able to destroy a presentation.
        Hide
        Anis Kadri added a comment -

        Alexander,

        Can you provide us with a barebone exmaple reproducing this issue ?

        I am puzzled on why onDestroy would get called when you first launch the app.

        Thanks

        Anis

        Show
        Anis Kadri added a comment - Alexander, Can you provide us with a barebone exmaple reproducing this issue ? I am puzzled on why onDestroy would get called when you first launch the app. Thanks Anis
        Hide
        Alexander Kolesnikov added a comment -

        I will try to put something together on Monday. However when I was looking around the forums, I've noticed that quite a few people are struggling with this issue in one or another way - I mean the blank page opening in an external browser.

        Another puzzling thing is why after calling onDestroy() the app continues to work just fine.

        Show
        Alexander Kolesnikov added a comment - I will try to put something together on Monday. However when I was looking around the forums, I've noticed that quite a few people are struggling with this issue in one or another way - I mean the blank page opening in an external browser. Another puzzling thing is why after calling onDestroy() the app continues to work just fine.
        Hide
        Alexander Kolesnikov added a comment -

        But could you please add that 'else if (url.startsWith("about:"))' to 'shouldOverrideUrlLoading()' in the next release? It does make sense, doesn't it? Otherwise JS unload won't work as expected. And this would allow us to use a proper JAR rather than a self-patched one.

        Show
        Alexander Kolesnikov added a comment - But could you please add that 'else if (url.startsWith("about:"))' to 'shouldOverrideUrlLoading()' in the next release? It does make sense, doesn't it? Otherwise JS unload won't work as expected. And this would allow us to use a proper JAR rather than a self-patched one.
        Hide
        Billy nab added a comment -

        I have validated that this happens on Android 3.2.1 and PhoneGap 1.4.1 applications as well following the original post's guidance.

        Seems to not happen on Android 4.0.3 devices as the same app does not display the issue, nor on previous 2.3 Android versions.

        Show
        Billy nab added a comment - I have validated that this happens on Android 3.2.1 and PhoneGap 1.4.1 applications as well following the original post's guidance. Seems to not happen on Android 4.0.3 devices as the same app does not display the issue, nor on previous 2.3 Android versions.
        Hide
        Joe Bowser added a comment -

        @billy nab: Are you using Sencha Touch with the application? We need a barebones example to reproduce this issue. I suspect this is an Android issue, since there is no way we have access to the screenshot functionality in Android 3.x or higher, only the imageCapture features (Camera and Gallery).

        Show
        Joe Bowser added a comment - @billy nab: Are you using Sencha Touch with the application? We need a barebones example to reproduce this issue. I suspect this is an Android issue, since there is no way we have access to the screenshot functionality in Android 3.x or higher, only the imageCapture features (Camera and Gallery).
        Hide
        Alexander Kolesnikov added a comment -

        I tried to reproduce the issue using a barebones application but couldn't. The real application is a bit messy, and I suspect there maybe some tiny resource quietly missing that provokes the problem, otherwise hidden. I would still push my point: the line of code in onDestroy() won't be able to do its work properly, no matter what, until shouldOverrideUrlLoading() isn't changed.

        Show
        Alexander Kolesnikov added a comment - I tried to reproduce the issue using a barebones application but couldn't. The real application is a bit messy, and I suspect there maybe some tiny resource quietly missing that provokes the problem, otherwise hidden. I would still push my point: the line of code in onDestroy() won't be able to do its work properly, no matter what, until shouldOverrideUrlLoading() isn't changed.
        Hide
        Sean Hall added a comment -

        I can reproduce it with PhoneGap 1.4.1, Sencha Touch 2.0.0, and Android 3.2.x. The project setup is standard, with index.html, app.js, and phonegap.js in the assets/www folder, and the sencha sdk in the assets/www/sencha folder.

        index.html
        <!DOCTYPE html>
        <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                <title>CB246</title>
                <link rel="stylesheet" href="sencha/resources/css/sencha-touch.css" type="text/css">
                <link rel="stylesheet" href="sencha/resources/css/android.css" type="text/css">
                <script type="text/javascript" src="sencha/sencha-touch-all-debug.js"></script> 
                <script type="text/javascript" src="phonegap.js"></script>
                <script type="text/javascript" src="app.js"></script>
            </head>
            <body>
            </body>
        </html>
        
        app.js
        Ext.ns('CB246.view');
        
        Ext.define('CB246.view.Main', {
            extend: 'Ext.Container',
            config: {
                fullscreen: true,
                layout: 'fit',
                items: [
                    {
                        xtype: 'button',
                        text: 'Go',
                        listeners: {
                            tap: function() {
                                Ext.Msg.alert('Alert', 'You clicked the button');
                            }
                        }
                    }
                ]
            },
        });
        
        CB246.onDeviceReady = function() {
            console.log('CB246.onDeviceReady');
            Ext.application({
                name: 'CB246',
                views: [
                    'Main',
                ],
                launch: function() {
                    console.log('CB246.onDeviceReady.launch');
                    Ext.create('CB246.view.Main');
                },
            });
        }
        
        document.addEventListener("deviceready", CB246.onDeviceReady, false);
        
        Show
        Sean Hall added a comment - I can reproduce it with PhoneGap 1.4.1, Sencha Touch 2.0.0, and Android 3.2.x. The project setup is standard, with index.html, app.js, and phonegap.js in the assets/www folder, and the sencha sdk in the assets/www/sencha folder. index.html <!DOCTYPE html> <html> <head> <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" > <title> CB246 </title> <link rel= "stylesheet" href= "sencha/resources/css/sencha-touch.css" type= "text/css" > <link rel= "stylesheet" href= "sencha/resources/css/android.css" type= "text/css" > <script type= "text/javascript" src= "sencha/sencha-touch-all-debug.js" > </script> <script type= "text/javascript" src= "phonegap.js" > </script> <script type= "text/javascript" src= "app.js" > </script> </head> <body> </body> </html> app.js Ext.ns('CB246.view'); Ext.define('CB246.view.Main', { extend: 'Ext.Container', config: { fullscreen: true , layout: 'fit', items: [ { xtype: 'button', text: 'Go', listeners: { tap: function () { Ext.Msg.alert('Alert', 'You clicked the button'); } } } ] }, }); CB246.onDeviceReady = function () { console.log('CB246.onDeviceReady'); Ext.application({ name: 'CB246', views: [ 'Main', ], launch: function () { console.log('CB246.onDeviceReady.launch'); Ext.create('CB246.view.Main'); }, }); } document.addEventListener("deviceready", CB246.onDeviceReady, false );
        Hide
        Joe Bowser added a comment -

        So, what does Ext.create actually do? Can you reproduce this without using Sencha?

        Show
        Joe Bowser added a comment - So, what does Ext.create actually do? Can you reproduce this without using Sencha?
        Hide
        Sean Hall added a comment -

        The behavior doesn't actually occur until you click the button.

        Ext.create creates the panel specified in CB246.view.Main, and adds it to the body. The end result is that the whole screen is the button.

        Show
        Sean Hall added a comment - The behavior doesn't actually occur until you click the button. Ext.create creates the panel specified in CB246.view.Main, and adds it to the body. The end result is that the whole screen is the button.
        Hide
        Sean Hall added a comment -

        I couldn't reproduce it using a standard html button.

        I realize that the onDestroy method being called prematurely is most likely due to Sencha. But the behavior that Mr. Kolesnikov described in his blog post, where the onDestroy method tries to make the WebView navigate to about:blank and the WebViewClient intercepts it and sends it to the native browser instead, sounds like a bug that's isolated to PhoneGap. He already identified the fix, it seems like a no brainer to me.

        Show
        Sean Hall added a comment - I couldn't reproduce it using a standard html button. I realize that the onDestroy method being called prematurely is most likely due to Sencha. But the behavior that Mr. Kolesnikov described in his blog post, where the onDestroy method tries to make the WebView navigate to about:blank and the WebViewClient intercepts it and sends it to the native browser instead, sounds like a bug that's isolated to PhoneGap. He already identified the fix, it seems like a no brainer to me.
        Hide
        Joe Bowser added a comment -

        We can't justify changes to the framework just because Sencha does something. Also, given that there are very few Honeycomb users (3.3%) and that they have an upgrade path to ICS, I'm going to keep this open until Honeycomb disappears or until someone has a vanilla repro case.

        Show
        Joe Bowser added a comment - We can't justify changes to the framework just because Sencha does something. Also, given that there are very few Honeycomb users (3.3%) and that they have an upgrade path to ICS, I'm going to keep this open until Honeycomb disappears or until someone has a vanilla repro case.
        Hide
        Martin de Keijzer added a comment -

        A colleague of mine reported the same on a HTC device:
        Android version: 2.3.5
        HTC Sense version: 3.0
        Software number: 2.10.401.8
        Kernel version: 2.6.35.10-g9ac6c7a

        The application this happened with is on Google Play; https://play.google.com/store/apps/details?id=com.ibuildings.dmc

        Show
        Martin de Keijzer added a comment - A colleague of mine reported the same on a HTC device: Android version: 2.3.5 HTC Sense version: 3.0 Software number: 2.10.401.8 Kernel version: 2.6.35.10-g9ac6c7a The application this happened with is on Google Play; https://play.google.com/store/apps/details?id=com.ibuildings.dmc
        Hide
        Joe Bowser added a comment -

        Since we don't have a solid reproduction case for this issue without using Sencha Touch, I'm going to have to close this. If someone can determine what Sencha does to cause this error, we can re-open this issue.

        Show
        Joe Bowser added a comment - Since we don't have a solid reproduction case for this issue without using Sencha Touch, I'm going to have to close this. If someone can determine what Sencha does to cause this error, we can re-open this issue.
        Hide
        Frank Groeneveld added a comment -

        I'm experiencing the same problem when a form submit is captures by my javascript. The contents of the form are then submitted using jquery.ajax. It only happens when the app is first installed on the user device. This is the app (it's the registration form):
        http://play.google.com/store/apps/details?id=nl.hrkoffieapp.hrkoffieapp

        Show
        Frank Groeneveld added a comment - I'm experiencing the same problem when a form submit is captures by my javascript. The contents of the form are then submitted using jquery.ajax. It only happens when the app is first installed on the user device. This is the app (it's the registration form): http://play.google.com/store/apps/details?id=nl.hrkoffieapp.hrkoffieapp
        Hide
        Anderson Zanardi added a comment -

        Hello, Is there any solution?
        I have the same problem.
        Help us!

        Show
        Anderson Zanardi added a comment - Hello, Is there any solution? I have the same problem. Help us!
        Hide
        Frank Groeneveld added a comment -

        I fixed it by changing this:

        • jQuery('#loading').css('display', 'block');
          + jQuery('#loading').show();
        Show
        Frank Groeneveld added a comment - I fixed it by changing this: jQuery('#loading').css('display', 'block'); + jQuery('#loading').show();

          People

          • Assignee:
            Joe Bowser
            Reporter:
            Alexander Kolesnikov
          • Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development