aspose file tools
The moose likes Android and the fly likes bluetooth streaming through anroid os cell phone Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "bluetooth streaming through anroid os cell phone" Watch "bluetooth streaming through anroid os cell phone" New topic
Author

bluetooth streaming through anroid os cell phone

yumna tariq
Greenhorn

Joined: May 31, 2011
Posts: 2
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 [Disk] Download
 Description
 Filesize 7 Kbytes
 Downloaded:  21 time(s)

 Filename BTinitservice.java [Disk] Download
 Description
 Filesize 15 Kbytes
 Downloaded:  18 time(s)

 Filename Devicelistactivity.java [Disk] Download
 Description
 Filesize 3 Kbytes
 Downloaded:  13 time(s)

 Filename Tcpconnect.java [Disk] Download
 Description
 Filesize 2 Kbytes
 Downloaded:  17 time(s)

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 4875

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...


JBoss In Action
yumna tariq
Greenhorn

Joined: May 31, 2011
Posts: 2
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

Joined: May 14, 2008
Posts: 4875

"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
 
 
subject: bluetooth streaming through anroid os cell phone
 
Threads others viewed
how to access bluetooth dongle through a j2se code
How i disable auto search bluetooth devices on Nokia E50-1?
Android TCP connection
J2ME deployment question
making a midlet on phone to access a servlet on pc
developer file tools