Last updated
Last updated
The Sending.Network Android SDK provides a messaging framework that enables you to integrate chatroom and notification services within your mobile applications. This quickstart will walk you through a simple demo that makes basic API calls like user registration, room creation, etc. Please refer to the SDK demo for the completed code.
Add the following code to the top-level build.gradle configuration file:
Add the sendingnetwork-android-sdk
dependency in app module build.gradle file. Replace the x.y.z
with the SDK version number.
If you intend to run a local P2P node, add the sendingnetwork-android-service
as well. Replace the x.y.z
with the SDK version number.
Your application should at least contain the provider InitializationProvider
to remove the initialization of the WorkManager
as below:
Create SDNClient
instance from the onCreate()
method of the child class of Application
.
There are two ways to join the SDN network. You can create a local P2P service to communicate with the SDN network. Or, you may connect to an existing Edge Node and enjoy the P2P messaging.
To connect to a remote Edge Node:
Please contact developer@sending.network for a test server URL and set it as the nodeUrl
.
To run a local P2P node:
The client calls the login-related APIs through AuthenticationService
:
Query for existing DIDs associated with current wallet address.
Obtain login message by using one of the DIDs or the wallet address if no DID exists.
Request for a message signature with the developer key.
Request for a message signature with the user's wallet account.
Login by passing the two signatures to the edge node.
Your developer key server needs to perform the signing operation. Below is an example code for the client to request a signature from the server:"
Invite a user to a private chat room with the user id.
Open a video conference by using the room ID.
You will need a developer key to access the Edge Network. To request and utilize a developer key, please refer to the guide provided .
OS
Android 6.0 or above
Software
Android Studio 4.0 or above