puck-central-android | Puck Central is the name of the Android app | Android library
kandi X-RAY | puck-central-android Summary
kandi X-RAY | puck-central-android Summary
Puck Central is the name of the Android app.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- On IBeacons connect
- Update the location of IBeacons
- Connects to the cube and connects it
- Updates the location of a beacon
- Write integer array
- Cancels the current operation bundle
- Convert a string number to a byte array
- Drive the Gatt operation
- Binds to a player
- Called when a Bluetooth device is pressed
- Generate a hash code
- Remove a rule
- Instantiates an action
- Creates the pickers
- Convert a string to a UUID
- This method is called when a menu item is clicked
- Handles a stick event
- Enable or disable a characteristic
- Handles a device
- Bind the trigger
- Display an actuator dialog
- Returns an alert dialog
- Create a list of actuators
- Create an alert dialog
- Called when a new zone is discovered
- Returns the action dialog
puck-central-android Key Features
puck-central-android Examples and Code Snippets
Community Discussions
Trending Discussions on puck-central-android
QUESTION
Given, a device which is always turned on, and does a Bluetooth Low Energy advertising every second.
I have to implement an application for Android tablets which connects to this device via Bluetooth Low Energy, sends some commands and then disconnects from it.
Minimum Android version: the one which works best, I'm free to decide.
I started with API 21 (Android 5.0, Lollipop)
The issues the BLE stack has, caused trouble also for me: I'd like to issue a successful direct connection using the object retrieved by BluetoothAdapter#getRemoteDevice(MACAddress: String) method, and it always fails.
Below are the questions / answers / posts that I've found and seems useful (maybe these will help someone):
- Bluetooth / BLE development is miserable on Android. Anyone know any special tricks?
- android ble connect slowly
- an implementation of GattManager, which has workarounds - implementation by a company in Norway: Nordic Semiconductor
- RxAndroidBle - "RxAndroidBle is a powerful painkiller for Android's Bluetooth Low Energy headaches. It is backed by RxJava, implementing complicated APIs as handy reactive observables."
- workaround for re/connecting
Beside these, I looked into the BluetoothDevice's source code, and I've found out that the Context parameter of the connectGatt() method is not used at all:
https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/bluetooth/BluetoothDevice.java#1899
Wondering if can this be one of the reasons of the flaws the BLE stack has?
Also, I don't understand what is the difference between a BluetoothDevice object retrieved by the scanner vs the one retrieved by BluetoothAdapter#getRemoteDevice(MACAddress: String) method.
If I issue a direct connection (autoconnect parameter is set to false when calling connectGatt()) on the device got via scanning, the connection usually succeeds. But, a direct connection always fails (status = 133, timeout) when using the object retrieved by getRemoteDevice().
As the device I want to connect to advertises itself every second, I expect the direct connection to always / most of the time work, like in the case of scanning.
Because the background connection (autoconnect parameter set to true) is very slow, I cannot rely on that.
Also, because the scanning is unreliable and slow, I cannot force the user to wait every time the application starts.
- The Context parameter of the connectGatt() method is not used at all - can this be one of the reasons of the flaws the BLE stack has? I suppose someone put it there for a good reason.
- What is the difference between a BluetoothDevice object retrieved by the scanner vs the one retrieved by BluetoothAdapter#getRemoteDevice(MACAddress: String) method?
ANSWER
Answered 2018-Apr-29 at 08:56The context parameter was used in earlier Android versions but apparently wasn't needed anymore. You should still pass a valid context to be compatible with earlier versions, or newer if they decide to make use of it again.
There shouldn't be any difference. But if you just connect by Bluetooth Device address, you will notice the flaw in the API that you cannot pass the address type (public or random). So if you try to connect to a static random address, that will probably fail unless you have first scanned the device. This is because Android keeps a cache of a addresses and which address type it had in the latest advertisement. So try to first scan and make sure you see the device you want to connect to. Then try to connect using BluetoothAdapter#getRemoteDevice(MACAddress: String).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install puck-central-android
You can use puck-central-android like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the puck-central-android component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
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