Example - Send Message

This example shows how to send a text message to a friend.

String JOINED_SERVER = "https://joinedserver.geomobile.de:7012/friendfinder";
String JOINED_API_KEY = "5923078164";

/* CREATE CLIENT */
JOClient client = JOClient.createJoinedClient(JOINED_SERVER, JOINED_API_KEY);

/* LOGIN USER */
JOUser user = client.login("username", "password");

/* GET FRIENDS */
List<JOFriend> friends = friends = client.getFriends(user);

/* USER SENDS MESSAGE TO FRIEND */
client.sendMessage(user, friends.get(0), "Hello");

If the send process fails, the client throws an exception. All potential exceptions are documented in the Java API Documentation of the Joined API for Android and can be found here.

An example implementation of the example is part of the Joined API for Android project and can be found here.