Android Tutorial Android Serial tutorial

defillo

Member
Licensed User
Longtime User
Connection refused

Nothing to do, got the same message with a galaxy s mini and a htc desire when trying to connect to a PC bluetooth interface. SPP profile present on the pc.
when I try to connect (connect, connect2 and connect3) i've always the same reply, connection refused. devices correctly paired without any problem.
Any suggestion? from googleing I've seen this appears to be a common problem..
 

defillo

Member
Licensed User
Longtime User
as usual

tried also between the two devices, tried also with a windows mobile device, always same result: java.io.IOexception.connection refused
Windows mobile device instead connects to the PC smoothly..
 

moster67

Expert
Licensed User
Longtime User
Are you using a cooked ROM by any chance? Sometimes, these cooked ROMs introduce small bugs which are not present on the official ROM. Happened to me a few times when developing for Windows Mobile.

tried also between the two devices, tried also with a windows mobile device, always same result: java.io.IOexception.connection refused
Windows mobile device instead connects to the PC smoothly..
 

defillo

Member
Licensed User
Longtime User
no special rom

Absolutely standard devices, both with factory shipped rom. no success at all..
 

pinoy_ako

Member
Licensed User
Longtime User
hi erel.
i tried running your given sample, it worked ok. also changes the object position correctly if i change the orientation of my phone.

but when i make my new project, and copy paste everything from your sample, everthing is working the same as the sample except from two things, 1. i can send serial data. txtSend is being cleared when i press btnSend button. but no data is being sent out from my phone. 2. when i change the orientation of my phone, objects in my sample project is not placed correctly. unlike your sample.

pls. advice.

thanks
 

pinoy_ako

Member
Licensed User
Longtime User
ah ok. i just thought there will be settings i need to adjust in the IDE. i just tick the serial lib in the library tab, added 4 objects, renamed the objects, and selected all the codes from your sample and copy paste it to my new project. and i get a different response. thats bad.
 

pinoy_ako

Member
Licensed User
Longtime User
hi erel.
another question about changing the position of the object when my phone orientation is change. in your serial sample, object adjust automatically when orientation is change. but i dont see the code where it is done. sorry very noob question. where is it in the serial sample, the code that change the object position. i tried to add button on your serial sample. and when i change my phone orientation, the existing object change, but my additional button doesn't change position. pls. advise.

thanks
 

pinoy_ako

Member
Licensed User
Longtime User
yes erel. i downloaded the serial project you provided. that is why i was able to compare a new project to a program provided by you. and it seems that even if the codes are the same (codes that we are editing using B4A), the output is not the same.

does it mean that there are other things that i need to set erel?

if yes. can you give me that thing i need to set just to make my object change position when i change my orientation.
 
Last edited:

pinoy_ako

Member
Licensed User
Longtime User
now i did add. and the new project changes position now with change in orientation. thanks for that. :sign0098:
the serial tx/rx is now working also after i use your layout file.

i will try to figure out the difference on the two layouts. that is hard to do.

thanks erel.
 

defillo

Member
Licensed User
Longtime User
Still not solved the problem.
As I bought this compiler just to deal with BT data exchange, I feel really disappointed. the lack of support is also another reason to be disappointed. The documentation regarding the various modules is 'as poor as possible' just giving some examples. for sure I don't pretend (for the cost) that it's similar to visual studio but at least that it works. If i download apps from the market that works with BT serial connection, they works! so for sure it is not an hardware problem. At present time this whole thing is (for me) totally unuseful. (and I've bought also the update.. sigh..)
:sign0161:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm sorry but I did my best to help you. I've tested the sample on several devices including HTC desire and it works fine.
Did you check the unfiltered logs for any other messages?
 

TomInAZ

New Member
Is there anyway to make serial via WiFi work easy? I am considering using one of the new XBee 802.11n shields with an Arduino Uno board, and will need a serial connection to make it work. Partly the reason I want to work with 802.11n is because I am not thrilled at the distance available with Bluetooth since it is only about 30 feet or less.
 

pinoy_ako

Member
Licensed User
Longtime User
I'm sorry but I did my best to help you. I've tested the sample on several devices including HTC desire and it works fine.
Did you check the unfiltered logs for any other messages?
true. i run the sample with htc desire and htc wildfire. the sample worked fine.
 

Similar Threads

  • Locked
  • Article
Android Tutorial Android JSON tutorial
Replies
90
Views
160K
  • Locked
  • Article
Android Tutorial SQL tutorial
Replies
161
Views
279K
  • Locked
  • Article
Android Tutorial GPS tutorial
Replies
310
Views
256K
Cookies are required to use this site. You must accept them to continue using the site. Learn more…