Android implements the example code of Bluetooth file sending, and supports a variety of models

Recently, the project needs to realize a function of Bluetooth transmission APK, which can search the surrounding Bluetooth mobile phones and share files. In terms of demand, the Bluetooth transmission module of Android mobile phone can meet the needs, and the implementation is also very simple. However, the headache is that although the general mainstream models are equipped with Bluetooth modules, the fragmentation of Android models is too serious, and the Bluetooth functions of mobile phones in different Android versions are also different. 4.0.3 the Bluetooth packages used in versions below and above are different, namely "com.android.bluetooth" and "com.mediak.bluetooth". There are also customized modifications of Bluetooth modules made by some manufacturers, such as Huawei's c8812. In addition, the Bluetooth function of Android is only available above api5, so the minsdkversion of Android should not be less than 5.

There are many examples of Android calling Bluetooth sending module on the Internet. There are few examples that are complete and compatible with multiple systems. Here is an example I used in the project.

effect:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>