android.bluetooth
Class ScoSocket
java.lang.Object
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.
|
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()
|
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
ScoSocket
public ScoSocket(PowerManager pm,
Handler handler,
int acceptedCode,
int connectedCode,
int closedCode)
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()
Please submit a feedback, bug or feature