×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    21

    SMS receiving problem

    In the code below when a sms arrived the String variable alfa change its value, then with a command menu it's possible to view the value of alfa. At startUp alfa is equal to "Nothing"..
    The problem is: in my 6600 this midlet doesn't receive nothing...the notifyIncomingMessage method is not called bu platform...why?

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


    public class Spy extends MIDlet implements CommandListener, MessageListener
    {
    MessageConnection messconn;
    String alfa;
    boolean done;
    Reader reader;
    private Display display;
    private Command cmExit;
    private Command cmHelp;
    private Form fmMain;
    private TextBox Hello;
    public Spy()
    {
    display = Display.getDisplay(this);
    cmExit = new Command("Exit",Command.EXIT,1);
    cmHelp = new Command("View Alfa",Command.HELP,1);
    fmMain = new Form("SpyGame");
    fmMain.addCommand(cmHelp);
    fmMain.append("Hello\n");
    fmMain.setCommandListener(this);
    }
    protected void startApp( ) throws MIDletStateChangeException
    {
    display.setCurrent(fmMain);
    alfa = "Nothing";
    try
    {
    messconn = (MessageConnection) Connector.open("sms://:3381");
    messconn.setMessageListener(this);
    done = false;

    }
    catch(IOException e)
    {
    alfa = "StartApp";
    }



    }

    protected void pauseApp( )
    {
    done = true;
    try
    {
    messconn.close();
    }
    catch(IOException e)
    {
    }
    }

    protected void destroyApp( boolean p1 ) throws MIDletStateChangeException
    {
    done = true;
    try
    {
    messconn.setMessageListener(null);
    messconn.close();
    }
    catch(IOException e)
    {
    }
    }
    public void notifyIncomingMessage(MessageConnection conn)
    {
    alfa = "Arrived Outside";
    if (conn == messconn)
    {
    alfa = "Arrived";

    }
    }
    public void commandAction(Command c, Displayable s)
    {
    try

    {
    if (c == cmExit)
    {
    destroyApp(true);
    notifyDestroyed();
    }
    else if (c == cmHelp)
    {
    fmMain.append(alfa);

    }

    }
    catch (MIDletStateChangeException e)
    {
    }

    }

  2. #2
    Regular Contributor
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    235

    Re: SMS receiving problem

    http://discussion.forum.nokia.com/fo...ad.php?t=69436

    Read throught that post, if you're still having trouble post back.

    Viru Doshi
    ~ No Style Without Substance ~

Similar Threads

  1. SMS sending and receiving problem
    By soujirou in forum Symbian Networking & Messaging (Closed)
    Replies: 12
    Last Post: 2008-08-18, 13:34
  2. problem in reading sms index
    By hosam2010 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2005-06-12, 17:39
  3. Help! Unicode SMS Problem
    By kuaichuan in forum Multimodecards
    Replies: 1
    Last Post: 2003-10-22, 11:38
  4. Problem sending SMS using Nokia 6210 and SDK 2.1
    By standi in forum PC Suite API and PC Connectivity SDK
    Replies: 2
    Last Post: 2002-07-25, 03:14
  5. problem with event on receiving SMS
    By Nokia_Archived in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-05-27, 14:52

Posting Permissions

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