Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim fs As Firestore
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")
fs.Initialize("Firestore",True)
Dim driver As CollectionReference = fs.collection("Drivers","DriverCollection")
If driver <> Null Then
Log("Setting query to get driver DonManfred")
driver.whereEqualTo("id","DonManfred").limit(1).fetch("DriverFetch")
wait for DriverFetch_Snapshot(snap As QuerySnapshot)
Log($"Driver_Snapshot(${snap.Size},${snap})"$)
Dim meta As SnapshotMetadata = snap.Metadata
Dim documents As List = snap.Documents
'Log(documents)
If documents.IsInitialized Then
If documents.Size > 0 Then
For i = 0 To documents.Size-1
Dim docsnap As DocumentSnapshot = documents.Get(i)
Log("Query4DonManfred DocumentNo: #"&i&": "&docsnap.Id)
Next
End If
Else
Log("Snapshot does not contain a list of Documents...")
End If
end if
end sub