Serial Example does not work?

bstrable

Member
Licensed User
Longtime User
If I run the "Android Serial tutorial" on my Archos 70 Internet Tablet, I get an error message:
"An error has occured in the sub:main_activity-resume (B4A line:29) Serial1.Listen 'listen for incoming connections
java.io.IOException: Not able to register SDP record for B4A"

I have bluetooth enabled, If I press "Yes" to continue, I can connect to my bluetooth device, and send text from the Archos. If I try to send anything to the Archos, I get this: "Sorry! Activity Serial Example (in application Serial Example) is not responding" Force Close or Wait.

I have Android version 2.1.4 (Android 2.2.1) on my device.

What am I missing?
 

bstrable

Member
Licensed User
Longtime User
Serial Example not working

I made sure all programs are stopped before running the example.

I have installed BlueTerm and used it with no problems.
Source Code here: http://pymasde.es/blueterm/

My reason for purchasing the enterprise edition was so I could easily create a program that would send and receive data to a custom machine control. Could this possibly be a bug in the Serial Library?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Upvote 0

bstrable

Member
Licensed User
Longtime User
Just tried powering down, even tried a hard reboot.
Serial Example doesn't work, BlueTerm still works though.

Has anyone tried this on a real device? If so, what devices work? I may have to look at returning the Archos a buying one that works with Basic4Android.

Thanks,
Brian
 
Upvote 0

bstrable

Member
Licensed User
Longtime User
Ok, I removed the call to listen, and I get no error!!:sign0060:

I had another problem however, in the Serial Example is states:

"TextReader.ReadLine is a blocking call. It waits till there is at least a single character to be read. Therefore we need to test TextReader.Ready if we don't want to block our application."

This is not true on my device. My device will hang until it receives a <CR> character. My terminal program on the PC was only sending a <LF> character when I press enter. I do not see where the <CR> is being checked for, but I may have to try using AsyncStreams.

Is there a Serial Chat example that uses AsyncStreams? Sorry, I am a vb programmer, and this is all a bit confusing to me.
Thanks,
Brian
 
Upvote 0

bstrable

Member
Licensed User
Longtime User
Ahh, nevermind. I figured out how to use AsyncStreams with serial. I will need to cleanup the code a bit, and I will post it for others. :sign0089:
 
Upvote 0

supriono

Member
Licensed User
Longtime User
bstrable can you share u program,,, my code serial using bluetooth error connect=false mybe u want to help me:sign0085:

i am a newbie in basic program...:sign0087:
 
Upvote 0
Top