PeerDeviceNet enables connection and communication among mobile devices (phones, tablets, etc.).
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