Bluetooth Data Transfer Example


The following example uses the Android Bluetooth APIs to construct a simple peer-to-peer messaging
system that works between two paired Bluetooth devices.
Unfortunately the Android emulator can’t currently be used to test Bluetooth functionality. In order to
test this application you will need to have two physical devices.

1. Start by creating a new BluetoothTexting project featuring a BluetoothTexting Activity.
Modify the manifest to include BLUETOOTH and BLUETOOTH_ADMIN permissions.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.paad.chapter13_bluetoothtexting"
android:versionCode="1"
android:versionName="1.0">
<application
android:icon="@drawable/icon"
android:label="@string/app_name">
<activity
android:name=".BluetoothTexting"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="5" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
</manifest>

2. Modify the main.xml layout resource. It should contain a ListView that will display the dis-
covered Bluetooth devices above two buttons — one to start the Server Socket listener, and
another to initiate a connection to a listening server.
Also include Text View and Edit Text controls to use for reading and writing messages across
the connection.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<EditText
android:id="@+id/text_message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:enabled="false"
/>
<Button
android:id="@+id/button_search"
android:text="Search for listener"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/text_message"
/>
<Button
android:id="@+id/button_listen"
android:text="Listen for connection"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@id/button_search"
/>

<ListView
android:id="@+id/list_discovered"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/button_listen"
android:layout_alignParentTop="true"
/>
<TextView
android:id="@+id/text_messages"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/button_listen"
android:layout_alignParentTop="true"
android:visibility="gone"
/>
</RelativeLayout>

3.  Override the onCreate method of the BluetoothTexting Activity. Make calls to a collection
of stub methods that will be used to access the Bluetooth device and wire up the UI controls.

public class BluetoothTexting extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Get the Bluetooth Adapter
configureBluetooth();
// Setup the ListView of discovered devices
setupListView();
// Setup search button
setupSearchButton();
// Setup listen button
setupListenButton();
}

private void configureBluetooth() {}
private void setupListenButton() {}
private void setupListView() {}
private void setupSearchButton(){}


4.    Fill in the configureBluetooth stub to get access to the local Bluetooth Adapter and store
it in a field variable. Take this opportunity to create a field variable for a Bluetooth Socket.
This will be used to store either the server or client communications socket once a channel
has been established. You should also define a UUID to identify your application when con-
nections are being established.


private BluetoothAdapter bluetooth;
private BluetoothSocket socket;
private UUID uuid = UUID.fromString("a60f35f0-b93a-11de-8a39-08002009c666");
private void configureBluetooth() {
bluetooth = BluetoothAdapter.getDefaultAdapter();
}


5.   Create a new switchUI method. It will be called once a connection is established to enable
the Views used for reading and writing messages.
private void switchUI() {
final TextView messageText = (TextView)findViewById(R.id.text_messages);
final EditText textEntry = (EditText)findViewById(R.id.text_message);
messageText.setVisibility(View.VISIBLE);
list.setVisibility(View.GONE);
textEntry.setEnabled(true);
}

6.
Create the server listener by filling in the setupListenButton stub. The Listen button should
prompt the user to enable discovery. When the discovery window returns, open a Bluetooth
Server Socket to listen for connection requests for the discovery duration. Once a connection
has been made, make a call to the switchUI method you created in Step 5.
private static int DISCOVERY_REQUEST = 1;
private void setupListenButton() {
Button listenButton = (Button)findViewById(R.id.button_listen);
listenButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
intent disc;
disc = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
startActivityForResult(disc, DISCOVERY_REQUEST);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
if (requestCode == DISCOVERY_REQUEST) {
boolean isDiscoverable = resultCode > 0;
if (isDiscoverable) {
String name = "bluetoothserver";
try {
final BluetoothServerSocket btserver =
bluetooth.listenUsingRfcommWithServiceRecord(name, uuid);
AsyncTask<Integer, Void, BluetoothSocket> acceptThread =
new AsyncTask<Integer, Void, BluetoothSocket>() {
@Override
protected BluetoothSocket doInBackground(Integer . . .params) {

try {
socket = btserver.accept(params[0]*1000);
return socket;
} catch (IOException e) {
Log.d("BLUETOOTH", e.getMessage());
}

return null;
}
@Override
protected void onPostExecute(BluetoothSocket result) {
if (result != null)
switchUI();
}
};
acceptThread.execute(resultCode);
} catch (IOException e) {
Log.d("BLUETOOTH", e.getMessage());
}
}
}
}


7. Now create the client-side connection code. By performing discovery and displaying each
of the possible devices, this code will provide a means for the client device to search for the
listening server.

7.1. Start by creating a field variable to store an Array List of discovered Bluetooth
Devices.
private ArrayList<BluetoothDevice> foundDevices;

7.2.Fill in the setupListView stub. Create a new Array Adapter that binds the List View
to the found devices array.

private ArrayAdapter<BluetoothDevice> aa;
private ListView list;
private void setupListView() {
aa = new ArrayAdapter<BluetoothDevice>(this,
android.R.layout.simple_list_item_1,
foundDevices);
list = (ListView)findViewById(R.id.list_discovered);
list.setAdapter(aa);
}

7.3. Create a new Broadcast Receiver that listens for Bluetooth Device discovery broad-
casts, adds each discovered device to the array of found devices created in Step 7-1,
and notifies the Array Adapter created in Step 7-2.
BroadcastReceiver discoveryResult = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
BluetoothDevice remoteDevice;
remoteDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if (bluetooth.getBondedDevices().contains(remoteDevice)) {
foundDevices.add(remoteDevice);
aa.notifyDataSetChanged();
}
}
};

7.4 : Complete the setupSearchButton stub to register the Broadcast Receiver from the
previous step and initiate a discovery session.
private void setupSearchButton() {
Button searchButton = (Button)findViewById(R.id.button_search);
searchButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
registerReceiver(discoveryResult,
new IntentFilter(BluetoothDevice.ACTION_FOUND));
if (!bluetooth.isDiscovering()) {
foundDevices.clear();
bluetooth.startDiscovery();
}
}
});
}

8.  The final step to completing the connection-handling code is to extend the setupListView
method from Step 7b. Extend this method to include an onItemClickListener that will
attempt to asynchronously initiate a client-side connection with the selected remote
Bluetooth Device. If it is successful, keep a reference to the socket it creates and make a call
to the switchUI method created in Step 5.

private void setupListView() {
aa = new ArrayAdapter<BluetoothDevice>(this,
android.R.layout.simple_list_item_1,
foundDevices);
list = (ListView)findViewById(R.id.list_discovered);
list.setAdapter(aa);
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View view,
int index, long arg3) {
AsyncTask<Integer, Void, Void> connectTask =
new AsyncTask<Integer, Void, Void>() {
@Override
protected Void doInBackground(Integer . . . params) {
try {
BluetoothDevice device = foundDevices.get(params[0]);
socket = device.createRfcommSocketToServiceRecord(uuid);
socket.connect();
} catch (IOException e) {
Log.d("BLUETOOTH_CLIENT", e.getMessage());
}
return null;
}
@Override
protected void onPostExecute(Void result) {

switchViews();
}
};
connectTask.execute(index);
}
});
}

9.  If you run the application on two devices, you
can click the ‘‘Listen for connection’’ button on
one device, and the ‘‘Search for listener’’ button
on the other. The List View should then be popu-
lated with all the bonded devices within range, as
shown in Figure 
If you select the other Android device running this
application from that list, a connection will be
established between the two devices. The follow-
ing steps will use this communications channel to
send simple text messages between the devices.





10. Start by extending the switchUI method. Add a
new key listener to the text-entry Edit Text to lis-
ten for a D-pad click. When one is detected, read
its contents and send them across the Bluetooth
communications socket.

private void switchUI() {
final TextView messageText = (TextView)findViewById(R.id.text_messages);
final EditText textEntry = (EditText)findViewById(R.id.text_message);
messageText.setVisibility(View.VISIBLE);
list.setVisibility(View.GONE);
textEntry.setEnabled(true);
textEntry.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View view, int keyCode, KeyEvent keyEvent) {
if ((keyEvent.getAction() == KeyEvent.ACTION_DOWN) &&
(keyCode == KeyEvent.KEYCODE_DPAD_CENTER)) {
sendMessage(socket, textEntry.getText().toString());
textEntry.setText("");
return true;
}
return false;
}
});
}
private void sendMessage(BluetoothSocket socket, String msg) {
OutputStream outStream;
try {
outStream = socket.getOutputStream();
byte[] byteString = (msg + " ").getBytes();
stringAsBytes[byteString.length − 1] = 0;
outStream.write(byteString);
} catch (IOException e) {
Log.d("BLUETOOTH_COMMS", e.getMessage());
}
}



11. In order to receive messages you will need to create an asynchronous listener that monitors
the Bluetooth Socket for incoming messages.

11.1.Start by creating a new MessagePoster class that implements Runnable. It should
accept two parameters, a Text View and a message string. The received message
should be inserted into the Text View parameter. This class will be used to post
incoming messages to the UI from a background thread.
private class MessagePoster implements Runnable {
private TextView textView;
private String message;
public MessagePoster(TextView textView, String message) {
this.textView = textView;
this.message = message;
}
public void run() {
textView.setText(message);
}
}


11.2. Now create a new BluetoothSocketListener that implements Runnable. It should
take a Bluetooth Socket to listen to, a Text View to post incoming messages to, and
a Handler to synchronize when posting updates.
When a new message is received, use the MessagePoster Runnable you created in
the previous step to post the new message in the Text View.
private class BluetoothSocketListener implements Runnable {
private BluetoothSocket socket;
private TextView textView;
private Handler handler;
public BluetoothSocketListener(BluetoothSocket socket,
Handler handler, TextView textView) {
this.socket = socket;
this.textView = textView;
this.handler = handler;
}

public void run() {
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
try {
InputStream instream = socket.getInputStream();
int bytesRead = −1;
String message = "";
while (true) {
message = "";
bytesRead = instream.read(buffer);
if (bytesRead != −1) {
while ((bytesRead==bufferSize)&&(buffer[bufferSize-1] != 0)) {
message = message + new String(buffer, 0, bytesRead);
bytesRead = instream.read(buffer);
}
message = message + new String(buffer, 0, bytesRead − 1);
handler.post(new MessagePoster(textView, message));
socket.getInputStream();
}
}
} catch (IOException e) {
Log.d("BLUETOOTH_COMMS", e.getMessage());
}
}
}


11.3.  Finally, make one more addition to the swichUI method, this time creating and
starting the new BluetoothSocketListener you created in the previous step.
private Handler handler = new Handler();
private void switchUI() {
final TextView messageText = (TextView)findViewById(R.id.text_messages);
final EditText textEntry = (EditText)findViewById(R.id.text_message);
messageText.setVisibility(View.VISIBLE);
list.setVisibility(View.GONE);
textEntry.setEnabled(true);
textEntry.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View view, int keyCode, KeyEvent keyEvent) {
if ((keyEvent.getAction() == KeyEvent.ACTION_DOWN) &&
(keyCode == KeyEvent.KEYCODE_DPAD_CENTER)) {
sendMessage(socket, textEntry.getText().toString());
textEntry.setText("");
return true;
}
return false;
}
});

BluetoothSocketListener bsl = new BluetoothSocketListener(socket,
handler, messageText);
Thread messageListener = new Thread(bsr);
messageListener.start();
}












Comments

  1. Interesting tutorial, could you provide the sample project for download?

    Greetings
    Stefan

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
    2. Hi manoj, can you pls send me code to my mail :

      mounika.in1100@gmail.com

      Delete
    3. Hi manoj, can you pls send me code to my mail : persiabudi@gmail.com

      Delete
  2. Hi Manoj,

    great job!

    Very interesting tutorial.

    Better than classic Android chat example.

    Regards

    Mirko Ugolini

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
    2. HI Manoj,
      Good Job. Please mail me code for the same

      Regards
      Malathesh
      Malatheshj@gmail.com

      Delete
  3. I am getting application has stopped unexpectedly.Please Try again.How do i rectify it??
    Thanks.

    ReplyDelete
    Replies
    1. I think he forgot to make instance of foundDevices
      private void setupListView() {
      foundDevices = new ArrayList();

      Delete
    2. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
    3. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  4. please provide me full code to send image send via Bluetooth for android..

    ReplyDelete
    Replies
    1. Sorry Haresh this bluetooth app does not transfer raw data , it is only for text chat.

      Delete
  5. i used your tutorial for bluetooth connection.when i try to connect to other device, then it gives me focus on Edit text but when i enter some text and move the text pad down, it is not responding.Can you please help me regarding this?.

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  6. Hi Manoj,

    Nice Tutorials for Blue tooth Example.Can you Post the Full Source code because it will help for me in development Process.My Email Id Shankar.kpu@gmail.com. Awaiting for reply...

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  7. Manoj,

    Thank you for your tutorials for Blue tooth Example but I still have some place didn`t understand. Can you post Full Source code? My Email is mrraysum@gmail.com

    ReplyDelete
  8. i used this tutorial for bluetooth connection.when i try to connect to other device, then it gives me focus on Edit text but when i enter some text and move the text pad down, it is not responding.Can you please help me regarding this?.

    My Email is mukund.ixltech@gmail.com

    ReplyDelete
  9. sorry you but i unknown this your code, can it run? i trying to undertein, but all my code is fail. i hope you can help me

    this is my code

    package at.example.bluetooththenumbereight;

    import java.io.IOException;
    import java.util.UUID;

    import android.os.Bundle;
    import android.annotation.SuppressLint;
    import android.app.Activity;
    import android.bluetooth.BluetoothAdapter;
    import android.bluetooth.BluetoothDevice;
    import android.bluetooth.BluetoothSocket;
    import android.content.Intent;
    import android.util.Log;
    import android.view.Menu;
    import android.view.View;
    import android.widget.Button;
    import android.widget.TextView;
    import android.widget.Toast;

    @SuppressLint("ShowToast") public class AndroidBluetooth extends Activity {
    final static String toast = "IAM HERE";

    final static String TAG ="SimpleConnect";
    UUID MY_UUID;

    BluetoothDevice bd;
    BluetoothAdapter ba;
    TextView tv;
    Button btconnect;
    BluetoothSocket socket;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    tv = (TextView) findViewById(R.id.txDevice);
    MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");

    ba = BluetoothAdapter.getDefaultAdapter();
    if(!ba.isEnabled()){
    Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
    startActivity(intent);
    Intent intent1 = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
    startActivity(intent1);
    }

    }
    @Override
    protected void onStart() {
    // TODO Auto-generated method stub
    super.onStart();
    btconnect = (Button)findViewById(R.id.btConnect);
    btconnect.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {
    // TODO Auto-generated method stub


    boolean b = ba.checkBluetoothAddress("00:15:83:15:A3:10");
    BluetoothSocket tmp = null;

    //If valid bluetoothAddress
    if(b) {
    bd = ba.getRemoteDevice("00:15:83:15:A3:10"); //Getting the Verifier Bluetooth
    tv.setText(bd.getAddress()+"\n"+bd.getName());

    //Trying to create a RFCOMM socket to the device
    try {
    tmp = bd.createRfcommSocketToServiceRecord(MY_UUID);

    } catch (IOException e) {

    }
    socket = tmp;
    try {
    socket.connect();
    } catch (IOException e) {
    Toast.makeText(getApplicationContext(), "No connection was made! Exception: " + e.getMessage(), Toast.LENGTH_LONG).show();

    }

    //Print out the sockets name
    String test = tmp.toString();
    Toast.makeText(getApplicationContext(), "The bluetooth socket: " +test, Toast.LENGTH_LONG).show();


    }


    else {
    Toast.makeText(getApplicationContext(), "FALSE, No bluetooth device with this address", Toast.LENGTH_LONG).show();
    }
    }
    });
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
    }

    }

    it notice createRF... no open or timeout

    ReplyDelete
    Replies
    1. this code use to connect to bluetooth device, but it can't connect

      Delete
  10. Manoj,

    Thank you for your great tutorial for Bluetooth Example.
    Can you post me full source code?
    My Email is wojtlub@gmail.com

    TIA

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  11. Manoj,

    Thank you for your great tutorial for Bluetooth Example.
    Can you post me full source code?
    My Email is azizul_91i@yahoo.com

    Wan

    ReplyDelete
  12. Lal Bosco

    Thank you for your tutorial , its help me a lot for my master program thesis. I can pair and connect(MAC Adress) the two devices.
    i got problem with Async method.
    How can i transfer the variable between these two devices ?


    Email id:lalbosco55@gmail.com

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  13. Manoj,

    Thank you for your great tutorial for Bluetooth Example.
    Can you post me full source code?
    My Email david-2008@yandex.ru

    David (from Belarus)

    ReplyDelete
  14. please mail me source code at arslanshl@gmail.com

    ReplyDelete
  15. Can you mail me source code at leandrobezerramarinho@gmail.com

    ReplyDelete
  16. nice tutorial can you send to me the full project please!!
    my email is Motaz.Osama.CSD@gmail.com

    ReplyDelete
  17. Hi Manoj...excellent tutorial.Can you please email me the source code to abhi_ee_15@yahoo.com...

    ReplyDelete
  18. nice tutorial can you send to me the full project ..
    my email is codemen.ridwan@gmail.com

    ReplyDelete
  19. Very good tutorial! can you send to me the full project??

    My email is: alberto.crespo86@gmail.com

    ReplyDelete
  20. can you please mail me the full source code ..i need it for my project work
    my email id :: anuragrewar2007@gmial.com

    ReplyDelete
  21. Please could you send me friend by email is that I am new and want to see how the process of scanning devices to find this really confusing thanks beforehand jose_xp_799@hotmail.com

    ReplyDelete
  22. i want to connect blutooth device mic with my android phone via blutooth and on a single click i want to tranfer comunication sounds between phone and mic....can u suggest me for a tutorial an d example..my email id is amitsharma.kks@gmail.com

    ReplyDelete
  23. please mail me source code at chansaifok@yahoo.com

    ReplyDelete
  24. please mail me source code at mr.hoaianhmonster@gmail.com.Thank u !!!

    ReplyDelete
  25. Thank you for your great tutorial for Bluetooth Example.
    Can you post me full source code?
    My Email is huybip@gmail.com

    HUYBIP

    ReplyDelete
  26. Perfect article. I am just learning to create applications using Bluetooth and I think this is one of the best (or best :) ) article. I would be very happy if someone sent me a full code. My email: hawksvk@gmail.com .

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Very good tutorial! can you send to me the full project??

    My email is: nagarjuna519@gmail.com

    ReplyDelete
  29. Nice tutorial can You send me complete project ?
    my mail id is ashokagarwalbtp@gmail.com

    ReplyDelete
  30. Thank you for your great tutorial for Bluetooth Example.
    Could you post me full source code please?
    My Email is: hemializa@gmail.com

    Hemia

    ReplyDelete
  31. PhoneGap + bluetooth cool staff. Thanks for the nice tutorial. If not difficult, you can send the complete project at my email: slayter007@gmail.com
    Thanks in advance.

    ReplyDelete
  32. can u send me a full source code??
    my email:: jarman.cse@gmail.com

    ReplyDelete
  33. Very nice tutorial Manoj, could you please post me the full source code?
    My email is scrsunil@gmail.com

    ReplyDelete
  34. hai i want full code for this because i am new android which is help to me...Please send this id satheeshcapsone@gmail.com

    ReplyDelete
  35. Can u send me all source code of this example...plz

    ReplyDelete
  36. 有難うございました。おかげさまで出来ました!!:):):)

    ReplyDelete
  37. Can u send me all source code of this example quangvv88.it@gmail.com

    Thanks!

    ReplyDelete
  38. Greate tutorial.
    Could you send me full source code of this example?
    duongtuhuybk@gmail.com

    Thanks

    ReplyDelete
  39. Great Tutorial.
    Plz send me the full source code.
    naveenpgowda89@gmail.com

    ReplyDelete
  40. Can you send me all source code of this example le.minh.cn@gmail.com

    Thanks!

    ReplyDelete
  41. Great Tutorial.
    Plz send me source code.
    ly.truong.dn@gmail.com

    Thanks

    ReplyDelete
  42. It's a great tutorial.
    Please send me the code.
    arhui10@gmail.com

    Thanks.

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  43. Great tutorial......can you send to me the full project please!!
    my email is daniele.rigano@gmail.com

    ReplyDelete
  44. It is not showing the list view for the devices which availavle ...please help
    My email address is
    arpitdhuriya@gmail.com

    ReplyDelete
  45. Superb tutorial better than bluetoothchat example. Can you send me full example source code to implement

    ReplyDelete
    Replies
    1. Hi ,
      https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

      Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

      Delete
  46. Great tutorial......can you send to me the full project please!
    my email is tuibaoboi177@gmail.com
    Thank

    ReplyDelete
  47. Can you mail me source code at amine.chared@laposte.net

    ReplyDelete
  48. Possible to send me the source code. I would help me lots. Thanks in advance, jab45jab@gmail.com

    ReplyDelete
  49. Great Tutorial.
    Plz send me the full source code.
    aolgundemir@gmail.com

    ReplyDelete
  50. Great tutorial, is it possible to send me the full project? please. It would greatly help me. Thanks in advance, qvestor@gmail.com

    ReplyDelete
  51. This comment has been removed by the author.

    ReplyDelete
  52. Hi there...I have followed your code until step7, I have encountered a problem with switchViews().. Is there anything I missed out? Hope to receive your reply asap...

    ReplyDelete
  53. Hi, great tutorial, could you send me the full code cause I'm getting some errors?
    Thanks in advance!!
    swuw231@gmail.com

    ReplyDelete
  54. Me too. I complaint the eclipse "stringAsBytes" where I find? does not exist in the code?

    ReplyDelete
  55. Great tutorial.
    Plz send me the full source code.
    lisa-zi@web.de

    ReplyDelete
  56. this tutorial is really helpful.. thank u..
    can u still send me the full source code please..
    my id is abhimanyu_bhatnagar2000@yahoo.com
    thanx in advance.. :)

    ReplyDelete
  57. very nice tutorial, can you please send me the full source code to
    supernage@gmx.de

    ReplyDelete
  58. Hi, great tutorial, could you send me the full code cause I'm getting some errors?
    Thanks in advance!!
    seagull271@gmail.com

    ReplyDelete
  59. This comment has been removed by the author.

    ReplyDelete
  60. Hi, Its a very useful tutorial. Much helpful
    Can you please send me the full souce code at jagannath.sahoo@gmail.com

    Thanks in advance.
    Jagan

    ReplyDelete
  61. great!! i need this example for my project . So kindly send it for me via e-mail
    ealbaik@gmail.com
    Warm Regards

    ReplyDelete
  62. Very helpful, thanks.
    Could you please send me source code at mala9.siatria@gmail.com?

    ReplyDelete
  63. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Hello, could you send me the complete project? I'm having some problems with the code. Email: yusuchi17@gmail.com

      Delete
  64. hi.
    I'm making a project for a bluetooth controled pumb, can you send me your full project?thanks
    nunosantos1991@gmail.com

    ReplyDelete
  65. Hi Manoj,
    this is a good tutorial, but I have some problem with code. Would you like send me project? cecvarekf@gmail.com
    All the best
    Franta

    ReplyDelete
  66. Simply and elegantly explained. Yet the code has so many errors in it, it doesn't compile. Can you also send me compilable version of the project please ? correioafp [at] gmail.com

    Thanks!

    ReplyDelete
  67. Hello Manoj, how are you? hope fine,
    i'm trying to develop an application that have to connect to another device (not android) and receive some messages from this device. So i think that i need to develop the "client side" and "input stream" . Your explain are being very helpful for me, but im getting some errors yet. Can you send me your sample project? souza.rs@outlook.com

    thank you so much and best regards!

    ReplyDelete
  68. Hello Manoj ! I wish you are doing well. Despite the fact that this is well explained ; I couldn't compile it. If its possible could you please send the zipped file to r.r2rr[at]outlook.com

    ReplyDelete
  69. Hello Manoj !.
    How are you..i hope fine..I am trying the code for transfer the data via bluetooth Android mobile to any other mobile.If you have code means send that code . my mail id shansoft.smv@gmail.com.
    thanks a lot...

    ReplyDelete
  70. Blue tooth data transfer project,could you provide the same project for download?

    ReplyDelete
  71. Gud work sir..cld u please send me the code at d earliest. I am working on my thesis which involves the use of this module.
    Thanking you,
    Sanjana

    ReplyDelete
  72. This comment has been removed by the author.

    ReplyDelete
  73. This comment has been removed by the author.

    ReplyDelete
  74. Is it your code? Or it is from book "Professional Android" by Reto Meier

    ReplyDelete
  75. It is such a great work and you explained it clearly, but I got some errors!!!
    So, can you send me the project code ebtisam.cs@gmail.com

    ReplyDelete
  76. Can you please share me your source code to prasannamate87@gmail.com

    ReplyDelete
  77. Can you please share me your source code to mtestingu@gmail.com

    ReplyDelete
  78. Can you please share me your source code to clemos92@gmail.com

    ReplyDelete
  79. Hi i tried your example for bluetooth communication, and i must say is very good, however i'm using a RN-42 bluetooth i bought from sparkfun electronics, i'm able to connect to it via my HTC Evo shift i wrote a small program in visual studio to receive and send the text strings, i can receive the strings ok sent from my phone to my program written in visual studio, but when i send a string back to the bluetooth module, your program shuts down giving me a foreclosed error, i have tried this before with app inventor and it should work ok, the module is connected to my computer through a serial port, i need help figuring out where this is going wrong! can you maybe give me some tips.

    ReplyDelete
  80. Hi Manoj,
    this is a good tutorial, but I have some problem with code. Would you like send me project? arrya_omoshiroi@yahoo.com
    All the best

    ReplyDelete
  81. Hi sir,
    Its very nice tutorial and i got some errors and please can u send me project????? dinak1989@gmail.com

    ReplyDelete
  82. Sir,
    After i click list view and its shows error like force closed and can u please help me out ...im waiting

    ReplyDelete
  83. Hello, please send the entire project of this tutorial to dunatv@gmail.com

    ReplyDelete
  84. I try to develop android application is distorted characters incoming messages how to fix it.

    BufferedReader rd = new BufferedReader(new InputStreamReader(
    socket.getInputStream()));

    String line;

    while ((line = rd.readLine()) != null) {

    System.out.println(line.getBytes("ISO-8859-1"));
    System.out.println(line.getBytes("UTF-8"));
    System.out.println(line.getBytes("US-ASCII"));

    }

    RESULT:
    � � �

    ReplyDelete
  85. Thanks for the great tutorial. Please can you send me the full code of this tutorial to my email:
    haydersaadi1986@yahoo.com

    ReplyDelete
  86. hey manoj .
    i found error in stringAsByte ...What is this ???

    ReplyDelete
  87. hey Manoj ,
    could u please send me above code at hiteshsingh1101@gmail.com

    ReplyDelete
  88. Hey Manu,

    Nice Tutorials for Bluetooth Example.Can you please share me your source code to amr.sample@gmail.com

    ReplyDelete
  89. Hi Manoj,

    Great job!!! Could you share your project with me? crisconru@gmail.com

    Thanks

    ReplyDelete
  90. Hi Manoj,

    Thanks for the great tutorial!!! Could you share your project with me? desarrollo@dyscor.com.ar

    Thanks

    ReplyDelete
  91. Hi.Manoj,

    Thank you for your great tutorial for Bluetooth Example.
    Can you email me full source code?
    My Email raja_abdullah88@yahoo.com

    TQVM

    ReplyDelete
  92. Hi.Manoj,

    Thank you for your great tutorial.
    Can you email me full source code?
    My Email quockhanhtruong.2010@gmail.com

    ReplyDelete
  93. Hello

    Very nice tutorial can you please send me the full source code to bmccruz@live.com

    ReplyDelete
  94. Most grateful if you can send full source code to awid1100@gmail.com

    ReplyDelete
  95. Hello Manoj,

    Amazing tutorial can you please send me the full source code to zulicdavor@gmail.com

    Thank you

    ReplyDelete
  96. can you please send me the full source code to anandsutar36@gmail.com

    ReplyDelete
  97. Hello,

    Thanks for the tutorial.
    Could you please send me the full source code at blingkling123@gmail.com ?

    Thanks in advance

    ReplyDelete
  98. Can you please send me the full source code to zamir.zhurda@gmail.com?
    Tanks

    ReplyDelete
  99. Hai,

    Could you please mail me the complete source code..
    suhela.mali@gmail.com

    ReplyDelete
  100. please mail me the project folder grajasumant@ieee.org

    ReplyDelete
  101. Hello,

    Thanks for the tutorial.
    Could you please send me the full source code at komo.luka@gmail.com ?

    Thanks in advance

    ReplyDelete
  102. Hello,
    Could you please send me the full source code at debieche.abdelmounaim@gmail.com ??
    Thanks

    ReplyDelete
  103. Thank you for your great tutorial for Bluetooth Example.
    Can you post me full source code?
    My Email: romanmed02@walla.com

    ReplyDelete
  104. Send me file on my email
    Nour.fakhr@gmail.com

    ReplyDelete
  105. good one and helpfull
    plz send full source code to Umeshmysore1@gmail.com

    ReplyDelete
  106. Great Tutorial.
    Please send me the full source code.
    chtgkce@gmail.com

    ReplyDelete
  107. plz send full source code to ssgaria@gmail.com

    ReplyDelete
  108. pls send me too amonk@wp.pl

    ReplyDelete
  109. Nice Tutorials for Blue tooth Example.Can you Post the Full Source code because it will help for me in development Process.My Email Id seang_nu@live.com. Awaiting for reply...

    ReplyDelete
  110. Very Useful Tutorial for me can please send me complete Project to my mail kumarramtech@gmail.com,it will be very helpful for me in further development.

    ReplyDelete
  111. Sir,Please send me dis code to my email Id : nehakhurana43@gmail.com

    ReplyDelete
  112. thank u very much for the the information... Actually I am very new at android application development.. It will be very helpful for me if you can send me the full project..
    My email id: mainak250189@gmail.com

    ReplyDelete
  113. good one and helpfull
    plz send full source code to sanat2003@gmail.com

    ReplyDelete
  114. Great Tutorial. Can you please send me source code to rajeev.sharma@netsmartz.net.

    Thanks

    ReplyDelete
  115. Can you kindly send me the source code?
    ngooitingting@gmail.com

    ReplyDelete
  116. great job!!!.. nices tut!... can u send me your source for download?... my email is... yugiho_1234@hotmail.com

    ReplyDelete
  117. Great Tutorial.
    Please send me the full source code.
    leoromo.energy@gmail.com

    ReplyDelete
  118. Thanks! Please send me the full source code.
    bryanward38@gmail.com

    ReplyDelete
  119. I would be glad if you send me your code.
    dennis_kal@hotmail.com

    ReplyDelete
  120. Congratulations for the iniciative. Would you please share the source code ? Thanks in advance. piparopa@gmail.com

    ReplyDelete
  121. Great Tutorial.
    Please send me the full source code.
    vikasvishvas@gmail.com

    ReplyDelete
  122. It's very simple to understand thanks for and you guys excellent job this type of functionality required plz give me a full source coed i will very really thank full to you.
    sindhalmanish@gmail.com

    ReplyDelete
  123. Hello, please send the entire project of this tutorial to tailieu.bk93@gmail.com

    ReplyDelete
  124. Would you share the full source code ? Please send mail to ajisamudraa@gmail.com

    Thanks

    ReplyDelete
  125. It would be great if could send me the source code please.
    banerjeeankit@yahoo.com
    Thank you

    ReplyDelete
  126. Hi. Could you share the source code for this proj? my email add is ahjie87@gmail.com

    ReplyDelete
  127. should you send the source code
    hichamuradess@gmail.com
    thank you

    ReplyDelete
  128. Hola, comienzo a programar en android y tengo un tropiezo al intentar una conexion entre un dispositivo android y un PIC, mantengo la conexion por un momento incluso logro apagar un led pero cuando intento encenderlo ya no me lo permite, pierdo la conexion con el modulo bluetooth podrian ayudarme con alguna referencia, por favor!.....Gracias :)

    ReplyDelete
  129. Very good tutorial! can you send to me the full project??

    My email is: crnsatishkumar90@gmail.com

    ReplyDelete
  130. please mail me source code at hosseini.it83@gmail.com

    ReplyDelete
  131. Hi, Thanks for your sample project.
    Please send me the project source code.
    My mail is eishweyichooo@gmail.com.

    ReplyDelete
  132. Hi, can you mail me the full project please?
    My email is: chuz41@gmail.com

    ReplyDelete
  133. Please give me full project:
    bappy392@gmail.com

    ReplyDelete
  134. Hi, thanks for the tutorial :) can you mail me the source code? dromandave@gmail.com

    ReplyDelete
  135. Very nice tutorial, can you give me the source code please? :)
    dudin.mukhtar@gmail.com

    ReplyDelete
  136. Great tutorial, can you mail me the source code please? mbpe_199000@hotmail.com
    thanks.

    ReplyDelete
  137. Nice tutorial, Can you please mail the full source code of this, my email id is
    aswanthrc@gmail.com

    ReplyDelete
  138. could u please mail me source code at viplovekarhade@gmail.com

    ReplyDelete
  139. Hi Manoj,

    Could u pls send me the full code at htijnar11@gmail.com
    Thanks in advance.

    ReplyDelete
  140. Hi Manoj,

    Thanks for the great tutorial!!! Could you share your project with me? Actually i am doing a project which includes this part.Please send this as soon as possible.
    my email is ronak0495@gmail.com

    Thanks

    ReplyDelete
  141. Nice tutorial..can you send to me the full project please!
    deepakd.sangamone@gmail.com
    Thanks..

    ReplyDelete
  142. will u plz mail me ur full source code , feel ur code will help me alot, i need to transfer data to a remote via bluetooth using android, i wish to provide input data of a calculator to my local device which i need to transfer to a remote device, get the computation done in the remote and then the result again back by bluetooth, my email biswajitpatra131@gmail.com

    ReplyDelete
  143. hi i want full code for this because i am new android which is help to me...Please send this id deepakd.sangamone@gmail.com

    ReplyDelete
  144. please mail me source code at krishnapillai87@gmai.com

    ReplyDelete
  145. please mail me source code at neoctd@gmail.com

    ReplyDelete
  146. hi,
    i realy like your tutorial

    im trying to understang how bluetooth works, how to create conection between devices
    i tried to make this code run but have a lot of problems


    can you send me a project with this code to ewijaaa@gmail.com


    thanks a lot for sharing your knowledge

    ReplyDelete
  147. thanks for totaril , i used this tutorial for bluetooth connection.when i try to connect to other device, then it gives me focus on Edit text but when i enter some text and move the text pad down, it is not responding.Can you please help me regarding this?.
    email:tesla0202@gmail.com

    ReplyDelete
  148. Awsome tutorial , Please send me the source code at my email log.nishant@gmail.com

    ReplyDelete
  149. please mail me source code at ankit.pathak317@gmail.com

    ReplyDelete
  150. Can you send me the full project please?
    my e-mail is
    michaelchatzakis@gmail.com
    Thanks!

    ReplyDelete
  151. Great tutorial......can you send to me the full project please!
    my email is cykeltur@gmail.com
    thanks

    ReplyDelete
  152. Great tutorial......can you send to me the full project please!
    my email is gaaguayo@alumnos.ubiobio.cl

    ReplyDelete
  153. thanks , i used this tutorial for bluetooth connection.when i try to connect to other device, then it gives me focus on Edit text but when i enter some text and move the text pad down, it is not responding.Can you please help me regarding this?
    kp_ege@hotmail.com
    Thank you

    ReplyDelete
  154. Thank you for your great tutorial.
    Can you post me full source code?

    My Email is ch.rangalakshmi@gmail.com

    ReplyDelete
  155. can you send to me the full project please!
    my email is aminaabdelkafi93@gmail.com
    Thank

    ReplyDelete
  156. Can you send me full example source code

    ReplyDelete
  157. Awesome Tutorial, May you please send me the sourcecode@ libran.download@gmail.com. Thanks in advance.

    ReplyDelete
  158. This comment has been removed by the author.

    ReplyDelete
  159. Can you give me the file please... I try with this but can't do.... Help me please....

    ReplyDelete
  160. Can you give me the source file...

    ReplyDelete
  161. Can you share a link of this project source code??

    ReplyDelete
  162. Great, but im facing some difficults , so can you send me source code of it please
    My email is riteshkotiyal@live.in
    thanks

    ReplyDelete
  163. can you send to me the full project please!! i need it :(
    my email :: Bassam_Sha3ban@yahoo.com

    ReplyDelete
  164. Hi Manoj,
    This is very intresting tutorial, I have used this tutorial but I am facing some issues, Can u Please provide full source code of this tutorial.
    My Email id is- arshad.shaikh1590@gmail.com
    Thanks

    ReplyDelete
  165. Great tutorial Manoj...... I have used this source but I am facing some issues, Can you please send me full source of this tutorial
    my email is arshad.shaikh1590@gmail.com
    Thank

    ReplyDelete
  166. Hi Manoj.Great work you have done.Can you please send me the full code.
    My email id is itsme.akshitajain@gmail.com
    please send me the code as soon as possible

    ReplyDelete
  167. hey Manoj .. Great tutorial. Can you please send me the full code.
    i need it urgently.
    My email-id is itsme.akshitajain@gmail.com

    ReplyDelete
  168. Hi ,
    https://www.dropbox.com/s/cm88h01aj94we8m/BluetoothCommunication.apk?dl=1

    Please download and see bluetooth chat connections, if you like and required this code please mail me , I will send it via email.

    ReplyDelete
    Replies
    1. Hello Manoj,
      Great tutorial
      Can you please send me the full code to jennytran14101987@gmail.com
      Thanks

      Delete
  169. Sir I want to send numeric data via Bluetooth.. Please help me out or send me reference code for that

    ReplyDelete
  170. Hello,

    I could not download the links from the post you posted. Could you send the source code to my email? Nilmarpublio@gmail.com

    Thanks in advance.

    ReplyDelete
  171. This comment has been removed by the author.

    ReplyDelete
  172. nice tutorial. Can you provide code to download?

    ReplyDelete
  173. Yeah, this article is amazing. Thanks for posting this informative article.

    The Android users are increasing daily and I hope this recovery tool may help the smartphone users which are suffering from data loss and media files deletion from them.

    I would like to recommend you the android data lost users to use Android Data Recovery Software to get easily and in just a few steps they will get back their all lost data from LeMax, Realme, Samsung, Blu Dash, Xiaomi, Huawei, ZTE, Lenovo, Motorola, Oppo, OnePlus, and much more mobile phones also.

    ReplyDelete
  174. dear sir mail me plz mohammadikram20001@gmail.com

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Create & Extract tar.gz and tar.bz2 Files in Linux