Prerequisites
Before you start this tutorial, please ensure that the following prerequisites have been met:- You created a PlayFab developer account.
- You created a PlayFab Title and your title has been allow-listed for PlayFab Party.
- You have Android Studio version 3.2 or higher installed.
- Your app targets Android 4.4 (Kitkat) or higher.
- You have the Android NDK 18.1.5063045 or higher installed.
- You have access to the PlayFab Party platforms repository
- You have created an android signing cert and signed your app for deployment using the cert config.
Including the required libraries and header files
You’ll need to include the following header files from the PlayFab Party distribution repository. LIB Files- libParty.a
- libcrypto.a
- libssl.a
The SSL libraries are built from Open SSL Version 1.1.1b-dev. Please use an openSSL version that is 1.1.1b-dev or higher.
In addition to the lib files and headers above, you’ll also need the libs and headers for PlayFab SDK and any other platform-specific dependencies your app needs. Please take a look at the project file organization for the Android sample for more info.
Steps to get PlayFab Party working on Android
Since the core Party library is written using C++, we’ll need to make a simple JNI wrapper class to access the Party lib functionality. At a high level, you’ll want a class that has access to Party API methods to create a network, connect to a network, and send messages across a network. We’ve achieved this in our demo app via the NetworkManager Java class.joinNetwork is in the C++ layer in PartyDemo.cpp shown below.
joinNetwork calls into NetworkManager::CreateAndConnectToNetwork() which in turn calls the raw Party API exposed in Party.h
