My application have a one Service and 4 Activity Modules, all need to connect to one SQLite database.
is it only dim sql at Service Module and another 4 Activity Modules can use it?
i mean like this:
Service1 code:
and then another modules just use code like this:
is it correct way to use it?
is it only dim sql at Service Module and another 4 Activity Modules can use it?
i mean like this:
Service1 code:
B4X:
Sub Process_Globals
Dim serv_SQL As SQL
End Sub
Sub Service_Create
If File.Exists(File.DirDefaultExternal, "PhoneData.db3") = True Then
serv_SQL.Initialize(File.DirDefaultExternal, "PhoneData.db3", True)
End If
End Sub
and then another modules just use code like this:
B4X:
Query = "UPDATE TblJob Set TimeIn = ?, WHERE CaseNo = ?"
Service1.serv_SQL.ExecNonQuery2(Query, Array As String("10:00","1234"))
is it correct way to use it?
Last edited: