Sub Process_Globals
Dim SQL1 As SQL
End Sub
Sub Activity_Create(FirstTime As Boolean)
'create subdirectory 'ListDatabase' if it doesn't exist
If File.Exists(File.DirRootExternal & "/ListDatabase/", "") = False Then
File.MakeDir(File.DirRootExternal, "ListDatabase")
End If
'open database 'data.db' if it exists, create if necessary
SQL1.Initialize(File.DirRootExternal & "/ListDatabase","data.db", True)
Log("Database initialized? " & SQL1.IsInitialized)
'create table 'list' to hold the list data if it doesn't exist
SQL1.ExecNonQuery("CREATE TABLE IF NOT EXISTS list(ID INTEGER PRIMARY KEY, item BLOB, category TEXT, done BOOLEAN)")
End Sub