×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Bangalore
    Posts
    117

    Is this possible to send SMS from Midlet?

    Hello ....,

    Is this possble to send an SMS from the midlet (to an perticular no)?(in MIDP 1.0)

    If yes can anybody give simple sample code or guide me by providing link where can I get that stuff.....

    Thanxz

    Chandu

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    4
    I think SMS from midlet can send only Siemens phones.

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    47
    Hi!

    gralig: thats not true!

    SMS sending with midlet and GPRS is possible also from Nokia!

    check this service:

    http://www.brodos.com


    gicio

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    4
    The question was about sending SMS using midlet and phone. Only Siemens has a Java packages which can send SMS using only mobil phone and operator. You send just URL to SERVICE which sends SMS. This is not the same as sending MS from MIDLET ;o)
    Using Siemens Java packages You can send SMS from ildet on the same way as write it on phone and send.

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    47
    uppssss...

    sorry




    gicio

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    4
    You can send SMS in midlet in 3650 in WMA API.

  7. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    1

    Nokia 3650 mobile phone can send SMS

    For example you qantg to send a SMS to your girl friend whose name is String tel="+393284675869" (She is italian )

    First you must get the port:
    String smsPort = getAppProperty("SMS-Port");

    Now you must get a SMSConnection:
    MessageConnection sms_con=(MessageConnection)Connector.open("sms://"+tel+":"+smsPort);

    Now you must write the message:
    TextMessage sms=(TextMessage)sms_con.newMessage(MessageConnection.TEXT_MESSGE);
    sms.setAddress(tel+":"+smsPort);
    sms.setPayloadText("I love you");

    Now it's all ready to sens the SMS:

    sms_con.send(sms);
    sms_con.close();

    To receive a SMS it's all similar to what is above except the begining, You don't have to write the telephone number to get the SMSconnection but only the port therefore the statement is this Connector.open("sms://:54") if the port is 54.

    I don't now if the example works really because I wrote it on the fly and I didn't test it. It can syntax errs

    Bouna Fortuna

  8. #8
    Registered User
    Join Date
    Mar 2003
    Location
    Malaysia-Johor-Pontian Kecil
    Posts
    163
    Hi,

    According to

    http://www.forum.nokia.com/main/1,65...ml&fileID=3226

    Page 10 (Section 3.6)

    3.6 Java Messaging
    The Wireless Messaging API allows developers to integrate Short Message Service (SMS) messaging with
    their Java applications. Several Series 40 devices (notably the Nokia 3300, Nokia 6220, Nokia 6800, and
    Nokia 7250i mobile phones) include support for the JSR-120 Wireless Messaging API, but it should be
    noted that WMA support is not a requirement for Series 40 Platform compliance.


    I think there will have more models to support WMA. Nokia 6600 is also supporting WMA.

    Best Regards,
    chai.

  9. #9
    Registered User
    Join Date
    Mar 2003
    Posts
    10
    Hello,

    I had been playing around with the WMA API. I am able to send sms to another mobile using MIDlet. However, I am not able to send sms to a sms gateway. Does the WMA only for peer to peer? Or have i missed out something?

  10. #10
    Registered User
    Join Date
    Mar 2003
    Posts
    20
    By the way, anyone can tell me why I get an error when trying to compile the following midlet ? The error I get is:

    c:\WTK104\apps\sms\src\sms.java:24: incompatible types

    found : javax.wireless.messaging.Message

    required: javax.wireless.messaging.TextMessage

    TextMessage msg = conn.newMessage( conn.TEXT_MESSAGE );

    ------

    Here's the midlet:

    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.wireless.messaging.*;

    public class sms extends MIDlet {
    Display display;
    Form form;

    public void destroyApp(boolean unconditional) {
    notifyDestroyed();
    }

    public void pauseApp() {
    }

    public void startApp()
    {
    MessageConnection conn = null;
    String url = "sms://+39xxx"; //full phone number there

    try {
    conn = (MessageConnection) Connector.open( url );
    TextMessage msg = conn.newMessage( conn.TEXT_MESSAGE );
    msg.setPayloadText( "SMS Test" );
    conn.send( msg );
    }
    catch( Exception e ){
    // handle errors
    }
    finally {
    if( conn != null ){
    try { conn.close(); } catch( Exception e ){}
    }
    }

    }
    }

  11. #11
    Registered User
    Join Date
    Oct 2003
    Posts
    1
    If i'm not mistaken, i think the value returned by:
    conn.newMessage( conn.TEXT_MESSAGE )
    is not a type TextMessage, but instead a Message. So you just need to change the code to:
    Message msg = conn.newMessage( conn.TEXT_MESSAGE );

  12. #12
    Registered User
    Join Date
    Mar 2003
    Posts
    20
    It was a type problem, yeah. I tried the resulting midlet on my 3650 but it doesn't work and gives back an error message. Do you think I still miss anything ?

    Thanks again

  13. #13
    Registered User
    Join Date
    Sep 2005
    Posts
    21

    Re: Is this possible to send SMS from Midlet?

    Hi,

    Any one Please send me code for sending SMS from Midlet.

    Also send me code on how to make a CALL from MIdlet..

  14. #14
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Is this possible to send SMS from Midlet?

    sendign sms is up there
    for calling, rtfm ...
    a clue : it's in MIDlet.platformRequest()
    and you might also need to read the rfc2806

  15. #15
    Registered User
    Join Date
    Aug 2007
    Posts
    3

    Re: Is this possible to send SMS from Midlet?

    can anyone one tell me

    how to send an sms from a midlet ????

    Please help!!!


    Thanks in advance!!

Page 1 of 2 12 LastLast

Posting Permissions

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