SQLlite database on Android issue
Posted: Fri Jun 13, 2014 12:55 am
Hey,
So I am fairly new to the livecode mobile world.
I made an app which is essentially a checklist, I have a data base that works with sqllite and a datagrid.
For some reason, the app works fine when used on a windows or linux, but when I make it a standalone android app, the datagrid just doesn't react to anything, not even scrolling or updating the sqllite (I don't even know if the database is created).
I can't upload it here, but I am willing to send a mega or dropbox link to whoever thinks they can help.
This is my code:
This is in my Stack Script:
local sID
command setID pID
put pID into sID
end setID
function getID
return sID
end getID
command dbConnect
local tPath, tID
put specialFolderPath("documents") & "/mydatabase.sqlite" into tPath
put revOpenDatabase("sqlite", tPath, , , , ) into tID
setID tID
end dbConnect
on dbCreateTables
## Add a contact_details table to the database
put getID() into tID
revExecuteSQL tID,"CREATE TABLE table1(id INTEGER PRIMARY KEY,text1 char(200),text2 char(50))"
end dbCreateTables
on closeDB pConnID
revCloseDatabase pConnID
if pConnID = sID then
put empty into sID
end if
end closeDB
command Showdb
put revDataFromQuery(tab,return,getID() ,"SELECT id,text1 FROM table1 WHERE text2='FALSE' ; ") into ToDo
put revDataFromQuery(tab,return,getID() ,"SELECT id,text1 FROM table1 WHERE text2='TRUE' ; ") into D0ne
set the dgText of group "ToDo" to ToDo
set the dgText of group "D0ne" to D0ne
end Showdb
Please help, it would be very appreciated!
So I am fairly new to the livecode mobile world.
I made an app which is essentially a checklist, I have a data base that works with sqllite and a datagrid.
For some reason, the app works fine when used on a windows or linux, but when I make it a standalone android app, the datagrid just doesn't react to anything, not even scrolling or updating the sqllite (I don't even know if the database is created).
I can't upload it here, but I am willing to send a mega or dropbox link to whoever thinks they can help.
This is my code:
This is in my Stack Script:
local sID
command setID pID
put pID into sID
end setID
function getID
return sID
end getID
command dbConnect
local tPath, tID
put specialFolderPath("documents") & "/mydatabase.sqlite" into tPath
put revOpenDatabase("sqlite", tPath, , , , ) into tID
setID tID
end dbConnect
on dbCreateTables
## Add a contact_details table to the database
put getID() into tID
revExecuteSQL tID,"CREATE TABLE table1(id INTEGER PRIMARY KEY,text1 char(200),text2 char(50))"
end dbCreateTables
on closeDB pConnID
revCloseDatabase pConnID
if pConnID = sID then
put empty into sID
end if
end closeDB
command Showdb
put revDataFromQuery(tab,return,getID() ,"SELECT id,text1 FROM table1 WHERE text2='FALSE' ; ") into ToDo
put revDataFromQuery(tab,return,getID() ,"SELECT id,text1 FROM table1 WHERE text2='TRUE' ; ") into D0ne
set the dgText of group "ToDo" to ToDo
set the dgText of group "D0ne" to D0ne
end Showdb
Please help, it would be very appreciated!