×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Feb 2006
    Location
    PUNE, INDIA
    Posts
    7

    Lightbulb How to send sms through my j2me application

    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

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: How to send sms through my j2me application

    Unfortuntaley your phone model does not support Wireless Messaging API, which provides SMS-sending capatiblility.

    Daniel

  3. #3
    Registered User
    Join Date
    Feb 2006
    Location
    PUNE, INDIA
    Posts
    7

    Re: How to send sms through my j2me application

    Thanks for the reply buddy...Can you tell me whether Nokia 3220 and 6020 supports this or not???..

  4. #4
    Nokia Developer Expert
    Join Date
    Jun 2005
    Posts
    923

    Re: How to send sms through my j2me application

    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

  5. #5
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: How to send sms through my j2me application

    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

  6. #6
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    83

    Re: How to send sms through my j2me application

    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);
    }
    }

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    7

    Re: How to send sms through my j2me application

    Is there any way to send & receive the email from j2me application?

    Thanks in advance

  8. #8
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: How to send sms through my j2me application

    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

  9. #9
    Registered User
    Join Date
    Nov 2007
    Posts
    9

    Re: How to send sms through my j2me application

    do you know will it run on nokia 6555? I have similar code it never worked for me, not on any emulator, not on my blackberry, not on nokia phone. can I send sms to sprint phone or use springt phone to send sms?

    Quote Originally Posted by johnbutler View Post
    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);
    }
    }

  10. #10
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: How to send sms through my j2me application

    Juarez Alvares Barbosa Junior - Brazil

  11. #11
    Registered User
    Join Date
    Nov 2009
    Posts
    7

    Re: How to send sms through my j2me application

    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

  12. #12
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: How to send sms through my j2me application

    Quote Originally Posted by marcoterz View Post
    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..

  13. #13
    Registered User
    Join Date
    Nov 2009
    Posts
    7

    Re: How to send sms through my j2me application

    Quote Originally Posted by jitu_goldie View Post
    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 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);
    }
    }

  14. #14
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: How to send sms through my j2me application

    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..

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,736

    Re: How to send sms through my j2me application

    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.

Similar Threads

  1. can i send SMS automatically?
    By vhepeter2005 in forum General Messaging
    Replies: 3
    Last Post: 2007-04-28, 09:23
  2. Emulating server application to send and receive SMS MMS and WAP Push
    By fbianchi@tisifonecomm.it in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2005-11-09, 18:33
  3. PC Application for send SMS throw 6600 and 9210i
    By max.soft in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-09-23, 17:32
  4. Sending and receiving SMS messages from J2ME application
    By nkn_motoko in forum Mobile Java General
    Replies: 1
    Last Post: 2001-11-06, 20:34

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×