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.ObjectInputStream;

import android.bluetooth.BluetoothSocket;

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