我正在使用以下代码注册Blackberry推送,但我得到非法参数异常。我不明白这个问题。如果不正确,请告诉我是什么问题.Plese提供一些资源来开发服务。
Thread t=new Thread()
{
public void run()
{
ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor();
byte serverType = PushApplicationDescriptor.SERVER_TYPE_BPAS;
PushApplicationDescriptor pad = new PushApplicationDescriptor(appId,port,serverUrl,serverType,ad);
PushApplicationStatus pushApplicationStatus = PushApplicationRegistry.getStatus(pad);
byte pasStatus = pushApplicationStatus.getStatus();
if (pasStatus != PushApplicationStatus.STATUS_ACTIVE
&& pasStatus != PushApplicationStatus.STATUS_PENDING) {
PushApplicationRegistry.registerApplication(pad);
System.out.println("Registering new..." + pasStatus);
_imageField.setText("Registering new..." + pasStatus);
} else {
_imageField.setText("Already registered device..."+pasStatus);
System.out.println("Already registered device..." + pasStatus);
}
lf.setText("Label"+pasStatus);
}
};
t.start();
答案 0 :(得分:0)