Android examples for Bluetooth:Bluetooth Data Transfer
Receives an object through bluetooth.
//package com.java2s; import java.io.ObjectInputStream; import android.bluetooth.BluetoothSocket; public class Main { /**//w w w .j a va 2s . co m * Receives an object through bluetooth. */ public static Object bluetoothReadObject(BluetoothSocket socket) { ObjectInputStream oIS; try { oIS = new ObjectInputStream(socket.getInputStream()); Object object = oIS.readObject(); return object; } catch (Exception e) { return null; } } }