Indexeddb does not connect on Android 4.2

Asked

Viewed 131 times

0

I am working on the Intelxdk IDE, and I use Indexeddb to persist some files. By emulating the project in the IDE, everything works perfect, it makes the connection, it brings all the data, everything works. When I Gero my APK, and install on a smartphone running with android 4.2, it does the part of going on the server and check the data but when I need to go in the internal database of the application it can not access.

I identified that it is not even entering the boot area of the database. I check the log and no error happens.

What the way to check this problem, initially I thought it was cell space, but I tested in another and it didn’t 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 there is no error, I can not bring any more specific information, because I can not debug the code, It would be like someone help me in something ?

1 answer

1


Indexeddb is not supported by all browsers, and according to the website caniuse with. the native Android browser supports it only from version 4.4

According to the same website it supports Websql, so an alternative may be to use Websql or use a polyfill such as Indexeddbshim, which allows you to use the Indexeddb API on browsers with only Websql support

  • However this is not the problem, as I tested in a 5.1 and also did not work.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.