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?
396 Views Asked by Divya Mamgai At
1
There are 1 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in BLUETOOTH
- Bluetooth connection to Sphero is lost when smartphone "goes to sleep"
- MFi Program by Apple
- Android Wear Device as iBeacon
- android - How to get a iBecon detection state when I kill app from Background?
- IOException: broken pipe when sending file from android device to PC via Bluetooth
- How deploy an large number iBeacons
- Send a Android BLE GATT Notification
- burst notifications with Bluetooth Low Energy on Android
- Is there a way to change bluetooth module's baud rate via Bluetooth connection with Android device?
- NFC Bluetooth handover - WITHOUT user confirmation
- Is it possible to create an app that when installed the user can easily turn Bluetooth/NFC ON and OFF by double clicking the Home button?
- Difference between attributes and services in BLE
- Global name 'bluetooth' is not defined
- iOS Bluetooth list of devices already connected?
- Bluetooth discovery not starting on first click
Related Questions in ANDROID-SOURCE
- How to backup an AOSP project on GitHub
- AOSP ROM for Samsung Grand duos GT-i9082 Error loading kernel
- where to find oneplus one binaries (Device tree, Vendor, Kernel) to build rom from AOSP?
- During "make" process for AOSP build, Can I check a progress ratio?
- Is it possible to switch APN programatically in android?
- How do I open the Android Mail project in Android Studio?
- AOSP Lollipop build keeps hanging
- How does the Android system automatically change the screen orientation?
- What is difference between Android and Android Rom?
- API Change error when building AOSP 5.1
- What is the meaning of AOSP's 'lunch' combinations and what do I need to choose?
- Android - Java Packages & Libraries
- Android System Module does not generate output on build
- What is the syntax to create files symlinks in android source tree?
- Missing 'libaudiopolicyservice_intermediates" when trying to compile AOSP 7.1.1 release 6?
Related Questions in L2CAP
- How can I establish an AVRCP connection from Windows 7 (controller) to phone (target) using L2CAP on Widcomm SDK?
- Bluetooth protocol (RFCOMM, L2CAP and ACL)
- Android BT Stack in Kit Kat
- How to make a testing bluetooth connection from a desktop PC to an android device
- Bluez L2CAP CoC to Android / iOS Credit based flow failing
- Multiple L2CAP channels on iOS (rdar://46227689)
- Connecting with Bluetooth L2Cap to HID Device
- Android BLE Connection time interval
- iOS L2CAP/GATT- throughput
- When did the L2CAP SMP channel create?
- Optimize Bluetooth LE L2CAP throughput between Linux running bluer l2cat and iOS
- about bluetooth spp retransmission
- BluetoothSocket.connect() Android 12 Permission issue on certain devices
- CBL2CAPChannel not responsive while app is backgrounded
- How can I instantiate a L2Cap socket in Android?
Related Questions in BLUETOOTHADAPTER
- Lag when using Bluetooth Adapter in Android Studio
- BluetoothAdapter.getName() returns "QCOM-BTD" instead of its set bluetooth name
- I am getting this error on selenium python
- getUUIDS returns null when device isn't paired
- BluetoothAdapter StartDiscovery does not work in Foreground Service
- Perform a bluetooth scan with BluetoothAdapter in Xamarin.android
- Bluetooth discovery issue in Android versions above 12
- Why is android.bluetooth.BluetoothAdapter#listenUsingL2capOn(int) not accessible?
- Trying to get BluetoothAdapter; Cannot resolve method 'GetSystemService(java.lang.String)'
- My java code could not search for nearby Bluetooth Devices
- java.lang.NoSuchMethodError: android.bluetoothAdapter.getBluetoothLeAdvertiser at org.altbeacon.beacon
- How can I solve this NullPointer error in my Android app?
- Fragment: The application may be doing too much work on its main thread
- Bluetooth Scanrecord same values are null
- BluetoothAdapter.getDefaultAdapter() has been deprecated - Flutter
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 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.