I'm trying to convert the ImageDownloader class to cache the images locally, in the same way the B4A version does.
I am using the original Imagedownloader class from here : https://www.b4x.com/android/forum/t...internet-link-on-tableview.36506/#post-415621
I added the KeyValueStore from here: https://www.b4x.com/android/forum/threads/keyvaluestore-class.36683/#content
When I make the changes cache from Map to KeyValueStore, in the same way as the B4A version, I get the following error:
It seems to be that the B4X serializator cannot convert the image object.
any idea how to get around this?
Cheers
Andrew
I am using the original Imagedownloader class from here : https://www.b4x.com/android/forum/t...internet-link-on-tableview.36506/#post-415621
I added the KeyValueStore from here: https://www.b4x.com/android/forum/threads/keyvaluestore-class.36683/#content
When I make the changes cache from Map to KeyValueStore, in the same way as the B4A version, I get the following error:
B4X:
Error occurred on line: 19 (KeyValueStore)
java.lang.RuntimeException: Cannot serialize object: javafx.scene.image.Image@4d81f2
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeType(B4XSerializator.java:258)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.writeObject(B4XSerializator.java:224)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.WriteObject(B4XSerializator.java:104)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ConvertObjectToBytes(B4XSerializator.java:62)
at b4j.example.keyvaluestore._put(keyvaluestore.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:613)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:480)
at anywheresoftware.b4a.keywords.Common.access$0(Common.java:460)
at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:534)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:748)
It seems to be that the B4X serializator cannot convert the image object.
B4X:
sql1.ExecNonQuery2("INSERT OR REPLACE INTO main VALUES(?, ?)", Array As Object(Key, ser.ConvertObjectToBytes(Value)))
any idea how to get around this?
Cheers
Andrew