This might be a newbie question since my experience with Android is limited but for some reason I'm unable to access the method android.bluetooth.BluetoothAdapter#listenUsingL2capOn(int). It seems to be public and hence not really sure why the symbol is not being recognized. And on a side note how does one open up L2CAP bluetooth socket server on android? Only one question I found somewhat related to this - How can I instantiate a L2Cap socket in Android?. Any help would be appreciated.
Why is android.bluetooth.BluetoothAdapter#listenUsingL2capOn(int) not accessible?
397 Views Asked by Divya Mamgai At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in BLUETOOTH
- React native - how can i listen callBack function
- java android: how to send data on Bluetooth between android and computer
- Pair bluetooth device to Android 12 phone by selecting my own pin
- Bluetooth virtual sniffer for windows
- PyBluez connection problems
- How to set value the descriptor of iOS BLE in Objective-C?
- python script using bluetooth running on windows 11 vs raspberry pi4
- Mobile printing PT200 tru Bluetooth opened in web app
- PlatformException(connect_errd or timeout)
- Bluetooth Driver file corrupt or replaced
- Bluetooth driver Failed and unable to install bluetooth driver for jammy ubuntu
- strange Flutter bug on turning on/off bluetooth permission using IOS device
- Call requires permission which may be rejected by user code should explicitly check to see if permission is available
- Error during getting android Bluetooth device RSSI from Windows 10 using BlueCove library
- Error in Bluetooth specification? Heading field of Location and Speed
Related Questions in ANDROID-SOURCE
- How to build aosp 6.0 img and run emulator with the img on mac m1 device?
- Where is the ExecuteMterpImpl function in aosp 13?
- Best hardware to build android os platform code Version 15
- How do I convert the update.img artifact from the Orange Pi 4 LTS Android build to an image I can flash on a microSD card?
- Slide the Android Automotive HVAC up by pressing a button
- AOSP user variant ROM for pixels
- Motorola G40 Fusion Display Issue: Power Button Not Turning On Display in Android 14 Custom ROMs
- NanoHTTPD Timeout Error while Uploading File to the Android Device
- How do I add Aosp-Node-Prebuilts to the Orange Pi 4 LTS Android 8.1 build?
- AOSP cuttlefish: avoid booting in recovery mode loop
- How do I create an Android make file to merge a glibc based root filesystem into to the AOSP filesystem?
- Fluoride stack support for VS commands
- AOSP Build Error: instances are in the device manifest but not specified in framework compatibility matrix:
- AOSP Audio Echo Cancellation with libaudiopreprocessing
- aosp build got memory corruption
Related Questions in L2CAP
- bluetoothLeScaner.startScan(scanCallback) isnt returning null
- Encryption using L2CAP Connections over channels
- btsnooz_hci.log truncated packet?
- iOS Swift Facing issue on data transfer over CBL2CAPChannel
- What parameters should I use for L2CAP connection request in BLE data transfer between a Bluetooth 5.0 and 4.1 device?
- L2CAP communication in background mode
- Optimize Bluetooth LE L2CAP throughput between Linux running bluer l2cat and iOS
- When did the L2CAP SMP channel create?
- iOS L2CAP/GATT- throughput
- CBL2CAPChannel not responsive while app is backgrounded
- NSStream (BLE L2CAP) on background thread
- BluetoothSocket.connect() Android 12 Permission issue on certain devices
- Concurrent L2CAP and/or GATT Connections between 2 Devices
- Why are there two different socket options (RFCOMM and L2CAP) in BlueZ?
- can't send data through l2cap raw socket for local controller - [Errno 107] Transport endpoint is not connected
Related Questions in BLUETOOTHADAPTER
- Android with Kotlin, can't get the BluetoothAdapter
- Bluetooth discovery issue in Android versions above 12
- What are the differences between the 4 ways to connect a Bluetooth device in Android after scanning?
- How to switch between the Available/Paired bluetooth device in Android Studio
- Does the bluetooth address of Android device changes after some time?
- getUUIDS returns null when device isn't paired
- BluetoothAdapter.getDefaultAdapter() has been deprecated - Flutter
- BluetoothAdapter StartDiscovery does not work in Foreground Service
- Perform a bluetooth scan with BluetoothAdapter in Xamarin.android
- BluetoothAdapter.getName() returns "QCOM-BTD" instead of its set bluetooth name
- Lag when using Bluetooth Adapter in Android Studio
- STATE_CONNECTED doesn't mean it's really CONNECTED?
- I am getting this error on selenium python
- AndroidStudio : List Paired Devices
- Why is android.bluetooth.BluetoothAdapter#listenUsingL2capOn(int) not accessible?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
In Android we have two different levels of public methods:
publickeyword.@hideannotation. A method is Android-level public if it does not have the@hideannotation in its JavaDoc.If a method is Java-level public, but not Android-level public, this means it can only be used within the Android framework code, but not by app code. This is needed to keep the Android API as small as possible: When Android developers add a helper method that is useful in many places within the Android framework code, they would want this method to be Java-level public, so that it can be used by the other classes in the Android framework code. However, the Android developers might not want this helper method to be used by app code, because then if they later rework the code and the helper method is no longer needed, removing the method would break the apps using it. Not making the method Android-level public gives the Android developers more freedom to change/remove the method later on.
Considering for example the method you gave:
listenUsingL2capOnhas the@hideannotation, as can be seen here. Therefore, it is not considered Android-level public. You can also see this from the API documentation ofBluetoothAdapter, which does not list the methods that are not Android-level public (link).Regarding your side question: I'm not familiar with how to create a L2CAP bluetooth socket server in Android, but the answer that you linked looks promising. E.g. using
BluetoothDevice#createL2capChannelandBluetoothAdapter#listenUsingL2capChannel. Note the name of the latter is different formlistenUsingL2capOn.