Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8482721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:53:31+00:00 2026-06-10T19:53:31+00:00

I am developing an Application in j2me that works with Wireless Messaging API (WMA).

  • 0

I am developing an Application in j2me that works with Wireless Messaging API (WMA). The application mission is sending and receiving SMS between 2 mobile phone.When i run the app in NetBeans emulator it works fine but when i run it on Nokia 5200 phone i give this exception on mobile phone :

Security java/lang/SecurituException Not allowed to open connection

The JAD file of my app is :

MIDlet-1: Midlet, , hello.Midlet
MIDlet-Jar-Size: 36375
MIDlet-Jar-URL: SinaNetwork.jar
MIDlet-Name: SinaNetwork
MIDlet-Permissions: javax.microedition.io.Connector.sms, javax.wireless.messaging.sms.receive, javax.wireless.messaging.sms.send
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0

The Application code is also :

Thread receive=new Thread(new Runnable() {
               MessageConnection ms;
            public void run() {
         //       System.out.print("*****************SALAM*******");

                    try {

                        ms= (MessageConnection) Connector.open("sms://:"+7000);
          //              System.out.println("Zoor mizanam Receive konam");
                        Date zaman=new Date();
                        long zamanTemp=zaman.getTime();

                        TextMessage tempmes=(TextMessage) ms.receive();
               //         System.out.print("SMS receive: "+tempmes.getPayloadText());
                        Midlet.messageReceived=true;
                        Midlet.ReceivedThatWeDontKnowIsRandom=tempmes.getPayloadText();
                    }
                    catch(SecurityException eds)
                    {
                        eds.printStackTrace();
                     //   System.out.print("");
                    }
                    catch (IOException ex) {
                        ex.printStackTrace();
                    }




            }
        });
         receive.start();

        Thread sendmesThread=new Thread(new Runnable() {

            public void run() {
                 try {

            MessageConnection mc=(MessageConnection) Connector.open("sms://"+Midlet.smsPhoneNumber+":"+5000); 

            TextMessage tm=(TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE);

      //      System.out.print("PNF : "+phoneNumberField.getString());
            tm.setPayloadText(rd+"-"+phoneNumberField.getString());
            mc.send(tm);
         //   System.out.print("message sent from client on port 5000");
            mc.close();

        } 

            catch (IOException ex) {

            ex.printStackTrace();
        }

            }
        });

        sendmesThread.start();

I think that the problem is that the application can’t open the connection for sending or receiving SMS but I don’t know why because I have no problem in emulator.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:53:33+00:00Added an answer on June 10, 2026 at 7:53 pm

    Your problem might reside on the ports you are trying to use: 7000 and 5000. I believe you want the SMS to skip the users inbox and be treated only by the application, right?

    Before doing it, please, make sure your app can send a simple SMS with below code from http://www.developer.nokia.com/Community/Wiki/How_to_send_text_SMS_in_Java_ME

    public boolean sendSms(String number, String message){
      boolean result = true;
      try {
        //sets address to send message
        String addr = "sms://"+number;
        // opens connection
        MessageConnection conn = (MessageConnection) Connector.open(addr);
        // prepares text message
        TextMessage msg =
        (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
        //set text
        msg.setPayloadText(message);
        // send message
        conn.send(msg);
        conn.close();
      } catch (SecurityException se) {
        // probably the user has not allowed to send sms
        // you may want to handle this differently
      result = false;
      } catch (Exception e) {
        result = false;
      }
      return result;
    }
    

    Update after comments

    About the Security Exception: maybe the phone only accepts signatures from the manufacturer and/or telecom operator/carrier. Try this signed version on different phones.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a mobile application in j2me. In that application I use 6
I am developing an application that works extremely with user mobile phone book in
I am developing an mobile application using j2me.In that i am using kxml parser.In
I'm developing a mobile application with j2me. The configuration is CLDC 1.1 & MIDP
I am developing a blackberry application using j2me and LWUIT (blackberry port). Everything works
Now, we plan for developing a mobile application using j2me. For UI, we go
I am using Netbeans IDE (J2ME) for developing a mobile application, a dictionary which
I'm developing a mobile application using J2me for a configuration CLDC-MIDP2.0. In my mobile
I'm developing a mobile application using J2ME for a configuration CLDC-MIDP2.0 . In my
We developing j2me application for low end mobile devices (like Nokia s40 mobiles) which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.