I am trying to build a payment appication on BlackBerry jde version 5.0.0.14. When I debug the code, PaymentEngine object is always nu开发者_如何学JAVAll. Why does this happen? Is there any fault in my code?
private PaymentEngine engine = PaymentEngine.getInstance();
public PurchaseDemoScreen()
{
setTitle("Payment Service SDK Demo");
if (engine != null)
{
engine.setConnectionMode(PaymentEngine.CONNECTION_MODE_LOCAL);
//do shopping
}
else
{
//in-app purchase unavilable
}
}
What version of the BlackBerry App World do you have installed?
PaymentEngine.getInstance()
does return null if the BlackBerry device does not have BlackBerry App World 2.1 or higher installed.
精彩评论