Example - Invite User

This example shows how to invite another user to be 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");

/* SEARCH FRIENDS */
List<JOFriend> friends = friends = client.searchFriends(user);

/* USER INVITES OTHER USER */
if (friends.size() == 1)
{
  client.addFriend(user, friends.get(0));
}

If the invitation 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.