Android Studio Link Bluetooth library

Source: Internet
Author: User

1, download header file
the latest Android uses the Bluedroid Bluetooth library. The research Androhid uses the BlueZ Bluetooth library. To BlueZ downloaded a, inside the directory structure and files are different. Search for half a day, search the Android BlueZ.
git clone Https://android.googlesource.com/platform/external/bluetooth/bluez

2, copy to NDK
Copy the downloaded Bluez\lib\bluetooth directory to the NDK directory android-ndk-r10d\platforms\android-21\arch-xxx\usr\include\.
6 directories are copied, or not make up the past, Theseus pit.
Also to copy the Android\src\system\core\include\cutils directory into the NDK directory, the same as above, 6 will be copied.

In Build.gradle, the NDK section adds the filter for the target schema
 NDK {
ModuleName "Nativebt"
"log" ,  " z " ,  >  (???)

         abifilters  " Armeabi " " armeabi-v7a " ", "style= font-size:16px," ">    }
Span style= "font-size:16px" > 

The compiled directory is left with two Armeabi, armeabi-v7a
There is only one arch-arm for the Include directory used in the NDK.

Compiled by.

The next step is to link the libbluetooth.so library, alas, looking at the sky heaved, where I go to find a. So library!

Well, the BlueZ source download down a look, so-called libbluetooth.so only 4 source files. Simply do not find, will be 4 source files piece copy to the project, compile together, too!
Bluetooth.c
Hci.c
Sdp.c
Uuid.c





























Android Studio Link Bluetooth library

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.