Skip to content

ASAPPeer

Thomas Schwotzer edited this page Aug 14, 2021 · 30 revisions

From developers perspective, there are just two relevant methods offered by an ASAP peer:

  • an ASAP peer can be asked to deliver a message
  • a listener can be informed about incomming messages

Sending a message is not difficult:

static final CharSequence YOUR_APP_NAME = "application/x-yourAppName";
static final CharSequence YOUR_URI = "yourSchema://example";
...
ASAPPeer alicePeer = ...;
byte[] serializedData = "VerySimpleExampleData".getBytes();
// send data
alicePeer.sendASAPMessage(YOUR_APP_NAME, YOUR_URI, serializedData);
// message is stored in the peer

Peers can establish a point-to-point connection. We talk about an ASAPEncounter

Clone this wiki locally