IndexedDB does not connect on Android 4.2

0

I'm working on the IntelXDK IDE, and I use the IndexedDB to persist some files. When emulating the project in the IDE, everything works perfect, it makes the connection, it brings all the data, everything works. When I generate my APK, and install it on a smartphone running with android 4.2, it does the part of going on the server and checking the data but when I need to go to the internal bank of the application it can not access.

I have identified that it is not even entering the database initialization area. I check the log and nothing wrong happens.

How to check this problem, initially thought it was space in the cell, but I tested it in another and it did not work either.

The beginning of my code is as follows.

    //provide database name and version number
var request = indexedDB.open("DB_MINHACELULA", 1);
var db = null;

function DeletaBanco(){    
    var bdDeleta = indexedDB.deleteDatabase("DB_MINHACELULA");
    bdDeleta.onerror = function(event) {
        console.log("Error " + event.target.errorCode);
    };
    bdDeleta.onsuccess = function(event) {
        console.log("Deletado com sucesso!");
    };
}


request.onupgradeneeded = function(){
    db = request.result;
    //////////////////////////////////////////////////////////////
    //                  TABELA USUARIO LOGADO                  //
    ////////////////////////////////////////////////////////////

    var logado= db.createObjectStore("tbl_USUAR_LOGAD", {keyPath: "COD_IDENT_USUAR"});

    logado.createIndex("COD_IDENT_USUAR", "COD_IDENT_USUAR", {unique: true});
    logado.createIndex("TXT_EMAIL_USUAR", "TXT_EMAIL_USUAR", {unique: false});
    logado.createIndex("TXT_SENHA_USUAR", "TXT_SENHA_USUAR", {unique: false});
  

As no mistake, I can not bring any more specific information, because I can not debug the code, could anyone help me with anything?

    
asked by anonymous 14.09.2015 / 19:50

1 answer

1

IndexedDB is not supported by all browsers, and according to caniuse.com the native Android browser supports it only starting with version 4.4

According to the same site it supports WebSQL, so an alternative might be to use WebSQL or use a polyfill such as IndexedDBShim , which allows you to use the IndexedDB API in browsers with only WebSQL support

    
15.09.2015 / 16:17