Java

Receive new messages

You can display incoming messages by implementing the conversation listener.

Now, locate the getConversation method and add addMessageEventListener call:

Each time a new message is received public void onMessageEvent(@NonNull NexmoMessageEvent messageEvent) listener is called, the new message will be added to the conversationEvents collection and updateConversationView method will be called to reflect the changes.

Run the app

You can either launch the app on the physical phone (with USB Debugging enabled) or create a new Android Virtual Device. When device is present press Run button: