How to send and receive MeshMS messages

Serval Mesh provides SMS-like one-to-one text messaging via the MeshMS protocol. Users can securely send and receive messages to each other. Third party application can also send and receive these types of messages by using the APIs outlined below.

This page describes the Android Permissions and Intents that Serval Mesh provides for other Android apps. This interface is deprecated, so apps should use the correct MeshMS API instead.

Sending a MeshMS

To send a MeshMS the application must declare that it uses the permission:

org.servalproject.meshms.SEND_MESHMS

. The application must also include an implementation of the SimpleMeshMS class.

The SendMeshMsActivity in the Serval Mesh Sampler application provides sample code that shows how to populate an instance of the SimpleMeshMS class and send it to the ServalMesh software using an Intent for processing.

Receive a MeshMS

To receive a MeshMS the application must declare that it uses the permission:

org.servalproject.meshms.RECEIVE_MESHMS

. The application must also include an implementation of the SimpleMeshMS class.

New MeshMS messages that are received by the Serval Mesh software result in a broadcast intent being sent with the action:

org.servalproject.meshms.RECEIVE_MESHMS

.

The IncomingMeshMsReceiver in the Serval Mesh Sampler application provides sample code that shows how to extract the values that comprise a MeshMS message from the intent.

The ReceiveMeshMsActivity in the Serval Mesh Sampler application uses the broadcast receiver to display the contents of the message.


Login