Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.ObjectOutputStream;

import android.bluetooth.BluetoothSocket;

public class Main {
    /**
     * 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;
        }
    }
}