This question is locked. New answers and comments are not allowed.
My problem is simple but I can't find anything related to say if is possible or not.
I want to access the local storage in a device running my Icenium project. I need to know where (in filesystem) the storage is or how can I access it with a SQLite tool in any other way.
Thank you.
I want to access the local storage in a device running my Icenium project. I need to know where (in filesystem) the storage is or how can I access it with a SQLite tool in any other way.
Thank you.
7 Answers, 1 is accepted
0
Hi,
Have you looked at Cordova's localStorage? Accessing an item from the storage is easy as
Regards,
Steve
Telerik
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Have you looked at Cordova's localStorage? Accessing an item from the storage is easy as
However, if you want to store your app results as a file (and not as a string in a key-value store or a DB), you can use Cordova's local FileSystem API.var value = window.localStorage.getItem("your_key");
The sample-localstorage shows how this works on a device.
Regards,
Steve
Telerik
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Developer
Top achievements
Rank 1
answered on 13 Sep 2013, 02:09 PM
Sorry but I'm afrid my question is not accurate. The base I want to access isn't the localStorage itself but the webSQL database(see the attached screenshot). I need to access it on the application running on a smartphone or tablet. In the simulator is easy using the Resources Tab on the Debug Window.
Sorry by the misunderstand.
Sorry by the misunderstand.
0
domiSchenk
Top achievements
Rank 1
answered on 16 Sep 2013, 08:07 AM
i'm using the following code snippet to open my db:
if (window.sqlitePlugin !== undefined) {
console.log("Using SQLite Plugin DB");
// save to global var
dbApp.db = window.sqlitePlugin.openDatabase("databasename");
}
else {
// For debuging in simulator fallback to native SQL Lite
console.log("Use built in SQLite");
dbApp.db = window.openDatabase("databasename", "1.0", "databasename Demo", 200000);
}
this way it works in both version on ion/iphone and on simulator
create tables:
dbApp.db.transaction(function(tx) {
console.log("Create Table");
tx.executeSql("CREATE TABLE IF NOT EXISTS Person(PersonID INTEGER PRIMARY KEY ASC, Name TEXT IsDeleted INTEGER)", [], dbApp.onSuccess, dbApp.onError);
});
and access it:
dbApp.db.transaction(function(tx) {
tx.executeSql("SELECT * FROM Person ",
[],
function(tx, rs) {
var result = [];
for (var i = 0; i < rs.rows.length; i++) {
var row = rs.rows.item(i);
result.push({
PersonID: row['PersonID'],
Name: row['Name'],
IsDeleted : row['IsDeleted']
});
}
success(result);
})
});
i hope this helps you!
if (window.sqlitePlugin !== undefined) {
console.log("Using SQLite Plugin DB");
// save to global var
dbApp.db = window.sqlitePlugin.openDatabase("databasename");
}
else {
// For debuging in simulator fallback to native SQL Lite
console.log("Use built in SQLite");
dbApp.db = window.openDatabase("databasename", "1.0", "databasename Demo", 200000);
}
this way it works in both version on ion/iphone and on simulator
create tables:
dbApp.db.transaction(function(tx) {
console.log("Create Table");
tx.executeSql("CREATE TABLE IF NOT EXISTS Person(PersonID INTEGER PRIMARY KEY ASC, Name TEXT IsDeleted INTEGER)", [], dbApp.onSuccess, dbApp.onError);
});
and access it:
dbApp.db.transaction(function(tx) {
tx.executeSql("SELECT * FROM Person ",
[],
function(tx, rs) {
var result = [];
for (var i = 0; i < rs.rows.length; i++) {
var row = rs.rows.item(i);
result.push({
PersonID: row['PersonID'],
Name: row['Name'],
IsDeleted : row['IsDeleted']
});
}
success(result);
})
});
i hope this helps you!
0
Iain
Top achievements
Rank 1
answered on 18 Feb 2014, 09:28 AM
Hi,
I used your code. Can you confirm it works in the AppBuilder simulator?
When i run the code the callback function after performing a SELECT statement never gets executed.
Cheers,
IK
I used your code. Can you confirm it works in the AppBuilder simulator?
When i run the code the callback function after performing a SELECT statement never gets executed.
Cheers,
IK
0
Hi IK,
Please note that Cordova plugins do not work in the Simulator and in the AppBuilder companion app.
Regards,
Steve
Telerik
Please note that Cordova plugins do not work in the Simulator and in the AppBuilder companion app.
Regards,
Steve
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
0
Iain
Top achievements
Rank 1
answered on 18 Feb 2014, 02:16 PM
Hi Steve,
Thanks for that info. So if i am using the simulator it seems i can fall back to using WebSQL. Am i able to query and execute statements against WebSQL in the simulator?
Cheers,
IK
Thanks for that info. So if i am using the simulator it seems i can fall back to using WebSQL. Am i able to query and execute statements against WebSQL in the simulator?
Cheers,
IK
0
Hi IK,
Yes you can use WebSQL/IndexedDB when running the app in Simulator. Both are available for inspections in the debugging tools -> Resources.
Regards,
Steve
Telerik
Yes you can use WebSQL/IndexedDB when running the app in Simulator. Both are available for inspections in the debugging tools -> Resources.
Regards,
Steve
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)