2011-12-23 5 views
0

BBM 및 내 신청서에 경험이 없으므로 하나의 요구 사항이 있습니다. 하나 안에 Buttonfield. 그 때 Button 하나를 클릭하면 PopupScreen이 열립니다. PopupScreen에는 세 개의 필드가 있습니다. one TextField 두 번째 "SendButton"세 번째 "Canclebutton".신청서를 통해 BBM PIN을 사용하여 Blackberry 메신저에서 메시지를 보내는 방법

나는 TextFieldBBM PIN을 입력해야하고 SendButton을 클릭하면 다른 사용자 (PIN 사용자)에게 보낼 정적 메시지 하나가 있습니다.

어떻게 구현하나요? 이 SDK를 구현할 SDK가 있습니까?

시뮬레이터에서 이것을 확인할 수 있습니까?

답변

1

BBM SDK를 사용하여 응용 프로그램에서 다른 사용자에게 핀 메시지를 보내지 않아도됩니다. BB 핀은 BBM에만 국한되지 않습니다. Pin을 사용하여 메시지를 보내는 데 사용할 수있는 Blackberry의 고유 식별자입니다. 핀을 BBM과 함께 사용하여 BBM에서 메시지를 보낼 수도 있습니다. 텍스트 필드에 핀을 입력하고 미리 채워진 메시지를 보내야하는 경우 BBM을 사용할 필요가 없습니다. 다음 메소드를 사용하여 핀 메시지를 보낼 수 있습니다. suggetion에 대해

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

x를 사용할 수 있습니다. 시뮬레이터에서 어떻게 테스트 할 수 있습니까? – Hitarth

+0

시뮬레이터에서 테스트 핀 메시지를 사용할 수 없습니다. – rfsk2010

+0

테스트에 두 개의 장치를 사용해야합니다. 이메일 주소를 bmb PIN으로 추가 할 수 있습니까? – Hitarth

관련 문제