Braintree-Android Development Notes
July 20, 2026 · View on GitHub
This document outlines development practices that we follow internally while developing this SDK.
Setup
- Make sure Java 11 is installed and available in your
PATH. - If you do not have the Android SDK installed, install Android Studio which includes the Android SDK.
- If you do have the Android SDK installed, add a
local.propertiesfile to the top level directory withsdk.dir=/path/to/your/sdk - Run
./gradlew :Demo:installDebugto install the Demo app on a device. - See the testing section for more about setting up and running tests.
Development Merchant Server
The included demo app utilizes a test merchant server hosted on heroku (https://braintree-sample-merchant.herokuapp.com). It produces client tokens that point to Braintree's Sandbox Environment.
Tests
Unit Tests
Run all unit tests:
./gradlew test
Integration Tests
Run all integration tests:
./gradlew connectedAndroidTest
Note: You need to start an emulator or connect a device before running integration tests.
Architecture
There are several components that comprise this SDK:
- AmericanExpress provides American Express rewards balance functionality.
- BraintreeCore provides the networking, communication and modeling layer for Braintree.
- Card provides credit and debit card tokenization functionality.
- DataCollector collects and provides data for PayPal fraud detection.
- Demo is a collection of Braintree reference integrations.
- GooglePay provides Google Pay integration.
- LocalPayment provides LocalPayment integration.
- PayPal provides PayPal integration.
- PayPalMessaging provides PayPal messaging and promotional offers.
- SEPADirectDebit provides SEPA Direct Debit integration.
- SharedUtils provides shared utilities across all modules in the SDK.
- ShopperInsights provides shopper insights and recommendations.
- TestUtils contains common test code used between modules.
- ThreeDSecure provides 3D Secure authentication support.
- UIComponents provides PayPal/Venmo branded buttons that support complete PayPal/Venmo flows.
- Venmo provides Venmo integration.
The individual components may be of interest for advanced integrations and are each available as modules in maven.
Environmental Assumptions
- Java 11
- Android Studio
- Gradle
- Android SDK >= 23
- Host app does not integrate with the Kount SDK
- Host app has a secure, authenticated server with a Braintree server-side integration
Committing
- Commits should be small but atomic. Tests should always be passing; the product should always function appropriately.
- Commit messages should be concise and descriptive.
Git Hooks
We use a commit-msg hook to enforce consistent commit message formatting. Follow the guidelines below to prevent issues with improperly formatted messages.
Install (Manual — recommended)
Run the following once from the repo root after cloning:
mkdir -p .git/hooks
cp scripts/commit-msg .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
Install (via pre-commit framework)
If you have pre-commit installed (or install it via pip3 install pre-commit):
pre-commit install --hook-type commit-msg
Commit format
Commits must follow <type>: <description> (or <type>(scope): <description>), where <description> starts. Allowed types:
| Type | When to use |
|---|---|
fix | Patches a bug |
feature | Introduces a new feature |
docs | Documentation changes only |
style | Formatting changes that don't affect behavior |
refactor | Code restructuring that is neither a fix nor a feature |
test | Adding or updating tests |
pr-feedback | Address PR feedback |
Examples:
feature: add paypal vaulting support
fix(venmo): resolve null pointer on auth
docs: update README installation steps
refactor(BraintreeCore): simplify token parsing logic
test: add unit tests for 3DS flow
Deployment and Code Organization
- Code on main is assumed to be in a relatively good state at all times
- Tests should be passing, all demo apps should run
- Functionality and user experience should be cohesive
- Dead code should be kept to a minimum
- Versioned deployments are tagged with their version numbers
- Version numbers conform to SEMVER
- These versions are more heavily tested
- We will provide support for these versions and commit to maintaining backwards compatibility on our servers
- Pull requests are welcome
- Feel free to create an issue on Github before investing development time
- As needed, the Braintree team may develop features privately
- If our internal and public branches get out of sync, we will reconcile this with merges (as opposed to rebasing)
- In general, we will try to develop in the open as much as possible