#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Objekte für die Atomzeit
'Objekte für die Atomzeit
' Private Thread1 As Thread
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
'Library und Objekte für die Atomzeit
Dim sntplib As SntpTime
Dim sntpticks As Long
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")
'Objekte für die Atomzeit
' Thread1.Initialise("Thread1")
' GetAtomTime
Get_Current_Time_whit_b4amodul(10000)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'Sub GetAtomTime
' Thread1.Start(Me, "Get_Current_Time_whit_Library", Null)
'End Sub
Sub Get_Current_Time_whit_Library
sntplib.NtpServerName = "0.pool.ntp.org" ' only needed if you don't want to use the default server "0.us.pool.ntp.org"
sntplib.TimeOut = 10000 ' only needed if you don't want to use the default timeout value of 30000 milliseconds (30 seconds)
sntpticks = sntplib.getGmtNtpTime
If sntpticks > -1 Then
Starter.timoffset = DateTime.Now - sntpticks
Else
Starter.timoffset = 0
End If
Log("Get_Current_Time_whit_Library:")
Log("ticks=" & sntpticks)
Log("timoffset=" & Starter.timoffset)
Log(" ")
End Sub
Public Sub Get_Current_Time_whit_b4amodul(ticks As Long)
If ticks > -1 Then
Starter.timoffset = DateTime.Now - ticks
Else
Starter.timoffset = 0
End If
Log("Get_Current_Time_whit_b4amodul:")
Log("ticks=" & ticks)
Log("timoffset=" & Starter.timoffset)
Log(" ")
End Sub