Android examples for Bluetooth:Bluetooth Data Transfer
Sends an object through bluetooth.
//package com.java2s; import java.io.ObjectOutputStream; import android.bluetooth.BluetoothSocket; public class Main { /**// www. jav a2 s .c o m * Sends an object through bluetooth. */ public static boolean bluetoothWriteObject(Object object, BluetoothSocket socket) { try { ObjectOutputStream oOS = new ObjectOutputStream( socket.getOutputStream()); oOS.writeObject(object); oOS.flush(); return true; } catch (Exception e) { return false; } } }