Build 1.0_r1(from source)

android.bluetooth
Class ScoSocket

java.lang.Object
  extended by android.bluetooth.ScoSocket

public class ScoSocket
extends Object

The Android Bluetooth API is not finalized, and *will* change. Use at your own risk. Simple SCO Socket. Currently in Android, there is no support for sending data over a SCO socket - this is managed by the hardware link to the Bluetooth Chip. This class is instead intended for management of the SCO socket lifetime, and is tailored for use with the headset / handsfree profiles.


Field Summary
static int STATE_ACCEPT
           
static int STATE_CLOSED
           
static int STATE_CONNECTED
           
static int STATE_CONNECTING
           
static int STATE_READY
           
 
Constructor Summary
ScoSocket(PowerManager pm, Handler handler, int acceptedCode, int connectedCode, int closedCode)
           
 
Method Summary
 boolean accept()
          Accept incoming SCO connections.
 void close()
           
 boolean connect(String address)
          Connect this SCO socket to the given BT address.
protected  void finalize()
          Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
 int getState()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_READY

public static final int STATE_READY
See Also:
Constant Field Values

STATE_ACCEPT

public static final int STATE_ACCEPT
See Also:
Constant Field Values

STATE_CONNECTING

public static final int STATE_CONNECTING
See Also:
Constant Field Values

STATE_CONNECTED

public static final int STATE_CONNECTED
See Also:
Constant Field Values

STATE_CLOSED

public static final int STATE_CLOSED
See Also:
Constant Field Values
Constructor Detail

ScoSocket

public ScoSocket(PowerManager pm,
                 Handler handler,
                 int acceptedCode,
                 int connectedCode,
                 int closedCode)
Method Detail

finalize

protected void finalize()
                 throws Throwable
Description copied from class: Object
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.

Note: The virtual machine assumes that the implementation in class Object is empty.

Overrides:
finalize in class Object
Throws:
Throwable - The virtual machine ignores any exceptions which are thrown during finalization.

connect

public boolean connect(String address)
Connect this SCO socket to the given BT address. Does not block.


accept

public boolean accept()
Accept incoming SCO connections. Does not block.


close

public void close()

getState

public int getState()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature