Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i send pin messages programatically..


thanks
Posted
Comments
Sahil Mahajan Mj 27-Aug-12 2:49am    
why do you want to send pin messages, instead you could send messages from facebook for free.
AmanArora1987 27-Aug-12 3:59am    
bcz in blackberry there is in built messenger in device, to communicate between two or more devices with the help of PIN... But i dont knw how to use that pin in a program
Joan M 28-Aug-12 3:45am    
Let's see, if you want to add more information to the question itself (which in this case is needed) you can click on the green link "Improve question" that you can find under your own question.
If you add code as a solution, without any explanation this will be reported as it can't be considered an answer.

Apart of that, reposting is considered evil here.

So you've got a bullseye here: reposting code dumps without explanation.

:(

public final class pinMessageScreen extends MainScreen implements FieldChangeListener
{
char []check = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
ButtonField Send;
String address;
EditField pinaddress;
boolean pass;
public pinMessageScreen()
{
setTitle("Working of PIN Messageds");
pinaddress = new EditField("Enter PIN Address : ", "", 8, 0);
add(pinaddress);
Send = new ButtonField("SEND", Field.FIELD_HCENTER);
add(Send);
Send.setChangeListener(this);
}
public void fieldChanged(Field field, int context)
{

if(field == Send)
{
if(pinaddress.getText().equalsIgnoreCase(""))
{
Dialog.inform("Enter Pin");
}
else if(pinaddress.getText().length()<8)
{
Dialog.inform("PIN Address should not be less than 8 chars");
pinaddress.setText("");
}
else
{
Store store = Session.getDefaultInstance().getStore();
Folder[] folder = store.list(Folder.SENT);
Folder sent = folder[0];
Message msg = new Message(sent);
PINAddress receipent[] = new PINAddress[1];
address = pinaddress.getText();
for (int i = 0; i < address.length(); i++)
{
pass = false;
for (int j = 0; j < check.length;j++)
{
if(address.charAt(i) == check[j])
{
System.out.println("<<<<<<<<<<address>>>>>>>>>" + address.charAt(i));
System.out.println("<<<<<<<<<<check>>>>>>>>" + check[j]);
pass = true;
break;
}
}
}
if(pass == true)
{
try
{
address = pinaddress.getText();
receipent[0] = new PINAddress(address, null);
msg.addRecipients(Message.RecipientType.TO, receipent);
msg.setSubject("Test Mail");
msg.setContent("This mail is to remind you that programmatically we can send the mail");
msg.setPriority(Priority.HIGH);
Transport.send(msg);
Dialog.inform("Email send Successfully!"+ receipent);
}
catch (Exception e)
{
e.printStackTrace();
}
}
else
{
Dialog.inform("Plz enter valid PIN Address");
pinaddress.setText("");
}
}
}
}
}
 
Share this answer
 
why do you want to send pin messages, instead you could send messages from facebook for free.
 
Share this answer
 
Comments
Joan M 27-Aug-12 9:53am    
PIN messages are:

1. free
2. the native messaging in BB devices.
3. work as push.
4. if you have a bb device then they work directly, without installing any extra software.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900