开发者

PaymentEngine object is always null

开发者 https://www.devze.com 2023-03-11 20:20 出处:网络
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 m

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

精彩评论

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

关注公众号