ref.updateChildren(childUpdates) ' <-- This is the "atomic" update. One start of transaction no matter how many elements the map has
Error occurred on line: 185 (Main)
java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map cannot be cast to java.util.Map
at de.donmanfred.DatabaseReferenceWrapper.updateChildren(DatabaseReferenceWrapper.java:212)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:748)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:343)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:259)
at com.zona.protegida.main._testfunction_updatechildren(main.java:436)
at com.zona.protegida.main._activity_resume(main.java:428)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at com.zona.protegida.main.afterFirstLayout(main.java:108)
at com.zona.protegida.main.access$000(main.java:17)
at com.zona.protegida.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7231)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
which version of the lib are you using?I've error in this line
Sub bt_click
Dim childUpdates As Map
childUpdates.Initialize
childUpdates.Put("Campo","Valor")
ref.updateChildren(childUpdates)
End Sub
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean anywheresoftware.b4a.BA.subExists(java.lang.String)' on a null object reference
at de.donmanfred.DatabaseReferenceWrapper$5.onComplete(DatabaseReferenceWrapper.java:233)
at com.google.android.gms.internal.zzajb$20.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7231)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
...Please note that the wrap for the Query object is NOT finished...
' U1) * working: The user can log in to post individual messages
' U2) -->Query needed: The user can browse through a list of posts made by _all users_
' U3) -->Query needed: The user can browse through a list of posts made by _himself_
' U4) * working: The user can add a post
' U5) * working: The user can open any post to see the post message
' -->Query needed: and a list of all comments to this post
' U6) * working: The user can add a comment to an opened post
#Region Project Attributes
#ApplicationLabel: Control Home
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim GeneralTimer As Timer
End Sub
Sub Globals
Private boton As ImageView
Private puerta1 As Boolean
Private time1 As Long
Dim realtime As FirebaseDatabase
Dim ref As DatabaseReference
End Sub
Sub Activity_Create(FirstTime As Boolean)
realtime.Initialize("Realtime")
realtime.PersistenceEnabled = True
realtime.goOnline
ref.Initialize("Reference",realtime.getReferencefromUrl("https://controlhome-xxxxx.firebaseio.com/"))
ref.addChildEventListener
ref.addListenerForSingleValueEvent
ref.addValueEventListener
GeneralTimer.Initialize("GeneralTimer",300)
GeneralTimer.Enabled=True
boton.Initialize("boton")
Activity.AddView(boton,10%x,10%y,40%x,20%y)
boton.Bitmap=LoadBitmap(File.DirAssets,"llave.png")
boton.Gravity=Gravity.FILL
puerta1=False
End Sub
Sub boton_click
Dim childUpdates As Map' ++++++++++++++++++++++++++++++++++++++++++++++++++++++
childUpdates.Initialize
childUpdates.Put("puerta1","abrir")
ref.updateChildren(childUpdates) ' +++++++++++++++++++++++++++++++++++++++++
time1=DateTime.now
puerta1=True
End Sub
Sub GeneralTimer_Tick
If puerta1=True Then
If time1+3000<DateTime.Now Then
Dim childUpdates As Map' ++++++++++++++++++++++++++++++++++++++++++++++
childUpdates.Initialize
childUpdates.Put("puerta1","cerrar")
ref.updateChildren(childUpdates) ' +++++++++++++++++++++++++++++++++
puerta1=False
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sorry, not from my side... I don´t use iOSAre there any plans for a iOS version for this
Thank you very much! Really appreciatedI have made a small donation as a thank you!
Sorry, not from my side... I don´t use iOS
Ha .... Manfred (@DonManfred) only deserves the latest and most up-do-date gadgetsI think someone should donate an old iPad or iPhone to Don to change all that!
Ha .... Manfred (@DonManfred) only deserves the latest and most up-do-date gadgets
Even is someone will do.... The iPad will move into trashcan... I´m not interested in iOS at all!donate an old iPad or iPhone to Don to change all that!
Even is someone will do.... The iPad will move into trashcan... I´m not interested in iOS at all!
I have an absolute hatred for iOS as well. My previous post related to giving @DonManfred the latest and greatest was in jest as I know Manfred has a dislike for Apple and their OS. Having said that, it would appear that in order to gain a decent client base for my applications, I will have to provide iOS versions of my software as wellDon, can you elaborate as to why you don't like iOS?
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean anywheresoftware.b4a.BA.subExists(java.lang.String)' on a null object reference
at de.donmanfred.DatabaseReferenceWrapper$4.onComplete(DatabaseReferenceWrapper.java:197)
at com.google.android.gms.internal.zzajs$20.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Sub Reference_onComplete(errorCode As Int, errorMessage As String, errObj As Object)
Log($"ref_onCancelled(${errorCode},${errorMessage})"$)
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?