Skip to content

Encounter

Thomas Schwotzer edited this page Aug 27, 2021 · 4 revisions

This libary hides most details of establishing a point-to-point connection to another device from developers. It support ad hoc networks but also ASAPHub acccess. The idea is simple: You application can switch on and off ad hoc protocols or ASAP hub sessions. This library created point-to-point connections. Once establihsed, an ASAP encounter takes place and messages are exchanged.

Developers do not have to deal with any detail. Activate or deactivate protocols. That's it. You application logic was already implemented and tested in a pure Java project. It has not to be changed in a single line.

Bluetooth

YourActivity extends ASAPActivity {
...
    this.startBluetooth();
    this.stopBluetooth();
}

Bluetooth is switched on or off. This library will initiate an ASAP encounter whenever a paired device comes close.

YourActivity extends ASAPActivity {
...
    this.startBluetoothDiscoverable();
    this.startBluetoothDiscovery();
}

This device becomes discoverable or starts discovering other devices in it surrounding. Both actions stop automatically after about a minute. User become a notification if another - non paired - device can be connected.

YourActivity extends ASAPActivity {
...
    this.isBluetoothDiscoverable() 
    this.isBluetoothDiscovery() 
    this.isBluetoothEnvironmentOn() 
}

You activity can check Bluetooth related status.

Hub management

TODO