开发者

PaymentEngine object is always null

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜