Prerequisites
Before you start this tutorial, make sure that you meet the following prerequisites:- 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.
- Apps building on the Android platform must ensure that BLUETOOTH_CONNECT is present in the app manifest so Party can monitor and connect to available Bluetooth devices.
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 3.5.7. Please use an openSSL version that is 3.5.7 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++, you need to make a 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
