Hello All, i'm working on a project which requires a mobile device connected with a computer running a service written in VB6. They exchange data as text strings and I have learned from the examples found here to use AsyncStreamsText do do it. It works fine.
But now, when the computer receive determined text message, it should send not another text but a pdf file. And in this case I guess AsyncStreams should me more appropriate. I have a few questions:
Can I have both methods running in the same program?
Is possible send files by using AsyncStreamsText?
I like the idea of implementing with B4J, but for the next project. There is much blood poured on this VB6 code and not much time to change now.
Could you explain a little more about making astreams public? As if you were talking to a not-really-brilliant newbie?
Hmm. Please be patient, but I still don't get it. I need to receive the file in the mobile device. From what I understand, the old vb6 seems to send the file, but when it is received by the AST module, it is converted into some charset and the result doesn't look as a pdf file. The code you wrote seems to be intended to send files from the mobile.
I thought that you need to send the file from the Android device.
You should only use AsyncStreamsText for text based communication where each message ends with an end of line character. For binary data you need to use AsyncStreams.
Receive the data and write it to a file with OutputStream.WriteBytes.