2011-12-23 36 views
0

我沒有BBM和我的應用程序的經驗,其中一個要求就是這樣。在一個Buttonfield。當我點擊那個Button一個PopupScreen打開。 PopupScreen有三個字段。一個TextField第二個「SendButton」第三個「Canclebutton」。如何通過應用程序使用BBM PIN在黑莓Messenger中發送消息

我必須進入BBM PINTextField當我點擊SendButton ..我有一個靜態按摩將發送給其他用戶(PIN用戶)。

該如何實現?有沒有sdk來實現這個?

我們可以在模擬器中檢查嗎?

回答

1

您不需要使用BBM SDK從您的應用程序向其他用戶發送PIN消息。 BB引腳不僅限於BBM。它是Blackberry的唯一標識符,您可以使用它來使用Pin發送消息。您還可以使用您的PIN和BBM一起在BBM中發送消息。如果您需要在文本框中輸入該針腳,併發送預填充消息,則不需要使用BBM。您可以使用使用以下方法發送PIN消息

public static void sendPinMessage(String address,String body) 
{ 
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 
    recipients[0]= new PINAddress(address,"My app"); 
} 

catch (AddressException ae) 
{ 
    Log.Error(ae,"Check address"); 
} 

try{ 
    //add the recipient list to the message 
    msg.addRecipients(Message.RecipientType.TO, recipients); 

//set a subject for the message 

     msg.setSubject("Subject"); 

    //sets the body of the message 
    msg.setContent(body); 

    //send the message 
    Transport.send(msg); 
} 

catch (MessagingException me) 
{ 
    Log.Error(me,"Message excpetion in sending pin"); 
} 
} 
+0

thanx for suggetion。我們如何在模擬器中測試它? – Hitarth 2011-12-23 12:04:44

+0

我們不能在模擬器中測試引腳信息。您必須使用兩個設備進行測試 – rfsk2010 2011-12-23 12:05:56

+0

好。我們可以添加電子郵件登入bbm PIN嗎? – Hitarth 2011-12-23 12:15:39

相關問題