1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    18
    Vote Rating
    1
    jens13583 is on a distinguished road

      0  

    Default sencha + phonegap: reading local xml file

    sencha + phonegap: reading local xml file


    Is it possible to parse a local xml file when using ST and phonegap on Android (ICS)?

    I tried it with a store
    Code:
    var mystore = new Ext.data.Store({
        model: 'mymodel',
        proxy: {
            type: 'ajax',
            url : 'myfile.xml',
            reader: {
                type: 'xml',
                root: 'myroot',
                record: 'myrecord'
            }
        }
    });
    
    [...]
    mystore.load({
          scope   : this,
          callback: function(records, operation, success) {
            console.log('success: '+success);
          }
    });
    but all I got was an Uncaught TypeError (Cannot read property 'length' of undefined)
    the I tried Ajax.request:
    Code:
      Ext.Ajax.request({
        url: 'myfile.xml',
            success: function() {
    console.log('sucess!!!');
            },
            failure: function() {
    console.log('failure!!!');
            }
          })
    I tried it with a different url:
    Code:
    url: 'file:///android_asset/www/myfile.xml'
    but I had no success.

    Did anyone have the same problem and solved it somehow?

    //edit: On my Android 2.3 device I can use the store + xmlReader without problems, but on 4.0 it just doesnt work ?!?

    //edit2: I tried to put all my js files into one combined js -> still no success

    errors in logcat: SqliteDatabaseCpp: sqlite returned: error code = 14, msg = cannot open file at line [,,,], db=data/data/de.my.app/databases/webview.db
    chromium: Uknown chromium error: -6
    PhoneGapLog: file:///android_asset/www/app/combined.js Line 1 : Uncaught TypeError: Cannot read property 'length' of undefined

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    18
    Vote Rating
    1
    jens13583 is on a distinguished road

      0  

    Default


    Is there a different method to read files within the apk?

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    18
    Vote Rating
    1
    jens13583 is on a distinguished road

      0  

    Default


    Problem solved after I put the xml file into my app/ subfolder.
    I don't understand why this was a problem on android ICS, but now it works

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi