How to integrate paypal donate in android app?
How to create paypal donate button in android a开发者_Go百科pplication and how to do the donation throw that
please help me with some source code
PayPal donate can be considered as just a HTTP GET request to a specific URL. You can set a ImageView
and bind URL opening through the standard Android browser via an onClick
event.
There is an alternative way of integrating Paypal to your android app without leaving it.
Paypal integration for android becomes fairly simple if you follow their developer site. You will need to download and integrate the library provided by Paypal, which is available on Paypal developer site.
Sample Pizza application built using Eclipse demonstrate how to do actual integration which is quite simple. Although paypal seems forgot to use relative path for library. So you will have to change library path and application is ready to go.
I use this for my donation buttons and have it set as a picture button:
Donate.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/your_paypal"));
startActivity(browserIntent);
}
});
to get the link version click the email version when setting up the button
You can also use android-donations-lib which is a donations Library for Android.
This library supports donations by Google Play Store, PayPal, and Flattr. They provide a full documentation and installation guide.
精彩评论