Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bluetooth streaming through anroid os cell phone

 
yumna tariq
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i am working on a bluetooth streaming application in an android based cell phone. the code that i have written should perform the following
1. chk if the bluetooth is available
2. power on the bluetooth
3. scan for bluetooth devices in the area
4.pair with one particular device (say device A)
5. establish connection with the A device
6. start recieving data from the paired device (the connection established is a streaming link so there is continuous data coming from the device A
7. the data is stored in a buffer (1024 bytes)
8. create a tcp connection (establish socket)
9.the data is then transmitted through this tcp socket to a website.
the steps 1 to 4 are being done manually so the code starts from the step 5
the whole communication is real time continuous. the code we have compiled does not have any syntex error in it but when we load the application in our cell phone the application is forced closed
there are four classes in the code where the main function is the btinit.
[[sources moved to attachments]]
Filename: btinit.java
Description:
File size: 7 Kbytes
[Download btinit.java] Download Attachment
Filename: BTinitservice.java
Description:
File size: 15 Kbytes
[Download BTinitservice.java] Download Attachment
Filename: Devicelistactivity.java
Description:
File size: 3 Kbytes
[Download Devicelistactivity.java] Download Attachment
Filename: Tcpconnect.java
Description:
File size: 2 Kbytes
[Download Tcpconnect.java] Download Attachment
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yumna, welcome to Java Ranch!

Have you looked at the log file in the phone to see if there is a stack trace there? Apps such as LogcatVW can show you the log. Or you can connect the phone to the SDK on your PC and use the SDK tools to examine the logs. That will at least tell you which line of code is causing the issue.

By the way, I moved your sources to attached files - lengthy, unformatted posts tend to scare off potential helpers...
 
yumna tariq
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.

Actually i am new to all this.
So what i am actually doing ryt now is that i give the path of C:\...sdk\platform-tools\ in cmd prompt .....but how do i check the log files and view where the errors could possibly be??? what are the commands??

Kindly help
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ryt"? UseRealWords

..but how do i check the log files and view where the errors could possibly be???

I hope that you are using Eclipse to do the dev work. Normally I don't let Eclipse do everything for me, but I found it much easier when starting with Android to let Eclipse do all of the work. So if you are using Eclipse there is a DDMS button in the toolbar - click that an a new perspective opens that shows you the logs and other things.

If you are not using Eclipse, you can still run DDMS from the command line, this should help:
http://developer.android.com/guide/developing/debugging/ddms.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic