|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.content.Context
android.content.ContextWrapper
android.view.ContextThemeWrapper
android.app.Activity
org.android.activityminer.app.util.BTTransferActivity
public class BTTransferActivity
The activity for the transfer of activity labels to the timeline tagging activity.
Nested Class Summary | |
---|---|
private class |
BTTransferActivity.ConnectionTask
Thread for the bluetooth connection |
Field Summary | |
---|---|
private static int |
ACK
End of transmission constant |
private BluetoothAdapter |
btAdapter
The bluetooth adapter instance. |
private BTTransferActivity.ConnectionTask |
connectionTask
The thread to establish the connection |
private String |
dBUuid
The uuid of the database to transfer; |
private ArrayAdapter<String> |
devicesAdapter
List adapter for bluetooth devices. |
private AtomicBoolean |
discoveryWasCanceled
The flag for a manual interruption of BT discovery |
private static int |
EOT
End of transmission constant |
private String |
message
The message to transfer; |
private BroadcastReceiver |
receiver
The receiver for BT broadcast events |
private UUID |
uuid
The unique uuid for secure communication. |
Fields inherited from class android.app.Activity |
---|
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK |
Fields inherited from interface android.content.ComponentCallbacks2 |
---|
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN |
Constructor Summary | |
---|---|
BTTransferActivity()
Constructor |
Method Summary | |
---|---|
private void |
connect(BluetoothDevice device)
Does try to connect to a bluetooth device |
private void |
doDiscovery()
Start device discover with the BluetoothAdapter |
void |
onConnectionEstablished(BluetoothSocket socket)
Handler for an established connection. |
private void |
onConnectionFailed()
Connection failure handler |
protected void |
onCreate(Bundle savedInstanceState)
|
protected void |
onDestroy()
|
void |
onDeviceSelected(String macAdress)
Handler for device selection |
protected void |
onResume()
|
void |
writeMessageAndWaitForAck(OutputStream out,
InputStream in,
String msg)
Does write a string to the out stream and waits for an ACK from the in stream. |
Methods inherited from class android.view.ContextThemeWrapper |
---|
applyOverrideConfiguration, attachBaseContext, getResources, getTheme, setTheme |
Methods inherited from class android.content.Context |
---|
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int EOT
private static final int ACK
private BluetoothAdapter btAdapter
private final BroadcastReceiver receiver
private ArrayAdapter<String> devicesAdapter
private UUID uuid
private BTTransferActivity.ConnectionTask connectionTask
private String message
private String dBUuid
private final AtomicBoolean discoveryWasCanceled
Constructor Detail |
---|
public BTTransferActivity()
Method Detail |
---|
protected final void onCreate(Bundle savedInstanceState)
onCreate
in class Activity
public final void onDeviceSelected(String macAdress)
macAdress
- mac adress of the deviceprivate final void connect(BluetoothDevice device)
device
- the bluetooth devicepublic void onConnectionEstablished(BluetoothSocket socket)
socket
- the socketpublic void writeMessageAndWaitForAck(OutputStream out, InputStream in, String msg) throws IOException
out
- out streamin
- in streammsg
- the message
IOException
- in case of errorsprivate final void onConnectionFailed()
protected final void onResume()
onResume
in class Activity
protected final void onDestroy()
onDestroy
in class Activity
private final void doDiscovery()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |