'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim SQL1 As SQL
'initialize the database ..Create new file if does not exist
SQL1.Initialize (File.DirDefaultExternal,"MyDataBase.db",True)
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("layout1")
'remove table if needed
SQL1.ExecNonQuery("DROP TABLE IF EXISTS stock")
'create table
SQL1.ExecNonQuery("CREATE TABLE IF NOT EXIST mytable (Firstname TEXT , LastName TEXT, age INTEGER)")
End Sub
Sub FillTable
SQL1.ExecNonQuery ("INSERT INTO mytable VALUES ('John', 'Smith', 21)")
End Sub