B4J Question Using AsyncStreamsObject cannot write to designated temp folder

crt

Member
Licensed User
Longtime User
Hi, I'm trying to get the Asyncstream from my device to be saved in the temp folder that I specified with the TempFolder variable in the code use in this tutorial https://www.b4x.com/android/forum/t...ceive-objects-over-the-network.34612/#content
I'm running the AsyncStream examples in B4J app on Windows 10 and B4A app on a Samsung Galaxy 4.
It will only save the the AsyncInput file in the "Users\\AppData\Local\Temp" folder, though from what I understand, this is the temp folder used by B4A-Bridge. I changed the variable to c:\Temp and used other paths pointing to the "AppData\Roaming" folder. I even ran the apps in release mode and closed B4A-Bridge but it will still only save the files to the "Users\\AppData\Local\Temp" folder.
Is there another variable I need to change to save it to the TempFolder I specify?
I can't find anywhere else in the code to change this.
Thanks for any help.
 

crt

Member
Licensed User
Longtime User
In my project, I need to send files and also numbers, the examples in using AsyncStreamsObject seemed to provide an all in one solution to accomplish what I wanted to do. Instead of searching the forums trying to piece together how to send files and numbers using b4xserializator, I opted to use AsyncStreamsObject instead. Allot of times the examples aren't as clear cut as I wish, to do what I want to do and I have to spend hours searching the forums to get enough code snippets to try to put it together. What is simple for you isn't so simple for a dummy like me trying to learn this stuff.
I will go ahead and try to use b4xserializator, since it is the preferred method to send data over the network.
 
Upvote 0

crt

Member
Licensed User
Longtime User
Well, since we are on the subject, I ran the B4xSerializator examples for B4A and B4J to see again how I could get it to work. When I send the text from the B4A example I am getting an java.lang.ClassNotFoundException error in B4J.
B4X:
Waiting for debugger to connect...
Program started.
Error occurred on line: 106 (Main)
java.lang.RuntimeException: java.lang.ClassNotFoundException: b4j.example.main$_mymessage
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:297)
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:357)
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(B4XSerializator.java:112)
    at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ConvertBytesToObject(B4XSerializator.java:82)
    at b4j.example.main._astream_newdata(main.java:331)
    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.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.BA.raiseEvent2(BA.java:90)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
    at anywheresoftware.b4a.BA$2.run(BA.java:229)

I'm using Java jdk1.8.0_152.
Any ideas what I am doing wrong? The code is unmodified and the firewall is open to send and receive data, also the proper libraries seem to be loaded. The jRandomAccessFile library is version 2.30
 
Last edited:
Upvote 0
Top