You can use this code which checks if "Automatic date and time" system setting is enabled on the device:
B4X:
Sub CheckAutoTime As Boolean
Dim p As Phone
Dim s As String
If p.SdkVersion >= 17 Then s = "android.provider.Settings.Global" Else s = "android.provider.Settings.System"
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim jo As JavaObject
Return jo.InitializeStatic(s).RunMethod("getInt", Array(ctxt.RunMethod("getContentResolver", Null), "auto_time", 0)) = 1
End Sub
But what happened when there is no internet connectivity? I think the SNTP date/time is the same as system date/time, in which case it can be changed and tampered with. Am I wrong?
But that does not prevent one from turning the auto time off in settings, change the date/time manually, save records with the tampered date/time and turn auto on again. Am I wrong?