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!
SQLlite database on Android issue
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: SQLlite database on Android issue
I don't have experience with datagrids, but I do have experience with things working on desktop, but not on mobile. Usually I find it's my own fault.... Do you have SQL lite and possibly even write to external storage checked in your android standalone settings?
--Sefro
--Sefro
Re: SQLlite database on Android issue
Yes I enabled SQLlite on the standalone settings.
I feel like it is something to do with my datagrid... I may have broken it while trying to add touch to it...
I feel like it is something to do with my datagrid... I may have broken it while trying to add touch to it...
Re: SQLlite database on Android issue
So I solve the problem,
Just in case anyone has the issue with the data grid not working well on a sqllite in an mobile device.
Make sure that your datagrid's group is working properly. What happened to me, is that I tried to enable a touch scroll, and then decided to revert back to regular scrolling,
But I should've just created a new datagrid instead of beating the same old one.
Just in case anyone has the issue with the data grid not working well on a sqllite in an mobile device.
Make sure that your datagrid's group is working properly. What happened to me, is that I tried to enable a touch scroll, and then decided to revert back to regular scrolling,
But I should've just created a new datagrid instead of beating the same old one.