Native Android Sample App
The BFG Native Android SDK includes a sample project that demonstrates the integration of the BFG SDK for games developed on our native Android platform. In it, you will find useful code samples that integrate key features of the SDK into your game, such as user authentication, purchasing, ad monetization, and more.
This document is for the Native Android sample app. If developing in Unity, see the Unity Sample App documentation.
Getting the Sample App
- Download the most up-to-date version of the Native Android SDK from Big Fish’s GitHub release repo.
- For the SDK release you want to integrate, extract the contents of the gzipped tarball.
- Launch Android Studio and select File > Open a Project.
- Navigate to android_studio_projects, located in the SDK release folder.
- Select the "bfgSampleApps" folder and click Open.
Sample App File Structure
Directory | Description |
---|---|
bfgSampleApps/bfgLib-debug | Contains the BFG Android SDK bar file - debug. |
bfgSampleApps/bfgLib-release | Contains the BFG Android SDK bar file - release. |
bfgSampleApps/RaveFacebookPlugin | Contains the RaveFacebookPlugin |
bfgSampleApps/RaveGooglePlugin | Contains the RaveGooglePlugin |
bfgSampleApps/src/amazonf2p | Contains amazon specific config and assets |
bfgSampleApps/src/googlef2p | Contains google specific config and assets |
bfgSampleApps/src/main | Contains the sampleApps code |
Building the Sample App
After downloading the sample app, there is no special configuration needed to build the project.
- Open the sample app in Android Studio.
- Select the target device to build to.
- Click Run.
Key Feature Implementation
The following table lists the key features that are implemented in the sample project and where you can find the configuration and code for each feature.
Feature | Implementation |
---|---|
Implemented by calling | |
AppsFlyer initialized in the config file, bfg_config.json, located in src > res > row | |
Implemented in CrashlyticsActivity.java
| |
Implemented in bfgManagerInternal.java with the | |
Implemented in bfgGameReporting.java Listener passed in the
| |
Implemented in bfgGdprManager.java Listener being passed in the
| |
Implemented in MainActivity.java and in the | |
Implemented in PurchaseController.java |