Re: [android-developers] Re: Bluetooth connection that persists through activity life-cycle
I am using RFComm with the SPP. The device is a BT to serial module attached to a microcontroller that I also programmed. It sends a packet of 17 characters about 3 times a second. The device is identified by pairing first in the Settings app, then enumerating bonded devices in my app and letting the user select the appropriate device from a spinner. The socket is created with rfcomm and the UUID for SPP.
After looking at this more closely I realized that what I want to do really should be done in a service, not in an activity. So I am going to rewrite my BT functionality into a local service that binds to an activity.
On Thursday, August 22, 2013 8:01:00 PM UTC-6, mike digioia wrote:
-- After looking at this more closely I realized that what I want to do really should be done in a service, not in an activity. So I am going to rewrite my BT functionality into a local service that binds to an activity.
On Thursday, August 22, 2013 8:01:00 PM UTC-6, mike digioia wrote:
Which device, soc, stack, HCL are you using. Also are you using rfcomm with serial ?
On Aug 22, 2013 6:46 PM, "RLScott" <fixtha...@yahoo.com> wrote:Well, I have been working on this all day and I can't get it right. I have managed to make the BlueTooth connection persists through the temporary invocation of another activity, so that when I return to the first activity the BlueTooth thread is still running, the streams are still streaming, and the socket is still connected. But when I hit the home button and go to the Android desktop and then resume my app, the BlueTooth connection that needs to happen is stuck in a retry loop where the BluetoothSocket.connect always throws and exception: "Device or resource busy".
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home