在BlackBerry中发送PIN消息不起作用
我的应用程序发送PIN消息,但当我的应用程序发送PIN消息时,它只会到达发件箱文件夹,并与时钟图标一起保留在那里。而且它并没有真正发送给收件人 下面是我的代码,你能告诉我有什么问题吗在BlackBerry中发送PIN消息不起作用,blackberry,java-me,Blackberry,Java Me,我的应用程序发送PIN消息,但当我的应用程序发送PIN消息时,它只会到达发件箱文件夹,并与时钟图标一起保留在那里。而且它并没有真正发送给收件人 下面是我的代码,你能告诉我有什么问题吗 public class SendPin implements carinfoResource { private static ResourceBundle _res = ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME); publ
public class SendPin implements carinfoResource
{
private static ResourceBundle _res =
ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME);
public SendPin() {
}
public void sendPin(int command)
{
Store store = Session.getDefaultInstance().getStore();
//retrieve the sent folder
Folder[] folders = store.list(Folder.SENT);
Folder sentfolder = folders[0];
//create a new message and store it in the sent folder
Message msg = new Message(sentfolder);
PINAddress recipients[] = new PINAddress[1];
try{
//create a pin address with destination address of 20000000
recipients[0]= new PINAddress("289A2FF6", "Soporte Desarrollo");
}
catch (AddressException ae)
{
System.err.println(ae);
}
try{
//add the recipient list to the message
msg.addRecipients(Message.RecipientType.TO, recipients);
//Command travel without troubles
if(command == 0)
{
//set a subject for the message
msg.setSubject(_res.getString(OKSUBJECT));
//sets the body of the message
msg.setContent(_res.getString(OKBODY));
}
else
{
//set a subject for the message
msg.setSubject(_res.getString(ISSUESUBJECT));
//sets the body of the message
msg.setContent(_res.getString(ISSUEBODY)+" "+this.getIMSI());
}
Transport.send(msg);
}
catch (MessagingException me)
{
System.err.println(me);
}
}
public String getIMSI() {
String imsi = null;
try {
imsi = GPRSInfo.imeiToString(SIMCardInfo.getIMSI());
} catch (Exception e) {
System.err.println(e);
}
return imsi;
}
}
制作一个简单的应用程序,如图所示。它应该会起作用。然后一步一步地增加复杂性,确保你有BIS访问权限。否则,邮件将保留在发件箱中