I am new to Basic for Android but not development. I have reworked this many times and can't seem to ever see a database. I am using SQLite Editor to look for the database based on the application name and it never sees one for this application.
I have read all the documentation and tutorials but can't seem to get this working. I am using version 3.0 on a Nexus 7 32GB Tablet. Here is my code:
I have been using this to create the table and insert a single record.
I have read all the documentation and tutorials but can't seem to get this working. I am using version 3.0 on a Nexus 7 32GB Tablet. Here is my code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("myworldmain")
'Test if this is the first time for the application to run and if so, create and initialize the database.
If FirstTime Then
If File.Exists(File.DirRootExternal, "MyWorld.db") = False Then
SQLMyWorld.Initialize(File.DirRootExternal,"MyWorld.db", True)
'Create the tables
CreateTables
Else
SQLMyWorld.Initialize(File.DirRootExternal,"MyWorld.db", True)
End If
End If
End Sub
I have been using this to create the table and insert a single record.
B4X:
Sub CreateTables
'If Table Doesn't Exist (FirstTime = True) Then Create Table, If (FirstTime = False) Do Nothing.
SQLMyWorld.ExecNonQuery("CREATE TABLE ProjectList (prjName TEXT)")
'Remove line below once database creation confirmed - DEBUG ONLY
SQLMyWorld.ExecNonQuery("INSERT INTO ProjectList VALUES ('Project Test Value')")
End Sub