HI Manfred!
Could you send me some example code of the use of firestore?
Could you send me some example code of the use of firestore?
fs.Initialize("Firestore",True)
Dim driver As CollectionReference = fs.collection("Drivers","DriverCollection")
If driver <> Null Then
Log("Setting query to get driver")
'driver.whereEqualTo("id","DonManfred").limit(1).fetch("DriverFetch")
driver.setEventname("DriverWatch","Driverliste")
driver.addSnapshotListener
driver.orderBy("userName").limit(25).fetch("DriverFetch")
wait for DriverFetch_Snapshot(success As Boolean, snap As QuerySnapshot, info As String)
Log($"Driver_Snapshot(${snap.Size},${snap})"$)
Dim meta As SnapshotMetadata = snap.Metadata
Dim documents As List = snap.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("Query DocumentNo: #"&i&": "&docsnap.Id)
Dim data As Map = docsnap.Data
Log(data)
Next
End If
End If
Else
Log("Snapshot does not contain a list of Documents...")
End If
#Region Project Attributes
#ApplicationLabel: ITSS Aeropuerto
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#MultiDex: true
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#BridgeLogger:true
#AdditionalJar: com.google.android.gms:play-services-auth
#AdditionalJar: com.google.android.gms:play-services-base
#AdditionalJar: com.google.firebase:firebase-common
#AdditionalJar: com.google.firebase:firebase-auth
#AdditionalJar: com.google.firebase:firebase-database
#AdditionalJar: com.google.firebase:firebase-core
#AdditionalJar: com.google.firebase:firebase-common
#AdditionalJar: com.google.firebase:firebase-firestore
#AdditionalJar: com.google.gms:google-services
#AdditionalJar: grpc-core-1.20.0.jar
#AdditionalJar: grpc-protobuf-1.20.0.jar
#AdditionalJar: grpc-okhttp-1.20.0.jar
#AdditionalJar: grpc-android-1.20.0.aar
#AdditionalJar: opencensus-api-0.20.0.jar
#AdditionalJar: grpc-stub-1.20.0.jar
#AdditionalJar: grpc-protobuf-lite-1.20.0.jar
#AdditionalJar: opencensus-contrib-http-util-0.20.0.jar
#AdditionalJar: opencensus-contrib-grpc-metrics-0.20.0.jar
#AdditionalJar: grpc-context-1.20.0.jar
#AdditionalJar: glide-3.8.0.jar
#AdditionalJar: guava-27.1-android.jar
#ExcludeClasses: com.google.guava:guava-jdk5
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private auth As FirebaseAuth
Dim Imagen_perfil As String
Dim fs As Firestore
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.
Private inicio_etiqueta As Label
Private Image_Perfil_View1 As ImageView
Dim Imagen_perfil As String
Private btnSignOut As Button
Private btnloginFacebook As Button
Private btnlogingogle As Button
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")
Activity.LoadLayout("inicio")
'If auth.CurrentUser.IsInitialized Then Auth_SignedIn(auth.CurrentUser)
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
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnlogingogle_Click
Starter.auth.SignInWithGoogle
End Sub
Sub btnloginFacebook_Click
Starter.facebook.SignIn
End Sub
Sub btnSignOut_Click
Starter.auth.SignOutFromGoogle
Starter.facebook.SignOut
inicio_etiqueta.Text = "Te esperamos nuevamente!"
Image_Perfil_View1.Bitmap = Null
End Sub
'Sub Auth_SignedIn (User As FirebaseUser)
' Log("SignedIn: " & User.DisplayName)
' inicio_etiqueta.Text = "Hola, Bienvenido " & User.DisplayName
'End Sub
Sub SetState
If Starter.auth.CurrentUser.IsInitialized Then
Dim usuario As FirebaseUser = Starter.auth.CurrentUser
inicio_etiqueta.Text = "Hola: " & usuario.DisplayName
Imagen_perfil=usuario.PhotoUrl
Dim links As Map
links.Initialize
links.Put(Image_Perfil_View1, usuario.PhotoUrl)
CallSubDelayed2(imageDownLoader, "Download", links)
End If
End Sub
This is NOT the additional libs folder. You should NOT place any Libraries extect the internal libraries here.Download the files contained in the addlib folder to C: \ Program Files \ Anywhere Software \ Basic4android \ Libraries
Error Maven artifact not found: com.google.protobuf/protobuf-lite
It is a bit tricky part/workaround.What I can do?
com.google.protobuf\:protobuf-lite=3.0.1
com.google.guava\:listenablefuture=1.0
com.google.dagger\:dagger=2.17
com.google.auto.value\:auto-value-annotations=1.6.2
i did not see protobuf-lite installed?Then verify the sdk manager and indicate that it is updated
do you have now a folder C:\Android\extras\b4a_remote\com\com? this would indicated you copied it wrongly somehow.copy here the com folder sent --> C:\Android\extras\b4a_remote\com
What do you mean with this? Is the file available at this place after you copied the com folder?Hi! here C:\Android\extras\b4a_remote\com\google\protobuf\protobuf-lite\3.0.1\protobuf-lite-3.0.1.jar.
it does not work
What do you mean with this? Is the file available at this place after you copied the com folder?
Is the ref really inside the installed-components.txt? Upload the file here please.