Public Sub Initialize
If isIni = False Then
isIni = True
#If B4J
If DetectOS = "windows" Then
SQL.InitializeSQLite(File.DirApp,"scheduler.db",True)
else
Dim namepack As String
Dim SystemProperty As Map = GetSystemProp
For Each Key As String In SystemProperty.Keys
If Key = "sun.java.command" Then
'Log(SystemProperty.Get(Key))
namepack = SystemProperty.Get(Key)
End If
Next
namepack = namepack.Replace(".","")
xui.SetDataFolder(namepack)
SQL.InitializeSQLite(xui.DefaultFolder,"scheduler.db",True)
end if
#Else
SQL.Initialize(xui.DefaultFolder,"scheduler.db",True)
#End If
End If
End Sub
#If B4J
'https://www.b4x.com/android/forum/threads/getscreenposition.50011/#content
Public Sub GetScreenPosition(n As Node) As Map
......
End Sub
Sub DetectOS As String
Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
If os.Contains("win") Then
Return "windows"
Else If os.Contains("mac") Then
Return "mac"
Else
Return "linux"
End If
End Sub
Sub GetSystemProp As Map
Dim jo As JavaObject
jo.InitializeStatic("java.lang.System")
Dim Prop As Map = jo.RunMethod("getProperties", Null)
Return Prop
End Sub
#End If