Sample apps
Braze SDKs each come with a sample application within the repository for your convenience. Each of these apps is fully buildable so you can test Braze features alongside implementing them within your own applications.
Testing behavior within your own application versus expected behavior and code paths within the sample applications is an excellent way to debug any problems you may run into.
Building the Droidboy test application
Our test application within the Android SDK GitHub repository is called Droidboy. Follow these instructions to build a fully functional copy of it alongside your project.
- Create a new workspace and note the Braze API identifier key.
- Copy your FCM sender ID and Braze API identifier key into the appropriate places within
/droidboy/res/values/braze.xml
(in between the tags for the strings namedcom_braze_push_fcm_sender_id
andcom_braze_api_key
, respectively). - Copy your FCM server key and server ID into your workspace settings under Manage Settings.
- To assemble the Droidboy APK, run
./gradlew assemble
within the SDK directory. Usegradlew.bat
on Windows. - To automatically install the Droidboy APK on a test device, run
./gradlew installDebug
within the SDK directory:
Building the Hello Braze test application
The Hello Braze test application shows a minimal use case of the Braze SDK and additionally shows how to easily integrate the Braze SDK into a Gradle project.
- Copy your API identifier key from the Manage Settings page into your
braze.xml
file in theres/values
folder. - To install the sample app to a device or emulator, run the following command within the SDK directory:
1
./gradlew installDebug
If you don’t have your
ANDROID_HOME
variable properly set or don’t have alocal.properties
folder with a validsdk.dir
folder, this plugin will also install the base SDK for you. See the plugin repository for more information.
For more information on the Android SDK build system, see the GitHub Repository README.