hi..I am developing an application in J2ME for 40 series(Nokia 6610). In this application i need to send sms. How do i proceed with it. I should let you know that i am a beginner in J2ME...Thanks in advance
hi..I am developing an application in J2ME for 40 series(Nokia 6610). In this application i need to send sms. How do i proceed with it. I should let you know that i am a beginner in J2ME...Thanks in advance
Unfortuntaley your phone model does not support Wireless Messaging API, which provides SMS-sending capatiblility.
Daniel
Thanks for the reply buddy...Can you tell me whether Nokia 3220 and 6020 supports this or not???..
Yes, they both support WMA. To check the support in other devices, just go to http://forum.nokia.com/devices and you have all information about J2ME APIs implemented on a per-device basis.
Daniel
Regarding that you're a beginner, take a look at the documents below:
A MIDlet Example Using the Wireless Messaging API and the Nokia SMS API: Chat
http://www.forum.nokia.com/info/sw.n..._v1_0.pdf.html
MIDP 2.0: Wireless Messaging API Example
http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html
Juarez Alvares Barbosa Junior - Brazil
You can send SMS from the 3220. I have an app that does it and have been using that phone model.
public class SMSObject implements Runnable {
String message;
String phoneNumber;
MessageConnection smsconn;
String address;
public void sendMsg(StartScreen startScr) {
address = "sms://" + this.phoneNumber+":5000";
new Thread(this).start();
}
public void run() {
try {
smsconn = newMessageConnection(this.address);
}
catch (Exception ex) {
}
sendTextMessage(smsconn, this.message, this.address);
}
}
Is there any way to send & receive the email from j2me application?
Thanks in advance
Hi,
You may search the forum there are lot of threads discussing this
http://discussion.forum.nokia.com/fo...ad.php?t=67093
NB:- please don't hijack others thread
wang
Hi,
Sprint might help you - http://developer.sprint.com/site/global/home/p_home.jsp
Br,
Juarez Alvares Barbosa Junior - Brazil
If I send an SMS from a J2ME app, will it be saved in my list of sent SMSs?
Is there a way to prevent it, so that the user cannot see the number he/she has sent the SMS to?
Thanks,
Marco
Dear Marco,
There are lots of examples related to Sending and receiving SMS from j2me app over Web.. As per my experience, no we cant save the sent messages to sent items of native application..Any SMS sending by j2me app not goes to sent items of native applications ..
thanks,
jitu_goldie..
KEEP TRYING..
Thanks for the answer. I have looked through tutorials but still seem to miss something...
I am using this code here to send an SMS, which is pretty much taken from several tutorials online. I have tried different ports and phone numbers 5550000, 55512350 and other similar values with the same result, which is that I get this error "java.io.IOException: SymbianOS error = -33 : General: Operation time-out (-33)". In one occasion, without any specific change, I have been asked for a confirmation message, then nothing else has happened... Can you help please?
private final static String PROTOCOL = "sms://";
private int port = 9700;
public void initialize() {
try {
openServerModeConnection();
Thread t= new Thread(this);
t.start();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void openServerModeConnection() throws Exception {
conn=(MessageConnection)Connector.open(PROTOCOL+":"+port);
conn.setMessageListener(this);
}
public void run() {
while(!aborting) {
synchronized(this) {
if((outgoingTextMessages.size() == 0) && (incomingMessagesPending == 0)) {
try {
wait();
}
catch(InterruptedException e) {}
}
}
if(aborting)
{
break;
}
while(outgoingTextMessages.size()>0) {
OutgoingTextMessage outgoing = (OutgoingTextMessage)outgoingTextMessages.firstElement();
send(outgoing);
outgoingTextMessages.removeElementAt(0);
}
while(incomingMessagesPending > 0) {
receivedTextMessages.addElement(receive());
System.out.println("Received");
synchronized(this) {
incomingMessagesPending--;
}
}
}
}
public void sendMessage(String address, String content){
OutgoingTextMessage outgoing = new OutgoingTextMessage(address, content);
outgoingTextMessages.addElement(outgoing);
synchronized(this)
{
notify();
}
}
protected void send(OutgoingTextMessage outgoing) {
try {
TextMessage message = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
String outgoingAddress = outgoing.getAddress();
if(outgoingAddress.indexOf(':') == -1) {
outgoingAddress += ":" + port;
}
message.setAddress(PROTOCOL + outgoingAddress);
message.setPayloadText(outgoing.getMessage());
Logger.info("ready to send");
Logger.info(outgoingAddress);
conn.send(message);
Logger.info("Message sent");
//outgoingListener.handleOutgoingOk(outgoing);
} catch(Exception e) {
Logger.error(e);
}
}
Hello sir good day ! i have my new problem in j2me i am sending sms through j2me application the problem is
im using myphone qp29 duo then i am sending messages like are you ok then the reciever cant recieve
my original message this is my code the error with them theres a null before each letter?
so they can't recieve the original message..
this is my code
String me = p_send1.getString();
String a = p_message.getString();
if(rona.equals("")) {
alert1 = new Alert("Alert");
alert1.setString("Enter Mobile Number!!!");
alert1.setTimeout(Alert.FOREVER);
display.setCurrent(alert1);
}
else {
try {
clientConn=(MessageConnection)Connector.open("sms://"+me);
}
catch(Exception e)
{
displayAlert(INFO,"Message S Sent !!!", mainScr);
alert1.setTimeout(Alert.FOREVER);
display.setCurrent(alert1);
}
try {
TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE);
textmessage.setAddress("sms://" + me);
textmessage.setPayloadText("Are you ok?");
clientConn.send(textmessage);
}
catch(Exception e)
{
Alert alert1=new Alert("Alert!!!","",null,AlertType.INFO);
alert1.setTimeout(Alert.FOREVER);
alert1.setString("Unable to send");
display.setCurrent(alert1);
}
}
thanks in regard god bless..
Remember that Java uses 16-bit (Unicode) characters. If you have a regular ASCII text and look at it in the memory, every second byte is going to be 0.