Skip to content
This repository

Donations Library for Android. Supports Google Play Store, PayPal, and Flattr

branch: master

Android Donations Lib

Android Donations Lib supports donations by Google Play Store, PayPal, and Flattr.

It is used in my projects AdAway, FasterGPS, and NTP-Sync.



  • Permissions are now defined per product flavor, they were removed from library's AndroidManifest


  • Now uses Gradle Build System (
  • No xml configuration needed anymore!
  • Fragment can be instantiated and used in any Activity.
  • You can build "product flavors" defined by the ExampleApp: One version with Google Play Donation capability and one with Paypal and Flattr! (Google mailed me to remove PayPal donation capability when publishing on Google Play!)


Fork Android Donations Lib and do a pull request. I will merge your changes back into the main project.



Build Example App with Gradle

  1. Have Android SDK "tools", "platform-tools", and "build-tools" directories in your PATH (
  2. Export ANDROID_HOME pointing to your Android SDK
  3. Download Android Support Repository, and Google Repository using Android SDK Manager
  4. Execute ./gradlew build

Add the lib to your project

  • The ExampleApp depends on "libraries/Donations" and has two product flavors defined in its gradle configuration.
  • See ExampleApp/build.gradle how to build different product flavors. The build script adds DONATIONS_GOOGLE to the auto generated
  • See how to instantiate the Fragment based on DONATIONS_GOOGLE.
  • When publishing the app you have to create unmanaged in-app products for your app in the Google Play Store that matches the ones you defined in private static final String[] GOOGLE_CATALOG
  • Add <uses-permission android:name="android.permission.INTERNET" /> to product flavors that use Flattr
  • Add <uses-permission android:name="" /> to product flavors that use Google Play In-app billing
Something went wrong with that request. Please try again.