×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    Is the 3410 SMS API broken?

    I have spent some time trying to get the SMS API on the 3410 to work, but am rapidly coming to the conclusion that the SMS API is broken. I have read a lot of messages on this group asking whether SMS can be used and a lot of sample code passed around, but I havn't heard anyone saying they _are_ sending SMS messages. I think it would be appropriate for someone from Nokia to clear this up categorically.

    When testing on my Nokia 3410, I have created some dummy API interfaces so my test program can build as described in the sample code. I have then downloaded the app to the phone and tested. I've noticed the following:

    1. I use the MessageConnection object to create me a TextMessage using the newMessage() method. However, if I call _any_ method on TextMessage from the TextMessage or Message interfaces, the application crashes and I get a screen with the letter 'p' in the top left

    2. I created my own PeteMessageClass by implementing interface TextMessage. When I create an instance of PeteMessageClass, the application crashes and I get the letter 'p'. The same thing happens when PeteMessageClass implements interface Message instead of TextMessage.

    3. When I use the Connector.open method to create an SMS connection and cast the result to MessageConnection as suggested, the instance is actually of type com.sun.cldc.io.j2me.sms.PrivateMessageConnection not MessageConnection

    I suggest that the SMS API is broken. For some reason, any attempt to instantiate an object implementing Message bombs out the application and displays the 'p'. Perhaps there is a firmware upgrade? Unfortunately, there's no way to upgrade the firmware on the 3410.... Maybe nokia should recall my phone? Could someone from Nokia explain or send me a binary that will send an SMS on my 3410?

    p

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    25

    RE: Is the 3410 SMS API broken?

    I've managed to send an SMS using the SMS API from a v04.09 phone. I was getting the same problem with the "p" displaying when running the same application on an earlier version, so it looks like it's been fixed now.

    You can get your phone upgraded. It's just a matter of plugging in a cable and loading new software onto it. Any Nokia service centre will be able to do this, possibly even for free (see thread above this one)

    S.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    46

    RE: Is the 3410 SMS API broken?

    Hi,

    There ware bugs in SMS API in Nokia 3410 version 3.09. Those are fix in newer releases and SMS API is working now. The following example code sends the simple SMS. It is tested in version 3.12 and 4.08 and it worked in both versions.


    //MIDlet class in SMS example

    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;


    public class SMSMIDlet extends MIDlet {

    private Display mDisplay;
    private TextBox mTextBox;
    private send_sms Send_sms;

    public SMSMIDlet() {

    }

    public void startApp() {

    mDisplay = Display.getDisplay(this);

    if (mTextBox == null)
    {
    mTextBox = new TextBox("Type SMS", "text", 160, TextField.ANY);
    mTextBox.addCommand(new Command( "Exit", Command.EXIT, 0));
    mTextBox.addCommand(new Command( "Send", Command.SCREEN, 0));
    Send_sms = new send_sms(this.mTextBox.getString());

    mTextBox.setCommandListener(new CommandListener() {

    public void commandAction(Command c, Displayable s) {
    if (c.getCommandType() == Command.EXIT) notifyDestroyed();
    else send();
    }
    });
    }

    mDisplay.setCurrent(mTextBox);

    this.mTextBox.getString();
    }



    private void send() {


    mDisplay.setCurrent(Send_sms);

    }

    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}

    public void setToScreen(Displayable d)
    {
    mDisplay.setCurrent(d);
    }
    }

    //Class for sending SMS

    import java.io.*;
    import java.lang.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    import com.nokia.mid.messaging.MessageConnection;
    import com.nokia.mid.messaging.TextMessage;
    import com.nokia.mid.messaging.MessageListener;

    public class send_sms extends Form implements CommandListener{

    private TextField PnumberBox;
    private Command cmd_OK;
    private String Message;

    private MessageConnection conn = null;

    public send_sms(String message) {
    super("title"

    Message = message;

    PnumberBox = new TextField("Type number", "", 160, TextField.NUMERIC);

    cmd_OK = new Command("OK", Command.OK,1);

    append(PnumberBox);
    addCommand(cmd_OK);

    setCommandListener(this);

    }

    public void send()
    {

    try {

    String addr = "com.nokia.sms://"+PnumberBox.getString();

    conn = (MessageConnection)Connector.open(addr);

    TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
    msg.setPayloadText(Message);
    conn.send(msg);
    }catch(Exception e)
    {
    System.out.println(e);
    }

    }
    public void commandAction(Command p0, Displayable p1) {

    if (p0==cmd_OK)
    {
    send();
    }
    }

    }

    I hope this helps

    Regards,
    Petri/Forum Nokia

Posting Permissions

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