×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    18

    Question Problems with SMS sending and receiving on J2ME S60 devices

    Hallo,

    I´m working on a multiplatform (Sony Ericsson, Nokia etc.) project right now and I face serious problems when it comes to the Nokia cellphones. I can´t really understand why these simpel things don´t work on them.

    Alright. The program I´m developing on should be able to send SMS and receive SMS. My functions worked fine on Sony Ericsson phones. I was able to send and receive (-> I mean: A listener on the port waits for an SMS) with no serious problems.

    My Nokia phones just seam to have a problems with generating the sms listening and sending object. Have a look at my simpel code:

    Code:
    try
            {
                if (Port > 0)
                    smsConn = (MessageConnection)Connector.open("sms://" + Number + ":" + Port);
                else
                    smsConn = (MessageConnection)Connector.open("sms://" + Number);            
                
                TextMessage txt = (TextMessage)smsConn.newMessage(MessageConnection.TEXT_MESSAGE);
                
                txt.setPayloadText(Message);
                smsConn.send(txt);
                smsConn.close();
                return 1;
            }
            catch (Exception ex)
            {
                ex.printStackTrace();
                return 0;
            }
    Personaly I think that the problem lies in the smsConn = (MessageConnection)Connector.open(...) statement, but all examples I find about sending sms show me very similar examples and well it works fine on my SE phones =/
    I use the port 16001, but I already tried it with other/no ports.

    Nex: My port listener

    Code:
    smsConn = (MessageConnection)Connector.open("sms://:" + String.valueOf(smsPort));
    Well same problems here.


    I do have/use a certifacte for my program.

    Somebody told me that I need the Wireless Messaging API on my phones for using this function. Alright. How do I find out if my phone has this API? A search through the documentation brought me no step forward. Is the WMA already standard? So I don´t have to look for my S60 phones?

    btw.: Could you tell me a good debuging method for Nokia phones? The ones that I use don´t really work on Nokia systems -.-'

    Help is REALLY welcomed because sending SMS is a core task of our program. Receiving incoming sms with a port isn´t that important though.

  2. #2
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Problems with SMS sending and receiving on J2ME S60 devices

    Somebody told me that I need the Wireless Messaging API on my phones for using this function. Alright. How do I find out if my phone has this API? A search through the documentation brought me no step forward. Is the WMA already standard? So I don´t have to look for my S60 phones?

    Depend on symbian platform of your phone, it could support WMA 1.0 or WMA 2.0. You can find out from http://www.forum.nokia.com/devices/matrix_all_1.html for Nokia Phone.

    The WMA is already standard. Check JSR website for more information.
    ---Knowledge sharing is power---

    Hans

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    18

    Re: Problems with SMS sending and receiving on J2ME S60 devices

    Thank you for your answer at least I know now that the problem doesn´t seam to lie in the WMA.

    Alright I tried a bunch of things today and I´m sure now that the code can´t execute this statement:

    Code:
    if (Port > 0)
                    smsConn = (MessageConnection)Connector.open("sms://" + Number + ":" + Port);
                else
                    smsConn = (MessageConnection)Connector.open("sms://" + Number);
    The exceptions tells me:
    java.lang.SecurityException: Permission = javax.microedtion.io.Connector.sms


    Any ideas? Could there be something wrong with my certifacte?
    I made sure that the messaging permission are on "Ask Always" for this MIDlet.

  4. #4
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Problems with SMS sending and receiving on J2ME S60 devices

    Hi,

    Did you declare the API permission in jad file. Smt like this:

    MIDlet-Permissions: javax.microedition.io.Connector.sms, javax.wireless.messaging.sms.receive, javax.wireless.messaging.sms.send,
    ---Knowledge sharing is power---

    Hans

  5. #5
    Registered User
    Join Date
    Aug 2008
    Posts
    18

    Re: Problems with SMS sending and receiving on J2ME S60 devices

    Yeah 5 minutes after my post I remebered such permissions in the project properities. After enabling Connector.sms I got one step forward.

    Good now I made some tests and sending and receiving sms just works fine now. The only thing that was missing was this singel permission. It was really confusing to see the things working on the Sony Ericsson devices.

    However:
    For anybody who has problems of the same kind, even with enabling the permission, there can come up really silly error messages when something isn´t right with the sim card.

Similar Threads

  1. S60 - Service crashes while sending SMS and receiving SMS or call simultaneously.
    By SwordAngel in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2008-04-18, 08:52
  2. Sending and Receiving SMS in J2ME
    By mengpek84 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-04-11, 13:22
  3. Problems Sending and Receiving SMS Messages from the Emulator
    By appdeveloper in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2006-11-27, 05:15
  4. Error sending SMS
    By jorge_c in forum Multimodecards
    Replies: 0
    Last Post: 2003-10-07, 11:53
  5. 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
  •