Android Question What is this error mean?

gacar

Active Member
My application running under debug mode. I am gettin this error about 10 minutes later. I am using KeyValueStore

B4X:
Copying updated assets files (20)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzn@1cbe0a2
onAuthStateChanged: com.google.firebase.auth.internal.zzn@1cbe0a2
onAuthStateChanged: com.google.firebase.auth.internal.zzn@1cbe0a2
*** Service (firebasemessaging) Create ***
** Service (firebasemessaging) Start **
..........................................     'There are hundreds more same lines here (** Service (firebasemessaging) Start **)
** Service (firebasemessaging) Start **
** Service (firebasemessaging) Start **
Error occurred on line: 24 (KeyValueStore)
android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. 
    at android.database.CursorWindow.<init>(CursorWindow.java:108)
    at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
    at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:138)
    at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132)
    at anywheresoftware.b4a.sql.SQL$CursorWrapper.getRowCount(SQL.java:335)
    at anywheresoftware.b4a.sql.SQL$ResultSetWrapper.NextRow(SQL.java:457)
    at DemirHaber.Mobile.keyvaluestore._get(keyvaluestore.java:83)
    at DemirHaber.Mobile.b4xpagesohbet._verioku(b4xpagesohbet.java:235)
    at DemirHaber.Mobile.b4xpagesohbet._girisekraniacik(b4xpagesohbet.java:764)
    at DemirHaber.Mobile.b4xpagesohbet._giriskontrol(b4xpagesohbet.java:787)
    at DemirHaber.Mobile.b4xpagesohbet._sql_ready(b4xpagesohbet.java:948)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA$2.run(BA.java:387)
    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:6161)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
** Activity (main) Pause event (activity is not paused). **
 

Mahares

Expert
Licensed User
Longtime User
I am gettin this error about 10 minutes later. I am using KeyValueStore

ALthough KVS works like maps, the data is actually stored in an internal SQLite database after the data is serialized. You exceeded the cusrsor limit of 2048 KB
If you search for this: 'Cursor window allocation of 2048 kb failed.', you will find many postss. One of them similar to yours is this:
You don't need me to tell you, but the title of the thread is really bad and non descriptive; it is not too helpful to the community.
 
Upvote 0

gacar

Active Member
I am not using cursor. Each 2 seconds i am writing new value to KeyValueStore. For example UserOnline = True or UserOnline = false but Perhaps cannot override.

B4X:
Private Sub WriteValue(ValueName As String, Value As Object)
    KVS.Put(ValueName , Value )
End Sub

And when i need a value i am calling this sub

B4X:
Private Sub ReadValue(ValueName As String) As Object
    Dim Value As Object = KVS.Get(ValueName )
    Return Value 
End Sub
 
Upvote 0

gacar

Active Member
I am not using cursor. Each 2 seconds i am writing new value to KeyValueStore. For example UserOnline = True or UserOnline = false but Perhaps cannot override.

B4X:
Private Sub WriteValue(ValueName As String, Value As Object)
    KVS.Put(ValueName , Value )
End Sub

And when i need a value i am calling this sub

B4X:
Private Sub ReadValue(ValueName As String) As Object
    Dim Value As Object = KVS.Get(ValueName )
    Return Value
End Sub

I am writing to KeyValueStore, string values too for example UserID= "xxxxxxxxxxxxxxxx" and etc.
 
Upvote 0
Top