I have the code listed below. I am using B4J 1.06 and wrote this small sample to try my database library. It crashes at the mdb.Initialize(Me). This library uses no UI elements. I thought that the B4A libraries should work if they did not use UI elements. Any help would be great.
B4X:
Sub Process_Globals
Privatefx As JFX
PrivateMainForm As Form
Privateclose As Button
Privatemdb As DataBase
End Sub
Sub AppStart (Form1 AsForm, Args() AsString)
mdb.Initialize(Me)
MainForm = Form1
MainForm.RootPane.LoadLayout("layout1")
MainForm.Show
If File.Exists(File.DirApp, "test.dat") = False Then
createDB
EndIf
End Sub
Sub close_MouseClicked (EventData AsMouseEvent)
Log("Closing & Saving Data...")
mdb.PutField("name", "Margret")
mdb.PutField("phone", "999-8989")
mdb.AddRecord
'ExitApplication
End Sub
Sub createDB
mdb.CreateDataBase(0, "test.dat", File.DirApp , ArrayAsString("name", "phone"))
End Sub
Last edited: