Android Donations Lib supports donations by Google Play Store, PayPal, and Flattr.
It is used in my projects AdAway, FasterGPS, and NTP-Sync.
Fork Android Donations Lib and do a pull request. I will merge your changes back into the main project.
- New -> Android Project -> Create project from existing source, choose org_donations
- Add org_donations as Android Lib (Properties of your project -> Android -> Library -> add org_donations as android library)
- Add the following lines to your AndroidManifest for permissions:
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required permission to use Google Play Store donations -->
<uses-permission android:name="com.android.vending.BILLING" />
- Add the following lines to your AndroidManifest the activity:
<activity
android:name="org.donations.DonationsActivity"
android:excludeFromRecents="true"
android:label="Donations"
android:launchMode="singleTask"
android:theme="@android:style/Theme.DeviceDefault.Dialog" />
<!-- - Google Play Store donations -->
<service android:name="org.donations.google.BillingService" />
<receiver android:name="org.donations.google.BillingReceiver" >
<intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>
</receiver>
- Copy the file
donations__config.xml
tores/values/
of your own project - Configure the Donations Lib by altering
donations__config.xml
- Integrate this activity in your app by opening it as an intent:
startActivity(new Intent(this, DonationsActivity.class));
- When publishing the app you have to create in-app products for your app in the Google Play Store that matches the ones you defined in
donations__config.xml