[android-developers] Android Bluetooth Low Energy Direct Advertising Support

2017-01-31 Thread Oguzhan Türksoy
Hi, I would love to develop an Android app with Bluetooth Low Energy Direct 
Advertising. Do you know when this will be available with Android? I know 
that you can use your Android device as peripheral device now and also 
perform regular advertising, but I am really looking forward to using 
Direct Advertising "ADV_DIRECT_IND" to be able to perform Directed 
Advertising to one specific BT MAC address. Can you help me?

See reference in BT Core Spec:

Thanks!!

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/eff617b3-d128-4811-ac7f-7d07b93e25b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Bluetooth Increase Speed Performance

2016-06-06 Thread Devin Chen



I am trying to increase the transfer speed on android bluetooth. I 
experimented transferring a 2.7MB buffer from one android device to another 
using RFComm socket of the Bluetooth API (see code below). It took ~70 secs 
to complete. I compared this method against the "Share" via bluetooth 
function that came with the phone. The "Share" function gave exceptionally 
better performance (~15 secs to transfer a 2.7MB file). 

How does the "Share" function differ from using the Bluetooth API? How can 
I replicate the "Share" method to get optimized transfer speed?

Thanks,

Bluetooth API test code:

Server side - installed on one android device


Thanks,

Bluetooth API test code:


Server side - installed on one android device


BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mServerSocket = 
mBluetoothAdapter.listenUsingRfcommWithServiceRecord("DeviceName", MY_UUID);
socket = mServerSocket.accept();
mInStream = socket.getInputStream();int totalByte = 1;while (totalByte < 
2718720) {
int bytesAvailable = mInStream.available();
if (bytesAvailable > 0) {
totalByte += bytesAvailable;
byte[] buffer = new byte[bytesAvailable];
mInStream.read(buffer);
}}

Client side - installed on other android device


mClientSocket = device.createInsecureRfcommSocketToServiceRecord(
MY_UUID);
mClientSocket.connect();
mOutStream = mClientSocket.getOutputStream();byte byteValue = 0;for (int i=0; 
i<2718720; i++) {
byteValue++;
mOutStream.write(byteValue);}

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/89894d05-269a-4a6f-b9d0-124e77a590f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Bluetooth Profile AVRCP not working?

2016-05-06 Thread Mad
Hi everybody, i'm trying to connect a remote controller using bluetooth to 
my Android device and everytime the failure is the same, when the android 
device sends the SDP ( bluetooth service discovery protocol ) to the remote 
controller, the remote controller response with the attributes and just a 
second later the android device sends a disconnection request. Using A2DP 
profile instead of AVRCP all is working fine. On a ifruit device is working 
fine using AVRCP or A2DP profiles with the same remote controller.

The question is someone is using avrcp profile on android working well? 
This picture is a capture from the bluetooth HCI log



Everytime the behaviour is exactly the same the phone connects and after a 
second send the disconnect request if i'm using AVRCP profile only. It's 
not possible to use a bluetooth remote controller under Android?

I tested this under Android 6.0.1 and 5.1.1 with the same result. 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/517e3aa6-8af2-49e7-a281-a5b94ef08808%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android, Bluetooth HID Keyboard, 'recent apps' 'Consumer Device' code

2015-03-13 Thread Nadav
Use-case

   1. Implement a BlueTooth keyboard to connect to an android device
   2. BT Keyboard should be able to lunch the 'Recent apps 
   
http://img.wonderhowto.com/img/49/72/63550209324803/0/install-android-lollipop-recent-apps-menu-any-android.w654.jpg'
 
   menu
   

Problem description
To be able to support special keys, in accordance with this link 
https://source.android.com/devices/input/keyboard-devices.html, I have 
implemented a consumer device SDP implementing 'HID Consumer Page (0x0c)', 
I have found the 'HID Usage' values for all buttons needed, BUT the HID 
Usage value for opening the 'Recent apps' menu.

All is perfecty working BUT, opening the 'Recent apps' menu, br /
*what 'HID Usage value' should I use to open the 'Recent apps' menu?*

-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-15 Thread tom_mai78101
Then I don't understand why it's failing to connect. Most of the error 
exception log messages point to either UUID is wrong or I'm not cancelling 
BluetoothAdapter discovery.
 
I had looked back at the BluetoothChat SDK Sample, compared it with my 
codes, and see no significant differences other than that BluetoothChat has 
a Handler and I/O streams implemented.
 
If BluetoothDevice is connected to the BluetoothServerSocket, 
BluetoothServerSocket has accepted the connection, I have to immediately 
close both the server socket and the socket, just like what BluetoothChat 
SDK Sample did?
 
 

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-15 Thread tom_mai78101
Re-reading Android Reference, it said the UUID needs to be the same for 
both the server-side and the client-side. UUID.randomUUID() and 
BluetoothDevice.getUuids() are sure to fail.
 
I hate it, but it looks like I need to set up to 7 constant (final) UUIDs 
without generating them at compile-time. Will report back once I have some 
results.

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-15 Thread Kristopher Micinski
Why is generating them and sticking them in your code bad?  Why do you
hate it?  This is standard practice in many situations, so much that
IDEs do it for you sometimes.

Kris

On Fri, Feb 15, 2013 at 5:28 AM, tom_mai78101 tom.mai78...@gmail.com wrote:
 Re-reading Android Reference, it said the UUID needs to be the same for both
 the server-side and the client-side. UUID.randomUUID() and
 BluetoothDevice.getUuids() are sure to fail.

 I hate it, but it looks like I need to set up to 7 constant (final) UUIDs
 without generating them at compile-time. Will report back once I have some
 results.

 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-15 Thread tom_mai78101


 Why is generating them and sticking them in your code bad?  Why do you 
 hate it?  This is standard practice in many situations, so much that 
 IDEs do it for you sometimes. 

I disliked having to generate them and stick them into my code, for fear of 
security. And I never recalled my IDE having to auto-generate UUIDs for me. 
Now that you mentioned this being a standard practice, I don't know what to 
say about it. I probably didn't know about it in the first place.
 
As promised, the results are in. Yes, they work flawlessly. Yes, I hate to 
rewrite lots of code, including scrapping away a few files. And yes, I'm an 
idiot. :(
  

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-15 Thread Kristopher Micinski
Bluetooth isn't really all that secure of a protocol... You have to
instead implement that at the application layer.  (Although you can
read about Bluetooth encryption..)

Generating UUIDs is standard practice used all over the place in more
than Bluetooth: it's also used in many IDLs to identify interfaces
uniquely.

Your UUID is basically your app's signature (wrt Bluetooth), if it
doesn't match you won't be able to connect.

Kris


On Fri, Feb 15, 2013 at 11:50 AM, tom_mai78101 tom.mai78...@gmail.com wrote:
 Why is generating them and sticking them in your code bad?  Why do you
 hate it?  This is standard practice in many situations, so much that
 IDEs do it for you sometimes.

 I disliked having to generate them and stick them into my code, for fear of
 security. And I never recalled my IDE having to auto-generate UUIDs for me.
 Now that you mentioned this being a standard practice, I don't know what to
 say about it. I probably didn't know about it in the first place.

 As promised, the results are in. Yes, they work flawlessly. Yes, I hate to
 rewrite lots of code, including scrapping away a few files. And yes, I'm an
 idiot. :(


 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-15 Thread tom lee
Thanks for the info. I have now fully grasped the usage of UUIDs in an app.

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-14 Thread tom lee

 The UUID just says what port the Bluetooth Server is on.  I could have a
 server running on Bluetooth port 1.


Does this imply there's a way to specify different Bluetooth ports, if the
port(s) exists? I have never heard of Bluetooth using ports like TCP. If
you're just making an example, then please disregard this and above.

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-14 Thread Kristopher Micinski
That's not how it works: Bluetooth is built on top of RFCOMM, so it's
more like a serial channel.  It's merely presented with a socket like
interface to wrap the behavior.

Kris

On Thu, Feb 14, 2013 at 4:56 AM, tom lee tom.mai78...@gmail.com wrote:
 The UUID just says what port the Bluetooth Server is on.  I could have a
 server running on Bluetooth port 1.


 Does this imply there's a way to specify different Bluetooth ports, if the
 port(s) exists? I have never heard of Bluetooth using ports like TCP. If
 you're just making an example, then please disregard this and above.

 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-14 Thread bob
Yes, you can specify ports, but I think you may have to use Reflection on 
Android.


This will give you a connection to port 17:


*BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();*
*
*
*BluetoothDevice device = adapter.getRemoteDevice(address);*
*
*
*M**ethod m = device.getClass().getMethod(createInsecureRfcommSocket, new 
Class[] { int.class }); *
*
*
*socket = (BluetoothSocket) m.invoke(device,Integer.valueOf(17));*
*
*
*socket.connect();*

On a Windows server, you would change BT_PORT_ANY to a number between 1 and 
30.  

There is more info here:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa362899(v=vs.85).aspx

The valid range for requesting a specific RFCOMM port is 1 through 30.




On Thursday, February 14, 2013 3:56:41 AM UTC-6, tom_mai78101 wrote:

 The UUID just says what port the Bluetooth Server is on.  I could have a 
 server running on Bluetooth port 1. 


 Does this imply there's a way to specify different Bluetooth ports, if the 
 port(s) exists? I have never heard of Bluetooth using ports like TCP. If 
 you're just making an example, then please disregard this and above.


-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-14 Thread Kristopher Micinski
So there is port emulation you can use if you use reflection, but it's
kind of wacky and doesn't really work like vanilla TCP: so it's
helpful not to think of it that way.  You can read about it here:

http://www.palowireless.com/infotooth/tutorial/rfcomm.asp#Port%20Emulation%20Entity%20:%20Serial%20Flow%20Control

But still, in this example, I'm not sure why you'd want it?

kris

On Thu, Feb 14, 2013 at 10:10 AM, bob b...@coolfone.comze.com wrote:
 Yes, you can specify ports, but I think you may have to use Reflection on
 Android.


 This will give you a connection to port 17:


 BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();

 BluetoothDevice device = adapter.getRemoteDevice(address);

 Method m = device.getClass().getMethod(createInsecureRfcommSocket, new
 Class[] { int.class });

 socket = (BluetoothSocket) m.invoke(device,Integer.valueOf(17));

 socket.connect();

 On a Windows server, you would change BT_PORT_ANY to a number between 1 and
 30.

 There is more info here:

 http://msdn.microsoft.com/en-us/library/windows/desktop/aa362899(v=vs.85).aspx

 The valid range for requesting a specific RFCOMM port is 1 through 30.




 On Thursday, February 14, 2013 3:56:41 AM UTC-6, tom_mai78101 wrote:

 The UUID just says what port the Bluetooth Server is on.  I could have a
 server running on Bluetooth port 1.


 Does this imply there's a way to specify different Bluetooth ports, if the
 port(s) exists? I have never heard of Bluetooth using ports like TCP. If
 you're just making an example, then please disregard this and above.

 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-14 Thread tom_mai78101
I don't think ports matter in this case. In fact, I don't need ports. 
Thanks anyway.
 
*BEWARE: Wall of text*
 
I have now narrowed down my problem, hopefully reaching a conclusion soon. 
I'm having trouble with fetching one single UUID for two devices to use. 
Here's a picture of what I have logged by using android.util.Log.
 
http://i.imgur.com/t1QhdSk.png
 
Here I have two devices, namely HTC #1 and HTC #2, both of them running 
Android 2.3.5. Each device has my app installed and debugged at the moment. 
The app fetches a UUID from the other remote device using reflection 
method, invoking Bluetooth.getUuids(). (i.e.: Device #1 fetches a UUID from 
Device #2, while Device #2 fetches a UUID from Device #1.)
 
The UUID for both devices are shown in the red box. According to this 
answer here http://stackoverflow.com/a/14757884/1016891, it said I need 
to use the same UUID for use with
BluetoothAdapter.listenUsingRfcommWithServiceRecord() and 
BluetoothDevice.createRfcommSocketToServiceRecord().
 
However, I realized that using the same UUID that was pre-fetched using 
BluetoothDevice.getUuids() 
w/ reflection for both BluetoothServerSocket.accept() and 
BluetoothSocket.connect() is wrong. Either I have to use UUID.randomUUID() 
or BluetoothDevice.getUuids() w/ reflection in order to obtain a UUID. It 
doesn't matter if it's randomly-generated, or fetched from a remote device, 
I have to obtain a UUID from some place, don't I?
 
Below is the sectors of my application. The Accept and Connect sectors 
implement the Runnable interface.
 

http://i.imgur.com/SsWMUwR.png
It probably doesn't relate to the main problem at hand, but it shows how I 
was doing with the obtained UUID. The UUID is used in the Accept and 
Connect sectors, where it handles BluetoothServerSocket.accept() and 
BluetoothSocket.connect(), respectively.
 
*Now, summarizing the narrowed problem: What can I do in order to obtain 
the same UUID for two devices? *The code below doesn't work:
 

http://i.imgur.com/M5k0u5r.png
The variable, localData, is null after executing. What am I after? I'm 
trying to obtain the same UUID from one device (i.e.: Device #1), in which 
all other devices (i.e.: Device #2, Device #3, etc.) can also fetch after, 
and use it to connect to the first device (i.e.: Device #1).
 
 
 
 
 
 
 
 
 

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-13 Thread tom lee
After extensive researching on the Bluetooth Chat example, it all comes
down to using pre-determined UUIDs to connect to another device, the 1-to-1
way. However, that doesn't make it useful.

I need to not rely on pre-determined UUIDs, so that I'm able to connect
multiple devices together with Bluetooth, without having to generate as
much UUIDs as possible.

Have you ever tried doing non-deterministic UUID generation for Bluetooth
connections, using UUID.randomUUID() or similar methods?

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-13 Thread Kristopher Micinski
For many reasons, you really shouldn't be using non deterministic UUID
generation: it just doesn't make sense as to why you'd need it.  (Keep
in mind, phones can only be connected to two or three other things at
a time.)  What's your real problem?  I've had cases where I generate
10 UUIDs and then cycle through each in case one is taken, but never
the case where I keep generating them.

Kris

On Wed, Feb 13, 2013 at 5:24 AM, tom lee tom.mai78...@gmail.com wrote:
 After extensive researching on the Bluetooth Chat example, it all comes down
 to using pre-determined UUIDs to connect to another device, the 1-to-1 way.
 However, that doesn't make it useful.

 I need to not rely on pre-determined UUIDs, so that I'm able to connect
 multiple devices together with Bluetooth, without having to generate as much
 UUIDs as possible.

 Have you ever tried doing non-deterministic UUID generation for Bluetooth
 connections, using UUID.randomUUID() or similar methods?

 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-13 Thread bob
 

You just need one UUID for your app.  Use it on the server and the 
clients.  It basically tells the clients what Bluetooth port number on the 
server they need to connect to (from 1 to 31, I think).


You can use the uuidgen tool on Mac.  Here's a UUID I just made if you want 
it:


uuidgen

068F39DC-7012-4497-85B6-BD5C25D6AE58




On Wednesday, February 13, 2013 4:24:19 AM UTC-6, tom_mai78101 wrote:

 After extensive researching on the Bluetooth Chat example, it all comes 
 down to using pre-determined UUIDs to connect to another device, the 1-to-1 
 way. However, that doesn't make it useful.
  
 I need to not rely on pre-determined UUIDs, so that I'm able to connect 
 multiple devices together with Bluetooth, without having to generate as 
 much UUIDs as possible.
  
 Have you ever tried doing non-deterministic UUID generation for Bluetooth 
 connections, using UUID.randomUUID() or similar methods?


-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-13 Thread Kristopher Micinski
That's actually not quite right: if you have your app make multiple
connections then you do generally need multiple UUIDs.  However, if
you need only a single connection then sure.  My point is that you
should never need more than (theoretically) seven, as that's the size
of a BT piconet.

Kris

On Wed, Feb 13, 2013 at 10:17 AM, bob b...@coolfone.comze.com wrote:
 You just need one UUID for your app.  Use it on the server and the clients.
 It basically tells the clients what Bluetooth port number on the server they
 need to connect to (from 1 to 31, I think).


 You can use the uuidgen tool on Mac.  Here's a UUID I just made if you want
 it:


 uuidgen

 068F39DC-7012-4497-85B6-BD5C25D6AE58




 On Wednesday, February 13, 2013 4:24:19 AM UTC-6, tom_mai78101 wrote:

 After extensive researching on the Bluetooth Chat example, it all comes
 down to using pre-determined UUIDs to connect to another device, the 1-to-1
 way. However, that doesn't make it useful.

 I need to not rely on pre-determined UUIDs, so that I'm able to connect
 multiple devices together with Bluetooth, without having to generate as much
 UUIDs as possible.

 Have you ever tried doing non-deterministic UUID generation for Bluetooth
 connections, using UUID.randomUUID() or similar methods?

 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-13 Thread bob
 

I have made multiple connections to a single UUID.


It is like TCP.  


The UUID just says what port the Bluetooth Server is on.  I could have a 
server running on Bluetooth port 1.


Then I could make 2 or 3 simultaneous connections to it just like I can 
make 2 or 3 simultaneous connections to port 80 of Yahoo's web server.





On Wednesday, February 13, 2013 10:31:39 AM UTC-6, Kristopher Micinski 
wrote:

 That's actually not quite right: if you have your app make multiple 
 connections then you do generally need multiple UUIDs.  However, if 
 you need only a single connection then sure.  My point is that you 
 should never need more than (theoretically) seven, as that's the size 
 of a BT piconet. 

 Kris 

 On Wed, Feb 13, 2013 at 10:17 AM, bob b...@coolfone.comze.comjavascript: 
 wrote: 
  You just need one UUID for your app.  Use it on the server and the 
 clients. 
  It basically tells the clients what Bluetooth port number on the server 
 they 
  need to connect to (from 1 to 31, I think). 
  
  
  You can use the uuidgen tool on Mac.  Here's a UUID I just made if you 
 want 
  it: 
  
  
  uuidgen 
  
  068F39DC-7012-4497-85B6-BD5C25D6AE58 
  
  
  
  
  On Wednesday, February 13, 2013 4:24:19 AM UTC-6, tom_mai78101 wrote: 
  
  After extensive researching on the Bluetooth Chat example, it all comes 
  down to using pre-determined UUIDs to connect to another device, the 
 1-to-1 
  way. However, that doesn't make it useful. 
  
  I need to not rely on pre-determined UUIDs, so that I'm able to connect 
  multiple devices together with Bluetooth, without having to generate as 
 much 
  UUIDs as possible. 
  
  Have you ever tried doing non-deterministic UUID generation for 
 Bluetooth 
  connections, using UUID.randomUUID() or similar methods? 
  
  -- 
  -- 
  You received this message because you are subscribed to the Google 
  Groups Android Developers group. 
  To post to this group, send email to 
  android-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  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+unsubscr...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-13 Thread Kristopher Micinski
I know it's *nominally* implemented this way, I'm just saying that
hasn't been my experience across devices (bugs and all).  Though take
that with a grain of salt, my implementation was done over two years
ago now,

Kris

On Wed, Feb 13, 2013 at 12:25 PM, bob b...@coolfone.comze.com wrote:
 I have made multiple connections to a single UUID.


 It is like TCP.


 The UUID just says what port the Bluetooth Server is on.  I could have a
 server running on Bluetooth port 1.


 Then I could make 2 or 3 simultaneous connections to it just like I can make
 2 or 3 simultaneous connections to port 80 of Yahoo's web server.





 On Wednesday, February 13, 2013 10:31:39 AM UTC-6, Kristopher Micinski
 wrote:

 That's actually not quite right: if you have your app make multiple
 connections then you do generally need multiple UUIDs.  However, if
 you need only a single connection then sure.  My point is that you
 should never need more than (theoretically) seven, as that's the size
 of a BT piconet.

 Kris

 On Wed, Feb 13, 2013 at 10:17 AM, bob b...@coolfone.comze.com wrote:
  You just need one UUID for your app.  Use it on the server and the
  clients.
  It basically tells the clients what Bluetooth port number on the server
  they
  need to connect to (from 1 to 31, I think).
 
 
  You can use the uuidgen tool on Mac.  Here's a UUID I just made if you
  want
  it:
 
 
  uuidgen
 
  068F39DC-7012-4497-85B6-BD5C25D6AE58
 
 
 
 
  On Wednesday, February 13, 2013 4:24:19 AM UTC-6, tom_mai78101 wrote:
 
  After extensive researching on the Bluetooth Chat example, it all comes
  down to using pre-determined UUIDs to connect to another device, the
  1-to-1
  way. However, that doesn't make it useful.
 
  I need to not rely on pre-determined UUIDs, so that I'm able to connect
  multiple devices together with Bluetooth, without having to generate as
  much
  UUIDs as possible.
 
  Have you ever tried doing non-deterministic UUID generation for
  Bluetooth
  connections, using UUID.randomUUID() or similar methods?
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-d...@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@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+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 --
 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+unsubscr...@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+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-08 Thread tom lee
I just tried. The connection is still refused. I don't think the result was
affected by the timeout, since the timeout error was reported in the Logcat
after the connection was reported to be refused first.

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Android Bluetooth: I get Connection Refused after unpairing two devices, invoke user pairing, and accepting/listening connections.

2013-02-08 Thread bob
 

Why not try the Bluetooth Chat Sample and see if that works?



On Friday, February 8, 2013 4:22:06 AM UTC-6, tom_mai78101 wrote:

 I just tried. The connection is still refused. I don't think the result 
 was affected by the timeout, since the timeout error was reported in the 
 Logcat after the connection was reported to be refused first. 

-- 
-- 
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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers]android bluetooth multi-connect one after another

2012-12-10 Thread akash roy
i have posted this because its  not working like that.


On Mon, Dec 10, 2012 at 12:47 PM, gjs garyjamessi...@gmail.com wrote:

 Hi,

 Then concentrate on getting 1 or 2 devices working with -

 mChatService.connect(device);

 Regards

 On Sunday, December 9, 2012 1:19:08 AM UTC+11, akash roy wrote:

 please have a look on it..thankyou.



 On Sat, Dec 8, 2012 at 9:26 AM, akash roy akashr...@gmail.com wrote:

  **

 here i am trying to connect multiple devices one after another at one
 go. now if it connects to a device it will send the message else it will
 try to connect the next paired device. here the main problem is that its
 not connecting any device rather getting skipped one after other , before
 they get connected to each other.

 --**--**
 -

 for( BluetoothDevice device : PairedDevice)
 {
 mChatService.connect(device);
 try
 {
 SendMessage(message); //message is a string object
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }

 --**--**--




 --
 *AKASH ROY*
 *3RD YEAR
 *
 *COMPUTER SCIENCE AND ENGG.*
 *N.I.T. DURGAPUR*
 *
 *

   --
 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+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
*AKASH ROY*
*3RD YEAR
*
*COMPUTER SCIENCE AND ENGG.*
*N.I.T. DURGAPUR*
*
*

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers]android bluetooth multi-connect one after another

2012-12-09 Thread gjs
Hi,

Then concentrate on getting 1 or 2 devices working with -

mChatService.connect(device);

Regards

On Sunday, December 9, 2012 1:19:08 AM UTC+11, akash roy wrote:

 please have a look on it..thankyou.
  


 On Sat, Dec 8, 2012 at 9:26 AM, akash roy akashr...@gmail.comjavascript:
  wrote:

  **

 here i am trying to connect multiple devices one after another at one go. 
 now if it connects to a device it will send the message else it will try to 
 connect the next paired device. here the main problem is that its not 
 connecting any device rather getting skipped one after other , before they 
 get connected to each other.


 -

 for( BluetoothDevice device : PairedDevice)
 {
 mChatService.connect(device);
 try
 {
 SendMessage(message); //message is a string object
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }

 --

  


 -- 
 *AKASH ROY*
 *3RD YEAR
 *
 *COMPUTER SCIENCE AND ENGG.*
 *N.I.T. DURGAPUR*
 *
 *

  

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers]android bluetooth multi-connect one after another

2012-12-08 Thread akash roy
please have a look on it..thankyou.



On Sat, Dec 8, 2012 at 9:26 AM, akash roy akashroy.n...@gmail.com wrote:

  **

 here i am trying to connect multiple devices one after another at one go.
 now if it connects to a device it will send the message else it will try to
 connect the next paired device. here the main problem is that its not
 connecting any device rather getting skipped one after other , before they
 get connected to each other.


 -

 for( BluetoothDevice device : PairedDevice)
 {
 mChatService.connect(device);
 try
 {
 SendMessage(message); //message is a string object
 }
 catch(Exception e)
 {
 e.printStackTrace();
 }
 }

 --




-- 
*AKASH ROY*
*3RD YEAR
*
*COMPUTER SCIENCE AND ENGG.*
*N.I.T. DURGAPUR*
*
*

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers]android bluetooth multi-connect one after another

2012-12-07 Thread akash roy
 **

here i am trying to connect multiple devices one after another at one go.
now if it connects to a device it will send the message else it will try to
connect the next paired device. here the main problem is that its not
connecting any device rather getting skipped one after other , before they
get connected to each other.

-

for( BluetoothDevice device : PairedDevice)
{
mChatService.connect(device);
try
{
SendMessage(message); //message is a string object
}
catch(Exception e)
{
e.printStackTrace();
}
}

--

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Bluetooth Features

2012-12-04 Thread fahad mullaji
Hi,

Can we explore other device's content once we pair device with our device
using Android Bluetooth package?

And get files from other device?

Thanks and Regards
Fahad Mullaji

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Bluetooth Authorization

2012-11-28 Thread dct
 I am working on an application that attempts to make a Bluetooth 
connection between an Android tablet and a custom device. The SDK of the 
custom device requires that properties pertaining to authentication, 
authorization, and encryption are set. I know I can use various 
versions of the listenUsingRfcommWithServiceRecord() method to set the 
authentication and encryption properties on the android side, but how does 
one go about viewing/changing the authorization properties?
Thank you for your time. 

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Bluetooth Device Picker Usage

2012-10-21 Thread Avinash Gupta
 

My Application required bluetooth connectivity. And in the first phase I am 
trying to open up the standard Activity *Bluetooth Device Picker* to help 
user scan for new device or chose a device from the list.

The problem is that I am unable to get any working example for the 
bluetooth device picker. The task is simple. To start an Activity with 
Intent *android.bluetooth.devicepicker.action.LAUNCH*

And the device picker is opening without any problem.

But the device picker requires four *extras* and I am unable to figure out 
the exact parameters for two of the extras listed below.

.putExtra(android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE,com.extreme.controlcenter

.putExtra(android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS,com.extreme.controlcenter.WelcomeActivity)

What I thought the parameters should be that 

*android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE*

should have the name of my package, so I passed that only. That is *
com.extreme.controlcenter*

The second should be the name of the component that must receive the 
broadcast that is done after a device is selected. Here I tried putting the 
name of the class that has the *onReceive()* function.

But the problem is that the onReceive() function is NOT getting called when 
a device is picked in device picker!

public void onReceive(Context context, Intent intent) {

String action = intent.getAction();

//Device Selected on Device Picker

if(android.bluetooth.devicepicker.action.DEVICE_SELECTED.equals(action)) {
//context.unregisterReceiver(this);

BluetoothDevice device = (BluetoothDevice) 
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

Toast.makeText(context, device + device.getAddress(), 
Toast.LENGTH_SHORT).show();

String MAC = device.getAddress();
//Log.d(my, MAC);

Intent intent2 = new Intent(WelcomeActivity.this, 
ControlActivity.class);
intent2.putExtra(EXTRA_DEVICE_ADDRESS, MAC);
startActivity(intent2);
}


};

I have created an *Intent filter* and registered a receive in the 
onCreate() of the main Activity

 // Register the BroadcastReceiver
IntentFilter filter = new 
IntentFilter(android.bluetooth.devicepicker.action.DEVICE_SELECTED);


registerReceiver(mReceiver, filter); 

One thing is that if I don't provide those two extras, the *Broadcast*event is 
received successfully. But that code only runs on my TAB, but same 
is crashing in cell phone. So I think providing those two extras are 
mandatory. 

Thanks in Advance !

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android Bluetooth party

2012-09-06 Thread Quentin MOURCOU
Hi,

Kristopher, you said the hard limit is seven nodes, but I have a similar 
problem. I'm trying to connect 6 bluetooth devices which uses the HSP/HFP 
profiles on an Android phone but it seems to doesn't work on Android 2.3 (I 
tried with Android 2.3.4, 2.3.5 and 2.3.6 on different devices) but works 
on Android 2.2 and 4.0. So do you know if there is any software limitation 
too ? I'm just trying to open the RFCOMM socket but in Android 2.3, when 
it's time to connect the third device, I have an ACL disconnection which 
not appear on Android 2.2 and 4.0 ...

Thanks,

Quentin  

Le mercredi 5 septembre 2012 22:02:10 UTC+2, Kristopher Micinski a écrit :

 It is not, Bluetooth piconets enforce a hard limit of seven nodes. 

 You can try more exotic routing techniques and get the same effect.. 

 it doesn't work very well. 

 kris 

 On Wed, Sep 5, 2012 at 3:56 PM, bob b...@coolfone.comze.com javascript: 
 wrote: 
  Anyone know if it is possible to have 16 Android devices simultaneously 
  connected to the same Bluetooth server? 
  
  
  Thanks. 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Android Developers group. 
  To post to this group, send email to 
  android-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android Bluetooth party

2012-09-06 Thread Kristopher Micinski
I've discussed this various places, this is one of them:

http://stackoverflow.com/questions/10963614/android-bluetooth-chat-sample-app-multiple-connections/10963812#10963812

The basic story is, yes, more than a few nodes is quite hard because
of some soft limitations and (iirc) flaky bluetooth controllers,..

kris

On Thu, Sep 6, 2012 at 8:38 AM, Quentin MOURCOU qmour...@gmail.com wrote:
 Hi,

 Kristopher, you said the hard limit is seven nodes, but I have a similar
 problem. I'm trying to connect 6 bluetooth devices which uses the HSP/HFP
 profiles on an Android phone but it seems to doesn't work on Android 2.3 (I
 tried with Android 2.3.4, 2.3.5 and 2.3.6 on different devices) but works on
 Android 2.2 and 4.0. So do you know if there is any software limitation too
 ? I'm just trying to open the RFCOMM socket but in Android 2.3, when it's
 time to connect the third device, I have an ACL disconnection which not
 appear on Android 2.2 and 4.0 ...

 Thanks,

 Quentin

 Le mercredi 5 septembre 2012 22:02:10 UTC+2, Kristopher Micinski a écrit :

 It is not, Bluetooth piconets enforce a hard limit of seven nodes.

 You can try more exotic routing techniques and get the same effect..

 it doesn't work very well.

 kris

 On Wed, Sep 5, 2012 at 3:56 PM, bob b...@coolfone.comze.com wrote:
  Anyone know if it is possible to have 16 Android devices simultaneously
  connected to the same Bluetooth server?
 
 
  Thanks.
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-d...@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Bluetooth party

2012-09-06 Thread Quentin MOURCOU
Ok thank you, that's what I thought.

Quentin

Le jeudi 6 septembre 2012 15:28:29 UTC+2, Kristopher Micinski a écrit :

 I've discussed this various places, this is one of them: 


 http://stackoverflow.com/questions/10963614/android-bluetooth-chat-sample-app-multiple-connections/10963812#10963812
  

 The basic story is, yes, more than a few nodes is quite hard because 
 of some soft limitations and (iirc) flaky bluetooth controllers,.. 

 kris 

 On Thu, Sep 6, 2012 at 8:38 AM, Quentin MOURCOU 
 qmou...@gmail.comjavascript: 
 wrote: 
  Hi, 
  
  Kristopher, you said the hard limit is seven nodes, but I have a similar 
  problem. I'm trying to connect 6 bluetooth devices which uses the 
 HSP/HFP 
  profiles on an Android phone but it seems to doesn't work on Android 2.3 
 (I 
  tried with Android 2.3.4, 2.3.5 and 2.3.6 on different devices) but 
 works on 
  Android 2.2 and 4.0. So do you know if there is any software limitation 
 too 
  ? I'm just trying to open the RFCOMM socket but in Android 2.3, when 
 it's 
  time to connect the third device, I have an ACL disconnection which not 
  appear on Android 2.2 and 4.0 ... 
  
  Thanks, 
  
  Quentin 
  
  Le mercredi 5 septembre 2012 22:02:10 UTC+2, Kristopher Micinski a écrit 
 : 
  
  It is not, Bluetooth piconets enforce a hard limit of seven nodes. 
  
  You can try more exotic routing techniques and get the same effect.. 
  
  it doesn't work very well. 
  
  kris 
  
  On Wed, Sep 5, 2012 at 3:56 PM, bob b...@coolfone.comze.com wrote: 
   Anyone know if it is possible to have 16 Android devices 
 simultaneously 
   connected to the same Bluetooth server? 
   
   
   Thanks. 
   
   -- 
   You received this message because you are subscribed to the Google 
   Groups Android Developers group. 
   To post to this group, send email to android-d...@googlegroups.com 
   To unsubscribe from this group, send email to 
   android-developers+unsubscr...@googlegroups.com javascript: 
   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 post to this group, send email to 
  android-d...@googlegroups.comjavascript: 
  To unsubscribe from this group, send email to 
  android-developers+unsubscr...@googlegroups.com javascript: 
  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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android Bluetooth party

2012-09-05 Thread bob
 

Anyone know if it is possible to have 16 Android devices simultaneously 
connected to the same Bluetooth server?


Thanks.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Android Bluetooth party

2012-09-05 Thread Kristopher Micinski
It is not, Bluetooth piconets enforce a hard limit of seven nodes.

You can try more exotic routing techniques and get the same effect..

it doesn't work very well.

kris

On Wed, Sep 5, 2012 at 3:56 PM, bob b...@coolfone.comze.com wrote:
 Anyone know if it is possible to have 16 Android devices simultaneously
 connected to the same Bluetooth server?


 Thanks.

 --
 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+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] 【Android】bluetooth file transfer

2012-06-18 Thread weixiang
hello,I am Tester using InstrumetationTestCase to Test, and i want to write 
some case about file transfer,However,when run,logcat display  some abnormal
below is my code,debug process,  the defect pointer is 
  while(bis.read() != -1)
{ 
if(bis.read(mybytearray) == -1) break;

for(int i = 0 ; i  mybytearray.length ; i++)
{ 
Log.e(weixiang --!!!,start Write);
outStream.write(mybytearray[i]);
} 

}
but I don't know how to fixed it~
 
***
public void testBTFileTransfer() throws Exception {
BluetoothDevice 
remotebtdevice=mybluetooth.getRemoteDevice(searchBtDeviceMAC_pcsuit);
String sdcard=Environment.getExternalStorageDirectory()+/;
//String filepath= sdcard + Wifi_Module_Test/+1.mp3;
String filepath= sdcard + Wifi_Module_Test/+1.mp3;
Log.e(# weixiang Tag ###, filepath);
if(remotebtdevice.getBondState() != BluetoothDevice.BOND_BONDED)
{
testBTPairresult_accept();
}
  new FileTransferThread(remotebtdevice).start();
sleep(300*1000);  
}
private class FileTransferThread extends Thread
{
private final BluetoothDevice mydevice;
private final BluetoothSocket mysocket;
//static final String SPP_UUID = 1106--1000-8000-00805F9B34FB;
static final String SPP_UUID =1105--1000-8000-00805f9b34fb;

//private final OutputStream outStream;
private final UUID uuid;
private  InputStream mmInStream;   
private  OutputStream mmOutStream;
public FileTransferThread(BluetoothDevice device) throws IOException{
mydevice=device;
BluetoothSocket temsocket=null;
uuid= UUID.fromString(SPP_UUID);
//InputStream tmpIn = null;
//OutputStream tmpOut = null;
try{

temsocket=device.createRfcommSocketToServiceRecord(uuid);

}catch (IOException e){}
mysocket=temsocket;
}


public void run()
{

// add new socket Access
try {
mysocket.connect();
} catch (IOException connectException) {

try{
mysocket.close();
} catch(IOException closeException) {}
// TODO Auto-generated catch block
}

 //below is for Read/Write stream
 File myfile=new File(filepath);
 byte[] mybytearray = new byte[(int)myfile.length()]; 
 Log.e(TAG,file length() = + (int)myfile.length());
 OutputStream outStream = null;
 FileInputStream fis = null;
 
 
 //init outputstream
 try{
 outStream =mysocket.getOutputStream();
 Log.e(tag1, outputstream create success);
 }catch (IOException e)
 {
 Log.e(tag1, ON RESUME: Output stream creation failed.);
 }
 
 //init inputstream
try {
fis = new FileInputStream(myfile);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}   


 Log.e(TAG,fis created);
 
 BufferedInputStream bis = new BufferedInputStream(fis,4*1024 ); 
 Log.e(TAG,bis created success); 
 
 /*
 try {
bis.read(mybytearray,0,mybytearray.length);

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
*/


 
 try {

 
 while(bis.read() != -1)
 {  
 if(bis.read(mybytearray) == -1) break;
 
 for(int i = 0 ; i  mybytearray.length ; i++)
 {
 Log.e(weixiang   --!!!,start Write);
 outStream.write(mybytearray[i]);
 } 
 
 }
 //Log.e(weixiang   --!!!,read over!!!);

 /*
 while(bis.read()!= -1)
 {
 outStream.write(mybytearray, 0, mybytearray.length);
 Log.e(weixiang   --!!!,start Write);
 }
 /*
 for(int i = 0 ; i  mybytearray.length ; i++){ } 
 */
 
 
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 
 Log.d(TAG,BYTES WRITTEN to OUTSTREAM of socket);   
 try {
outStream.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} Log.d(TAG,bytes flushed); 
 try {
outStream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 try {
mysocket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 Log.d(TAG,socket closed);  
 
 
} 
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this 

[android-developers] Android Bluetooth l2cap socket bind()

2012-04-17 Thread Sam
Android version: 2.3.7

Kernel version: 2.6.35-14-CyanogenMod-Arco-Kalim arco@tuxbox #1

Mod version: CyanogenMod-7.1.0.1-click

The device has been fully rooted.

I have added piece of code in my project

which taken from Bluez Utils in hidd.c.

The code is the following:

if (bind(sk, (struct sockaddr *) addr, sizeof(addr))  0) {
close(sk);
return -1;
}


bind() keeps returning -1.

I added a line(DisablePlugins = input) to the bluetooth configuration
in my Android device /system/etc/bluetooth/main.conf

The information I have is: sk:37

(struct sockaddr *) addr=0x44597e90

sizeof(addr)=12

errno:13

Reason: Permission Denied.

Can anyone help? If you need to know in more detail, feel free to let
me know.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android bluetooth communication

2012-04-02 Thread dusslk
I need to send 10-bit data from the Analog to digital converter(ADC)
from a dsPIC at 2Mbps through UART interface, to the bluetooth module.
Then the bluetooth module should read this data through its UART
interface and transmit this data via bluetooth which will be finally
received by an Android phone. An application in the phone will take
this data and plot a waveform on the screen.

So basically the phone will recieve data at 2 Mbps via bluetooth. Is
this practically possible ?

Most bluetooth modules say they can transfer data only around 300 kbps
using RFCOMM protocol. To go upto 2Mbps it is needed to use the HCI
protocol. So then can the Android phone read data sent in HCI
protocol. Is there any support available. Currently all transfers done
in Android which I found are in RFCOMM.

Is there any way either using RFCOMM or any other means to for Android
phone to aquire atleast 1.5 Mbps data via bluetooth.

Thank you,
Best Regards.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers]Android Bluetooth HID profile

2012-03-29 Thread I-Sheng Lin
Hi Android developers,

I have done that the porting of HID profile onto Android 2.3 as the host.

My Android device(Gingerbread) now is able to connect to the Bluetooth
mouse/kb and it works really nice!

However, my question is that it seems very lack of information about to
make Android device as the client side.

For example, simulate the Android device can work as the KB/mouse and
connect it to the other Android device through Bluetooth.

I know that Cyanogenmod allows us to do it and yes, I have a sample code
and it works perfectly.

Unfortunately, when I install the code onto my generic Android 2.3, the
Bluetooth can be connected but drop right after being connected.

Does anyone know why this happened on Android 2.3?

Any clue will be highly appreciated.

-- 
I-Sheng Lin(Sam)

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers]Android Bluetooth HID profile

2012-03-29 Thread Justin Anderson
Please don't post the same message multiple times...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Thu, Mar 29, 2012 at 3:43 AM, I-Sheng Lin ckjboy2...@gmail.com wrote:

 Hi Android developers,

 I have done that the porting of HID profile onto Android 2.3 as the host.

 My Android device(Gingerbread) now is able to connect to the Bluetooth
 mouse/kb and it works really nice!

 However, my question is that it seems very lack of information about to
 make Android device as the client side.

 For example, simulate the Android device can work as the KB/mouse and
 connect it to the other Android device through Bluetooth.

 I know that Cyanogenmod allows us to do it and yes, I have a sample code
 and it works perfectly.

 Unfortunately, when I install the code onto my generic Android 2.3, the
 Bluetooth can be connected but drop right after being connected.

 Does anyone know why this happened on Android 2.3?

 Any clue will be highly appreciated.

 --
 I-Sheng Lin(Sam)

 --
 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+unsubscr...@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 post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] android bluetooth send string other device (like j2me,iphone,balcberry ...etc)

2011-10-24 Thread pankaj sharma
Hi,
i m newbie in android devlopment. and i am tryning to connect and
send string continous other devices with bluetooth.


 pls help me  .

 thnks

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] android bluetooth send string other device (like j2me,iphone,balcberry ...etc)

2011-10-24 Thread TreKing
On Mon, Oct 24, 2011 at 5:21 AM, pankaj sharma pankajs22...@gmail.comwrote:

 Hi,
i m newbie in android devlopment. and i am tryning to connect and
 send string continous other devices with bluetooth.


  pls help me  .

  thnks


http://catb.org/~esr/faqs/smart-questions.html

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] android bluetooth

2011-09-12 Thread miundroid
Hi all,

I was wondering if anyone knows the data frame protocol that android
uses by default.
Or if anyone knows of a technical document with this information I'd
be more than happy to read it for myself.

I need to know what exactly the data frame looks like, for example...

8-data bits | 1 Odd Parity bit | 2 stop bits

etc...

Im transmitting data to a microcontroller from my phone but I'm
getting different values from what I am sending and I suspect it may
be because the data frame the microcontroller is set to receive is
different than what the bluetooth is sending.
Any help would be greatly appreciated.
Thanks!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android - Bluetooth communication with Lego NXT brick

2011-05-18 Thread damienb2
Hello everybody!

i'm developping an android application to remote control a lego
mindstorm NXT.
The NXT let the mobile control motors, and sensors (ultrasonic, light,
temperature,...)
The android mobile is linked to the nxt by bluetooth.

I success in controling the motors, but now i've got one problem :
accessing the sensors.
I tried to get informations from the ultrasonic sensor since a long
time, but no success!

how i do it :

1) i send first the information my ultrasonic sensor is linked to the
port 1 according to instructions of the bluetooth Lego NXT developper
kit:

setUp

void initUltrasonicSensor(int sensorPort){

byte[] message = new byte[5];

message[0]= LCPMessage.DIRECT_COMMAND_NOREPLY;  // DirectCommand, byte
constant : 0x00
message[1]= LCPMessage.SET_INPUT_MODE;  // 
SetInputMode, byte
constant : 0x05
message[2] =  (byte) sensorPort;// 
Input Port, 0 1 2 or 3
message[3]= typePort ;  
// Type Port, ultrasonic = 0x0B
message[4]= (byte) 0x00;
// Sensor mode

sendMessage(message);
}


/**
 * Sends a message on the opened OutputStream
 * @param message, the message as a byte array
 */
void sendMessage(byte[] message) throws IOException {
if (nxtOutputStream == null)
throw new IOException();

// send message length
int messageLength = message.length;
nxtOutputStream.write(messageLength);
nxtOutputStream.write(messageLength  8);
nxtOutputStream.write(message, 0, message.length);
}



2) then, i send the informtion get distance from the ultrasonic
sensor :

public void getInputValues(int sensor) {

byte[] request = new byte[3];

request[0] = LCPMessage.DIRECT_COMMAND_REPLY;   // DirectCommand, byte
constant : 0x00
request[1] = LCPMessage.GET_INPUT_VALUES;   // 
getInputValues, byte
constant : 0x07
request[2] = (byte) sensor; 
// input port, 0 1 2 or 3

sendMessage(message);
}


3) when i reveived the reply information from the NXT, i get it :

05-18 10:33:53.652: INFO/(8885): Values received from
UltrasonicSensor : [ 2 7 0 0 1 0 B 0 0 0 0 0 0 0 0 0 ]

the expected response, according to instructions of the bluetooth Lego
NXT developper kit:
byte 0: 0x02
byte 1: 0x07
byte 2: status byte
byte 3: input port (range: 0-3)
byte 4: valid? (boolean TRUE if new data value should be seen as valid
data)
byte 5: calibrated? (boolean TRUE if calibration file found and used
for Calibrated Value field below)
byte 6: sensor type (enumerated)
byte 7: sensor mode (enumerated)
byte 8-9: Row A/D value(UWORD; device dependent)
byte 10-11: Normalized A/D value(UWORD; device dependent; Range:
0-1023)
byte 12-13: Scaled value (SWORD; mode dependent)
byte 14-15: Calibrated value (SWORD; value scaled according to
calibration. CURENTLY UNUSED.)


So i'm supposed to get the information about the distance from the 8-9
byte, but i get 0!

Could anyone help me ?
thanks for all!
(sorry for my english, i'm french!)

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android bluetooth api connect to multiple devices at the same time

2010-12-18 Thread 苗鹏
It is possible to connect simultaneously to multiple bluetooth devices?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] android bluetooth

2010-11-29 Thread Jags
I am using an handsfree bluetooth handset in ndroid device. i need to
program the handsfree in my application. Firstly, when i create a beep
sound it should be heard in handsfree. When i press some button (in
fact 1 out of 2 buttons, I need yes or no answer) in handsfree and the
appropriate answer is received by my application

is this possible ? how to do this ?

regards

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] android bluetooth

2010-11-29 Thread Jags
I am using an handsfree bluetooth handset in ndroid device. i need to
program the handsfree in my application. Firstly, when i create a beep
sound it should be heard in handsfree. When i press some button (in
fact 1 out of 2 buttons, I need yes or no answer) in handsfree and the
appropriate answer is received by my application

is this possible ? how to do this ?

regards

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Bluetooth : read service records / getRemoteServiceRecord

2010-10-28 Thread Radu

Hello All,

I am working on developing a HID Bluetooth Driver, that would allow an
user to connect a bluetooth keyboard or mouse. So far I was able to
achieve this goal using JNI, and a C BlueZ interface, but there were
compatibility problems: the software only worked on a few devices.

As Bluetooth support was introduced from Android 2.0, I was thinking
to give it a try. I am able to manage the L2CAP connections using the
Android SDK, but I have a few problems so far: 1)- how to read the
STANDARD (!!) Bluetooth Device class. Android offers some custom
Bluetooth Class values that are useless 2)- how to read a Service
record (I am interested in the Report Descriptor, attribute ID 0x206).
Basically I need to do exactly what getRemoteServiceRecord does.

Is it possible in the current form of the Bluetooth SDK? Should I
consider using reflection on the bluetooth service running on the
device?

Please note that I would prefer to go as Standard as possible, to
avoid any other compatibility issues.

Thank you.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] android bluetooth client program

2010-07-26 Thread KwangWon
I wonder what would be the right java android bluetooth rfcomm client
code to connect to the following python bluetooth server program.
Thanks in advance.


#
# The following is the PyBluez-0.18 simple example : rfcomm-server.py
#

# desc: simple demonstration of a server application that uses RFCOMM
sockets
#
# $Id: rfcomm-server.py 518 2007-08-10 07:20:07Z albert $

from bluetooth import *

server_sock=BluetoothSocket( RFCOMM )
server_sock.bind((,PORT_ANY))
server_sock.listen(1)

port = server_sock.getsockname()[1]

uuid = 94f39d29-7d6d-437d-973b-fba39e49d4ee

advertise_service( server_sock, SampleServer,
   service_id = uuid,
   service_classes = [ uuid, SERIAL_PORT_CLASS ],
   profiles = [ SERIAL_PORT_PROFILE ],
#   protocols = [ OBEX_UUID ]
)

print Waiting for connection on RFCOMM channel %d % port

client_sock, client_info = server_sock.accept()
print Accepted connection from , client_info

try:
while True:
data = client_sock.recv(1024)
if len(data) == 0: break
print received [%s] % data
except IOError:
pass

print disconnected

client_sock.close()
server_sock.close()
print all done

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android Bluetooth Development - Problem connecting

2010-03-17 Thread philDev
@moderator please excuse my first mail, I hit the wrong button.

Hi everybody,

I'm trying for hours and couldn't find an answer anywhere online nor
in my Logs. I'm trying to establisch an RFCOMM Link by Bluetooth
between an external Device that implements the SPP 1.04 Profile. Here
is the output from sdptool:

sudo sdptool browse
Inquiring ...

Browsing 00:0B:0D:8E:D4:33 ...
Service Name: SPP slave
Service Description: Bluetooth SPP V1.04
Service RecHandle: 0x1
Service Class ID List:
  Serial Port (0x1101)
Protocol Descriptor List:
  L2CAP (0x0100)
  RFCOMM (0x0003)
Channel: 1
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:0x6a
  base_offset: 0x100

The Device just provides this and doesn't  have any input or screen.
And it does work with Linux etc.

I'm using the following Code in order to establish an Connection:

UUID is set to SSDP UUID (16bit UUID = 1101)
private static final UUID MY_UUID =
UUID.fromString(1101--1000-8000-00805F9B34FB);
private static String address = 00:0B:0D:8E:D4:33;

This happens in onCreate():
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

Then in onResume:
 //Starting an discovery
mBluetoothAdapter.startDiscovery();
//getting the device
BluetoothDevice device = 
mBluetoothAdapter.getRemoteDevice(address);
Log.e(TAG, device.getName() +  connected);

   //establishing socket
   try {
btSocket = 
device.createRfcommSocketToServiceRecord(MY_UUID);
} catch (IOException e) {
Log.e(TAG, ON RESUME: Socket creation failed., e);
}
Log.e(TAG, TRYING TO CONNECT);

   //Connecting the socket
  try {
btSocket.connect();

Log .e(TAG,ON RESUME: BT connection established, 
data transfer
link open.);
} catch (IOException e) {
  //handling of Exception output etc.
   }
If I look at the dump, everything works until I try to connect to the
socket and I don't understand why it isn't working after that. Here
ist the dump Look for the TAG ThinBTClient for Log Output.


E/THINBTCLIENT( 5991): +++ ON CREATE +++
E/THINBTCLIENT( 5991): +++ DONE IN ON CREATE, GOT LOCAL BT ADAPTER +++
E/THINBTCLIENT( 5991): ++ ON START ++
E/THINBTCLIENT( 5991): + ON RESUME +
E/THINBTCLIENT( 5991): + ABOUT TO ATTEMPT CLIENT CONNECT +
I/DTUN_CLNT( 2155): Client calling DTUN_METHOD_DM_START_DISCOVERY
(id 2)
I/( 2140): DTUN_ReceiveCtrlMsg: [DTUN] Received message
[BTLIF_DTUN_METHOD_CALL] 4354
I/( 2140): handle_method_call: handle_method_call :: received
DTUN_METHOD_DM_START_DISCOVERY (id 2), len 0
W/BTLD( 2140): bta_dm_check_av:0
I/BTL-IFS ( 2140): send_ctrl_msg: [BTL_IFS CTRL] send
BTLIF_DTUN_SIGNAL_EVT (CTRL) 4 pbytes (hdl 10)
I/ADAPTER ( 2155): Discovery session 0xc7b8 with :1.0 activated
D/ADAPTER ( 2155): session_ref(0xc7b8): ref=1
I/DTUN_CLNT( 2155): dtun-rx signal [DTUN_SIG_DM_DISCOVERY_STARTED] (id
38) len 6
D/DTUN_HCID( 2155): dtun_dm_sig_discovery_started()
I//system/bin/btld( 2139):  btapp_dm_DiscoverDevices()
I/BluetoothEventLoop.cpp( 1908): event_filter: Received signal
org.bluez.Adapter:PropertyChanged from /org/bluez/2155/hci0

E/THINBTCLIENT( 5991): BT GPS connected

D/BluetoothSocket( 5991): BluetoothSocket created fd:
-1uuid1101--1000-8000-00805f9b34fbport -1
D/BluetoothSocket.cpp( 5991): initSocketNative
I/BLZ20_WRAPPER( 5991): blz20_wrp_socket: fam 31, type 1, prot
BTPROTO_RFCOMM
D/BTL_IFC_WRP( 5991): wrp_wsock_create: (null)
D/BTL_IFC_WRP( 5991): wrp_alloc_new_sock: wrp_alloc_new_sock sub 15
D/BTL_IFC_WRP( 5991): wrp_wsock_create: 31
D/BLZ20_WRAPPER( 5991): btsk_alloc_add: success
D/BLZ20_WRAPPER( 5991): btsk_dump_list:  fd (-1:28), bta -1, rc 0,
wflags 0x0
I/BLZ20_WRAPPER( 5991): blz20_wrp_socket: return 31
D/BLZ20_WRAPPER( 5991): blz20_wrp_setsockopt:  fd (-1:31), bta -1, rc
0, wflags 0x0
I/BLZ20_WRAPPER( 5991): blz20_wrp_setsockopt: configure rfcomm lm mode
0x26, (master:0, auth 1, enc 1)
I/BLZ20_WRAPPER( 5991): blz20_wrp_setsockopt: success
D/BLZ20_WRAPPER( 5991): blz20_wrp_setsockopt:  fd (-1:31), bta -1, rc
0, wflags 0x0
I/BLZ20_WRAPPER( 5991): blz20_wrp_setsockopt: configure rfcomm sndbuf
len 71680 bytes
I/BLZ20_WRAPPER( 5991): blz20_wrp_setsockopt: success
D/BluetoothSocket.cpp( 5991): ...fd 31 created (RFCOMM, lm = 26)
D/BluetoothSocket.cpp( 5991): initSocketFromFdNative

E/THINBTCLIENT( 5991): TRYING TO CONNECT

D/BluetoothSocket( 5991): connect
D/BluetoothSocket( 5991): doSdp
I/BluetoothService.cpp( 1908): ... Object Path = /org/bluez/2155/hci0/
dev_00_0B_0D_8E_D4_33
I/BluetoothService.cpp( 1908): ... Pattern =
1101--1000-8000-00805f9b34fb, strlen = 36
D/DEVICE  ( 2155): *DiscoverServices
I/DTUN_HCID( 2155): dtun_client_get_remote_svc_channel: 

[android-developers] Android Bluetooth Development - Problem connecting

2010-03-17 Thread philDev
Hi everybody,

I'm trying for hours and couldn't find an answer anywhere online nor
in my Logs. I'm trying to establisch an RFCOMM Link by Bluetooth
between an external Device that implements the SPP 1.04 Profile. Here
is the output from sdptool:

sudo sdptool browse
Inquiring ...

Browsing 00:0B:0D:8E:D4:33 ...
Service Name: SPP slave
Service Description: Bluetooth SPP V1.04
Service RecHandle: 0x1
Service Class ID List:
  Serial Port (0x1101)
Protocol Descriptor List:
  L2CAP (0x0100)
  RFCOMM (0x0003)
Channel: 1
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:0x6a
  base_offset: 0x100

The Device just provides this and doesn't  have any input or screen.
And it does work with Linux etc.

I'm using the following Code in order to establish an Connection:

private static final UUID MY_UUID =
UUID.fromString(1101--1000-8000-00805F9B34FB);
private static String address = 00:0B:0D:8E:D4:33;

This happens in onCreate():
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

Then in onResume:
 //Starting an discovery
mBluetoothAdapter.startDiscovery();
//getting the device
BluetoothDevice device = 
mBluetoothAdapter.getRemoteDevice(address);
Log.e(TAG, device.getName() +  connected);

   //establishing socket
   try {
btSocket = 
device.createRfcommSocketToServiceRecord(MY_UUID);
} catch (IOException e) {
Log.e(TAG, ON RESUME: Socket creation failed., e);
}
Log.e(TAG, TRYING TO CONNECT);

   //Connecting the socket
  try {
btSocket.connect();

Log .e(TAG,ON RESUME: BT connection established, 
data transfer
link open.);
} catch (IOException e) {
  //Fehlerausgabe wenn das nicht funktioniert



-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] android bluetooth

2009-11-09 Thread george
Hi all

I'm developing chat application

i want android device to connect with other non android device that
implement jsr 82

so how can i declare my bluetooth service on android

or how to connect to any jsr 82 service ...

Thanks

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] android-bluetooth api issue

2009-09-21 Thread Breese.Kay

hi,all.
 I use the android-bluetooth control my T-mobile G1 phone.But when I
scan remotedevice I cause an ?null? Exception. this is the part of
code.

try {
  if(localBtDev.isScanning() == false){
   //localBtDev.scan();
}
} catch (Exception e1) {
 // TODO Auto-generated catch block
 tv.setText(cann't init scanner +e1.getMessage());
//return;
}

this code always output cann't init scanner null.

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Android Bluetooth 2.0 Support

2009-05-19 Thread cohenSH

I was wondering whether anyone could clarify the following:

I am attempting to create an accurate GPS transmitting program on a T-
Mobile G1, and I am looking to purchase a GlobalSat-368i bluetooth GPS
receiver to get better accuracy than the phone's internal receiver.
The thing is that the receiver is listed as specifically working on
android, and using bluetooth 2.0 (which cupcake should support?), but
there are several very angry forums discussing how, despite the fact
that the device is being sold as an android product, android does not
actually have sufficient bluetooth support for the receiver, and it
doesn't work with the G1.  To make matters worse, this may indeed be
possible, since the store selling the product has actually never
tested using it with an android phone.  Does anyone know whether or
not this product will work with android, or will it work in at least a
basic way (I don't need bluetooth API support, I just want the phone
to bypass its existing GPS receiver and get the more accurate reading
from the receiver).
Thanks,
   cohensh

--~--~-~--~~~---~--~~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---