Android Bluetooth Library

Project maintained by Rami Martin


This library allows you to easily create a socket bluetooth connection for two android devices with one server and one client. This library is compatible with the Android SDK 2.3 to 5.1.

Simple implementation with extended BluetoothActivity or FragmentActivity.

public class MainActivity extends BluetoothActivity {

    public void onCreate(Bundle savedInstanceState) {

    protected void onStart() {

    public UUID myUUID() {
        return UUID.fromString("00001101-0100-1000-8000-00805F9B34FB");

    public void onBluetoothStartDiscovery() {

    public void onBluetoothDeviceFound(BluetoothDevice device) {

    public void onClientConnectionSuccess() {

    public void onClientConnectionFail() {

    public void onServeurConnectionSuccess() {

    public void onServeurConnectionFail() {

    public void onBluetoothCommunicator(String messageReceive) {

    public void onBluetoothNotAviable() {

You can also extend your fragment with BluetoothFragment. Don't forget to past the activity result from your activity to your fragment.


You can generate your own UUID on this website


<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>


  • Android Bluetooth Library V1.0.1 JAR

  • The source code to the library and sample application as well as this website is available on GitHub.


    If you are using Maven for compilation you can declare the library as a dependency.

          <name>Arissa Ftp</name>


    repositories {
        maven {
            url ""
            artifactUrls mavenLocal()
    dependencies {
        compile 'com.ramimartin.bluetooth:AndroidBluetoothLibrary:1.0.1-SNAPSHOT'


    This library is used in these applications :

  • Connect 4

  • License

    Copyright 2015 Rami Martin
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    Support or Contact

    If you have any questions please feel free to contact me at this email address :