0

私はBBMの経験がなく、私のアプリケーションでは、1つの要件はそれです。.1つにありButtonfieldます。Buttonその1つをクリックするとPopupScreen開きます。PopupScreen3つのフィールドがあります。1TextField秒「SendButton」3番目の「Canclebutton」。

入力する必要BBM PINTextFieldあり、SendButtonをクリックすると..他のユーザー(PINユーザー)に送信される静的マッサージが1つあります。

これを実装する方法は?これを実装するためのSDKはありますか?

シミュレータで確認できますか?

4

1 に答える 1

1

アプリケーションから別のユーザーにピンメッセージを送信するためにBBMSDKを使用する必要はありません。BBピンはBBMだけに限定されません。これは、Pinを使用してメッセージを送信するために使用できるBlackberryの一意の識別子です。また、BBMと一緒にPINを使用して、BBMでメッセージを送信することもできます。テキストフィールドにピンを入力し、事前に入力されたメッセージを送信する必要がある場合は、BBMを使用する必要はありません。次の方法を使用して、ピンメッセージを送信できます

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");
}
} 
于 2011-12-23T10:59:23.007 に答える