Developer's Guide

Mobile Payments Library Developer Guide and Reference Android OS Edition July 2011 11
account for each of your devices. If you try to login with a different account on a device
after binding, you will get the following error: “This app is attached to another PayPal
account. To remove it, the account holder must visit PayPal.com and select Mobile
Applications from the profile.”
To switch a device or simulator to use a different sandbox account, go to the PayPal
Sandbox website on your computer, login with the account that was used on the device,
select Profile > Mobile Applications, and then unbind the device from the application ID.
getCheckoutButton Method
You must get the Pay with PayPal payment button from the Mobile Payments Library. Use this
method, which returns a CheckoutButton (a subclass of LinearLayout), which you can place
in your application.
public CheckoutButton getCheckoutButton(Context context, int style, int
textType);
Example code of getting the Payment button from the Library is:
CheckoutButton launchPayPalButton = ppObj.getCheckoutButton(this,
PayPal.BUTTON_278x43, CheckoutButton.TEXT_PAY);
RelativeLayout.LayoutParams params = new
RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
params.bottomMargin = 10;
launchPayPalButton.setLayoutParams(params);
launchPayPalButton.setOnClickListener(this);
((RelativeLayout)findViewById(R.id.RelativeLayout01)).addView(lau
nchPayPalButton);