0

i dont have experience in BBM and in my application , one requirement is that . .there in one Buttonfield. when i click on that Button one PopupScreen open .PopupScreen have three field . one TextField second "SendButton" third "Canclebutton" .

i have to enter BBM PIN in TextField and when i click on SendButton .. i have one static massage which will be send to other user (PIN user).

how to implement this ? is there any sdk to implement this ?

can we check this in Simulator ?

apaderno
  • 28,547
  • 16
  • 75
  • 90
Hitarth
  • 1,950
  • 3
  • 27
  • 52

1 Answers1

1

You dont need to use BBM SDK to send a pin message to another user from your application. BB pin is not just limited to BBM. It is a unique identifier for your Blackberry which you can use to send messages using Pin. You can also use your pin along with BBM to send messages in BBM. If you need to enter the pin in a textfield, and send a pre-filled message, you dont need to use BBM. You can use Use the following method to send a pin message

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");
}
} 
rfsk2010
  • 8,571
  • 4
  • 32
  • 46
  • thanx for suggetion . how can we test this in Simulator ? – Hitarth Dec 23 '11 at 12:04
  • We cant test pin messages in simulator. You have to use two devices for testing – rfsk2010 Dec 23 '11 at 12:05
  • You can send emails using the same UI. but create a emailSender() and pass your body and email address to that – rfsk2010 Dec 23 '11 at 12:21
  • i cant add Resource.getString() method ? which file i have to import for this ? – Hitarth Dec 23 '11 at 12:23
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/6087/discussion-between-coder-and-rfsk2010) – Hitarth Dec 23 '11 at 12:30
  • hi @rsk2010 thanx . it is working . but i have to implement some more fuctinality so how to send file/image with content in BBM ? actually i want so share my app using this .. so there is one app icon and some discription of that application .. how to implement this .? plz help me if u have any idea ? – Hitarth Dec 24 '11 at 09:37
  • For this type of sending the message, will it charge?? Or it is free like BBM?? – Arindam Mukherjee Jan 21 '13 at 18:48