Hello All, First post so please be kind. I used Basic4PPC from Erel a long time ago (only ever used BASIC that once). When I looked for an Android compiler and saw "Erel" on B4A, I knew things would be nice. So, I have been looking at the Chat example for serial comms over Bluetooth. Although Chat works nicely when unchanged, I am wanting to modify this to see if I can send strings from a PC. I have written the PC code, so have full control over how this can be sent. I really have two questions here.
I am using v10.7 of B4A.
1. The IDE complains when I try to change "Private AStream As AsyncStreams" to "Private AStream As AstncstreamsText" saying this is an unknown type, "are you missing a library reference". I also tried to declare this in the Main section but had the same error.
2. If I don't try the Text version, I am unsure of the order of the first 4 bytes when using Prefix mode. I know Big and Little Endian, just not sure when B4A reads these in, does it call the first byte the most significant or the least? For example, if I have 6 bytes being sent, do I send 0,0,0,6 in Big Endian or Little Endian?
At the moment, I am not getting bytes across, but as the tutorials rightly state, there is no guarantee of the whole string being received before the code wants to place whatever has just arrived on a label for example.
I have a terminal program on the Android phone (Samsung Xcover4 with Android v7) to make sure the Bluetooth comms is actually working and that is very happy. I can send lots of text very easily, so the basic system appears to be working OK, as does the Chat program.
My lifelong code choice has been Pascal for 40 years and counting, so the BASIC language is very new to me and also the structure of the Activity/Main pages etc, so just looking for a push in the right direction.
Thank you to everyone in advance and especially Erel for such a nice product once again.
Dr Alec Butterworth (UK)
I am using v10.7 of B4A.
1. The IDE complains when I try to change "Private AStream As AsyncStreams" to "Private AStream As AstncstreamsText" saying this is an unknown type, "are you missing a library reference". I also tried to declare this in the Main section but had the same error.
2. If I don't try the Text version, I am unsure of the order of the first 4 bytes when using Prefix mode. I know Big and Little Endian, just not sure when B4A reads these in, does it call the first byte the most significant or the least? For example, if I have 6 bytes being sent, do I send 0,0,0,6 in Big Endian or Little Endian?
At the moment, I am not getting bytes across, but as the tutorials rightly state, there is no guarantee of the whole string being received before the code wants to place whatever has just arrived on a label for example.
I have a terminal program on the Android phone (Samsung Xcover4 with Android v7) to make sure the Bluetooth comms is actually working and that is very happy. I can send lots of text very easily, so the basic system appears to be working OK, as does the Chat program.
My lifelong code choice has been Pascal for 40 years and counting, so the BASIC language is very new to me and also the structure of the Activity/Main pages etc, so just looking for a push in the right direction.
Thank you to everyone in advance and especially Erel for such a nice product once again.
Dr Alec Butterworth (UK)