Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Android SQlite Problem

$
0
0

@Baklizki wrote:

Hi there,
im trying to implement $cordovaSQLite and open the database. Unfortunately it won't work (sayed it cannot open the database).

My code:
var login = angular.module("login", ["ionic", 'ngCordova'])
.run(function ($ionicPlatform, $cordovaSQLite) {
$ionicPlatform.ready(function () {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
db = $cordovaSQLite.openDB({name : "my.db"});
$cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS people (id integer primary key, firstname text, lastname text)");
});
})

Logcat prints the following error message:

[INFO:CONSOLE(174)] "OPEN database: my.db", source: file:///android_asset/www/plugins/cordova-sqlite-storage/www/SQLitePlugin.js (174)

[INFO:CONSOLE(195)] "OPEN database: my.db failed, aborting any pending transactions", source: file:///android_asset/www/plugins/cordova-sqlite-storage/www/SQLitePlugin.js (195)

[INFO:CONSOLE(82)] "Could not open database", source: file:///android_asset/www/plugins/cordova-sqlite-storage/www/SQLitePlugin.js (82)

Can anybody help me with this?

Sincerly

Alex

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>