ConnectionHandler exposes client side async messaging one-way AIDL api to allow ConnectionService call back to notify events such as network attachment and detachment, device connection and disconnection.
GroupHandler exposes client side async messaging one-way AIDL api to allow GroupService notify events such as peer devices joining group, peer devices leaving a group or receiving a message.
Info of a device in peer-peer network: its name, address and port number.
Info of the network connecting peer devices: its type (wifi, hotspot, ...), name (SSID,...), encrypt password, interface name, support multicast or not, etc.
Messaging api for clients to communicate with Router services using intents and messenger.
Reasons why peer device connections failed.
Intenting api allows clients communicate with Router services using intents; clients will send intents/messages to Router services by calling startService() and received intents/messages from Router services by registering BroadcastReceivers.
Messenger api allows clients communicate with Router services using "Messenger" design pattern with messages identified by message ids; clients will use a messenger to send messages to Router services and register another messenger to receive messages from Router services; there is 1-1 correspondence between intent names and message ids.
key names for indexing data items in message bundle.
RouterConnectionClient wrapper class is the preferred way to access the asynchronous one-way AIDL api of Router Connection Service.
RouterGroupClient wrapper class is the preferred way to access the asynchronous one-way AIDL api of Router Group Service.
PeerDeviceNet APIs provides asynchronous messaging interfaces between clients and Router services (Connection Service and Group Service). Router services will expose their APIs as asynchronous messages (or one-way AIDL methods). Similarly clients will provide async messaging (or one-way AIDL methods) APIs to allow Router services to call back or notify clients for events such as network attachment and detachment, peer device connection and disconnection.
Both runtime/Router and api have been published as two jar/aar files at Maven Central. You can download the latest jars from MavenCentral Site, or grab via Maven or gradle as following:
These asynchronous messaging apis between clients and Router services can be accessed in three ways:
Router.Intentclass and "extra" data keys at
Router.MsgKeyclass which you get when you add the client jar file to your project.
RouterGroupClient. These wrapper classes also handle some common book-keeping for you. There is also
NetInfoclass used at aidl apis which defines information about devices and networks.
Router.MsgIdclass and message data keys at