Inconsistencies between simulator and device

3 posts, 0 answers
  1. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 24 Sep 2012 Link to this post

    I am working on an app that has an index page with a menu (currently 1 menu item 'categories' and, currently, 2 html pages below that index page, namely: prodcategories.html (called from menu item catategories) and prodsubcategories.html (called from categories shown in prodcategories.html).

    I use a database to store categories and subcategories (both in the same table). Page prodcategories.html checks if the tables is filled and not outdated. When needed it does an xmlhttprequest to a web service that return (sub)categories in xml and the database is filled or refilled.

    I had this working in the simulator, but when I moved the app to my device only index.html was shown. Clicking the 'categories' menu item (which is a listview item) showed a new page with a busy-indicator. Nothing happened after that.

    At the time I created the project I selected to use JQuery mobile (jq: 1.7.2.min and jqm 1.1.0.min). I am not sure if my problems were caused by JQM, but it might be worth to mention. I think that Cordova 2.0 is used.

    Normally you would expect that after onDeviceReady is fired the app is ready to load data from database. In the simulators did never seemed to work, but I was able to solve it by using this script at the bottom of my html (before the closing body-tag):

            <script src="jquery-mobile/jquery-1.7.2.min.js" type="text/javascript"></script>
            <script src="jquery-mobile/" type="text/javascript"></script>
            <script src="js/prodsubcategories.js" type="text/javascript"></script>
            <script src="js/hobbyking.js" type="text/javascript"></script>

                $('#prodsubcategories').bind('pageinit', function(event, ui) {

    when I moved to the device, it turned out that this didn't work. To get it to work I moved all script references to the header (before the reference to cordova.js) and moved the initSubCategories() to the header to with this code:

                document.addEventListener("deviceready", onDeviceReady, false);
                function onDeviceReady() {

    Now it worked on my device, but not in the simulators.

    Can someone from Icenium see if there are any inconsistencies between devices and simulators? if it works on the simulator, it should work on the device and vice versa.

    When needed, I can provide my code.
  2. iliev
    iliev avatar
    40 posts

    Posted 27 Sep 2012 Link to this post


    We know of some issues with the simulator that can be causing this in the current beta version. Basically if onDeviceReady stops working it should get fired when you restart Icenium Graphite.
    In our current development environment we have resolved many of these issues. Stay tuned for upcoming future updates :)
  3. Jan-Dirk
    Jan-Dirk avatar
    327 posts
    Member since:
    Jun 2012

    Posted 27 Sep 2012 Link to this post

    Thank you for replying. Looking forward to it!
Back to Top