Android Question SQLite Cipher problem

Facilauto Juan

Member
Licensed User
Hello there!

I have a database and the resource file sqlcipher_native.zip in Files.

I have this code in my button:
B4X:
If SQL.IsInitialized Then SQL.Close
    Try      
        ProgressDialogShow("Initializing database...")
        SQL.Initialize(File.DirDefaultExternal, "zxxx.db", False, "xxxx", File.DirAssets)
        ProgressDialogHide
        Dim cur As Cursor
        cur = SQL.ExecQuery("SELECT * FROM mapa WHERE id=1")
        cur.Position = 0
        Msgbox(cur.GetString("mapa"),"Sqlite cifrado")      
    Catch
        ToastMessageShow("Error loading database.", True)      
    End Try

My problem is that it goes here:
SQL.Initialize(File.DirDefaultExternal, "zxxx.db", False, "xxxx", File.DirAssets)
and then jumps to:
ToastMessageShow("Error loading database.", True)

I don't know how to track the error. I'm a newbie in Basic4Android.

Could anybody help me?
 
Top