Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    XML Datasource not working on Android 2.3.3?

    Hallo,

    I've created a web application based an some ListGrids, which use an XML DataSoruce as backend. It works fine on normal browsers, but the application hangs at least on android 2.3.3 devices. The grid shows its loading message ("loading data") and the application doesn't react to other inputs any longer.
    I'm using SmartGWT 2.5.
    Because you can use "Grids" --> "Data Binding" --> "XML DataSource" in the official showcase as a test case, I assume it could be a bug.
    I tried it on a HTC desire z as well as the android emulator using "Android 2.3.3 - API Level 10". Both show the same problem.
    The emulator for "Android 4.0 - API Level 14" works fine.
    Is there a work around?

    Thanks,
    Christian

    #2
    Nothing wrong with using DataSources, but you might be feeding too much data or have some kind of issue with your DataSource declaration or the returned data. Let us know if you have a reproducible case we can run (the sample does not have a problem).

    Comment


      #3
      Are you sure, you tried the XML Datasource showcase and not the JSON one? JSON seems to work under 2.3.3, but as soon as I call

      http://www.smartclient.com/smartgwt/showcase/#grid_databinding_xml_datasource

      the application totally hangs showing the loading screen. Without reloading the showcase, I can't further use it.
      As I said, the problems seems to occur only an Android 2.3.3 devices. Desktop browsers all work fine.

      Christian

      Comment


        #4
        I can confirm this.

        Code:
        http://www.smartclient.com/smartgwt/showcase/#grid_databinding_json_datasource
        works on Samsung Galaxy Tab GT-P1000 with Android 2.2 native browser and on Sony Ericsson Xperia Neo with Android 2.3.4 native browser.
        Code:
        http://www.smartclient.com/smartgwt/showcase/#grid_databinding_xml_datasource
        does not work on both devices ("loading data..." forever).

        Regards,
        twoonke

        Comment


          #5
          Some debug info:

          I activated the JavaScript console on both devices. The output is the same. When I load the JSON sample, it says
          Code:
          http://www.smartclient.com/smartgwt/showcase/showcase/sc-2011-07-26-2/modules/ISC_Core.js:300
          Uncaught Error: Too much time spent in unload handler.
          (the table contents appear)

          When I load the XML sample it says
          Code:
          http://www.smartclient.com/smartgwt/showcase/showcase/sc-2011-07-26-2/modules/ISC_Core.js:300
          Uncaught TypeError: Object #<a Document> has no method 'createNSResolver'
          ("loading data...")

          hope that helps.

          Regards,
          twoonke
          Last edited by twoonke; 24 Nov 2011, 00:47.

          Comment


            #6
            Seems like the Android browser does not support javascript XPath evaluation currently. The XML sample in the showcase uses setRecordXPath(.) and the Android browser fails to run the corresponding javasript code. The JSON sample works fine, because the underlying data is not nested and needs no setRecordXPath(.).

            The most obvious workaround seems to be using another browser.

            Comment


              #7
              I've also done some other tests.
              - HTC sensation (Android 2.3.4): Same problem; xml datasources freezes application.
              - On the following Android emulators sometimes I had problems with loading the showcase, probably because the application is quiet large. But after a few refreshs all showed the same result. JSON was working fine, XML freezed the app:
              * Android 1.5 (API Level 3)
              * Android 1.6 (API Level 4)
              * Android 2.2 (API Level 8) [There were no problems in loading the application, only the xml issue.]

              Android 2.1 (API Level 9) isn't able to load the show case at all. It hangs while showing "Loading ~300 Samples ..." But maybe that's an emulator problem.

              Additionally I can add, that I'm using XPaths as well in my application. So this might be the reason.

              Using an other browser (like Opera) solves the problem indeed. But you can't tell your user, which browsers they should take and I assume, most of android users will use the onboard browser.
              SmartGWT (or smartclient) is a javascript framework, which aims to allow browser independent software development. For this reason, I would propose, to show the user at least, that its browser isn't supported instead of freezing the application.

              Christian

              Comment

              Working...
              X