Bluetooth-Library | Bluetooth client library for Android
kandi X-RAY | Bluetooth-Library Summary
kandi X-RAY | Bluetooth-Library Summary
Bluetooth client library for Android.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the navigation
- Define the callback to receive Bluetooth status related events
- Sets the callback that should be informed about scanning related events
- Sets progress and state
- Initializes the Android app
- Set the callback on UI thread
- Set the device related events
- Start the Bluetooth device
- Starts the bluetooth service
- Connect to a bluetooth device
- Get BluetoothSocket used by this receive thread
- Connect to bluetooth device with port tick
- Connects to a device
- Disable bluetooth adapter
- Start scan button
- Enable bluetooth
- Start the chat activity
- This method is called when the Android device has been loaded
- Stop listening on devices
- Stop listening for bluetooth devices
- To be called when the instance is saved
- Disconnect the bluetooth
- The HelloWorld interface
- Connect to the bluetooth
- Unbinds a Bluetooth device
- Creates a Bluetooth socket to the device
Bluetooth-Library Key Features
Bluetooth-Library Examples and Code Snippets
Community Discussions
Trending Discussions on Bluetooth-Library
QUESTION
I recently bought a Lilypad Simblee BLE Board and I'd like to pair it programmatically to my computer (using the 32feet.NET library in C#).
I'm aware the "How to programmatically pair a bluetooth device" has already been asked on StackOverflow (here for example), however for some reason, all my attempts to pair the device programmatically have failed. Indeed, I successfully paired the device with the "Manage Bluetooth devices" window in Windows 10 Settings panel (Settings > Devices > Bluetooth).
Firstly, I don't know the pairing method (either legacy or SSP) to use with my device. Windows never asked me for a PIN or something, so I guess it's SSP, but I'm unsure.
I searched on Google how to do a SSP pairing request with 32feet.NET: I found this.
However, once it discovered my device (the device discovery works properly), the pairing request instantly fails.
My code:
...ANSWER
Answered 2017-Mar-09 at 18:11The answer to the question you linked has a plausible suggestion... did you read it?
Also you should look at this question as well.
32feet library is built around legacy pairing, so that you either need to know the pin of the device you are connecting to, or you supply it with a null to get a popup window to enter a pin.
It also says that the windows function used by 32feet is deprecated in newer versions of windows. If that's true, the reason it's failing instantly is because you've passed a null pin in your pairing request and for it to proceed windows needs to show a dialog which no longer exists.
What happens if you try to connect with the pin "0000" or "1234" ?
I'm looking at the source code of WindowsBluetoothSecurity.cs
in 32feet.net and I see if a pairing request fails, it logs the error code to Debug.WriteLine
, any chance you could post that error code here?
One good work around to this problem might be to import BluetoothAuthenticateDeviceEx
and use that manually to complete the pairing request. If you don't want to do this manually, it looks like in the latest version of the 32feet source, there is actually a SSP pairing method that utilises this method but it's not public and it's not used anywhere so you'll need to access it via reflection:
QUESTION
I'm working on a simple app, essentially to send data over Bluetooth.
My MainActivity:
...ANSWER
Answered 2019-Apr-11 at 14:06I just went through the library link you provided and it seems someone else faced the similar issue given here:
https://github.com/OmarAflak/Bluetooth-Library/issues/16
And it turned out be the connection wasn't established yet,so before calling send please check if the device is connected by using isConnected()
function.
You shouldn't call send before the connection is established properly.you can set callback for the same using setDiscoveryCallback
and do work inside most probable after you get confirmation in void onDevicePaired(BluetoothDevice device)
.
Edit 1: from the comments.
Are you sure it is in onDevicePaired() that I am supposed to send data?
Maybe not,I think i misunderstood the example given by library author,now i think you should do it on onDeviceConnected
.
Is there any other method that gets called when it is connected?
Yes,you can set a callback for that using following:
QUESTION
I actually have the project to develop an android application BLE which can connect and read multiple sensor (My version should be able to connect up to 7 devices, but I want to connect only 2 in the first time).
I read a lot of informations about that and have a knowledges of the global working-way (one thread by connection, queue of requests, etc) but I'm really not familiar with the JAVA language. I found arround a billion of topics with this subject but all of them are a bit old, so here is my questions :
- Does exists a working example which demontrate the implementation of this implementation's kind (One android with few exotics sensors like CC2650 Sensortag) ?
- To implement that application, should we create a library like Rami Martin did on his example : http://arissa34.github.io/Android-Multi-Bluetooth-Library/ or is it possible to create it without change the android library ?
Regards, John
...ANSWER
Answered 2017-May-15 at 12:17There is no easy-to-use open sources libraries for BLE Android at the moment, almost of them are also not updated.
I also spent a long time to look for a good example and library, but all of them are one-device connection only.
Finally, I went with this library.
https://github.com/RobotPajamas/Blueteeth
You can use this to connect with multiple devices easily. However, to get data from all of them, it is a little bit harder.
This is also not maintained currently but it is the best one for me.
You can take a look at sample-app
for more details.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Bluetooth-Library
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page