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

  • Home
  • SEARCH
  • 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 8167787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:18:39+00:00 2026-06-06T20:18:39+00:00

I want to know how to execute AT commands inside a J2ME application. The

  • 0

I want to know how to execute AT commands inside a J2ME application. The approach that I am taking in brief is as below:

First get all the ports that are present in the phone by

String ports = System.getProperty("microedition.commports");

Now just try to write “AT” and wait for the response from each port (YES I said EACH!!!)

try{
  commConnection = (CommConnection) Connector.open("comm:" + portsArr[i] + ";baudrate=19200");
} catch (IOException e) {
    print("IOException:Port:" + portsArr[i] + "~Mess: " + e.getMessage());
} 

Once I get an “OK” from some port I can execute my intended commands in the same way.

I am trying to execute this on two diffrent phones

Nokia SuperNova 7210

ports=USB1

When I try to write to the port nothing happens.

Nokia Xpress music

ports= USB2,COM1,IR1,USB1,BT1,BT2,BT3,BT4,BT5,BT6,BT7,BT8,BT9,BT10,BT11,BT12,BT13,BT14,BT15,BT16,BT17,BT18,BT19,BT20,BT21,BT22,BT23,BT24,BT25,BT26,BT27,BT28,BT29,BT30,BT31,BT32,BT33,BT34,BT35,BT36,BT37,BT38,BT39,BT40,BT41,BT42,BT43,BT44,BT45,BT46,BT47,BT48,BT49,BT50,BT51,BT52,BT53,BT54,BT55,BT56,BT57,BT58,BT59,BT60,BT61,BT62,BT63,BT64

When I try to write to USB2,COM1,BT1 port

IOException:Port:COM1~Mess: SymbianOS error = -1 : General:
System error
IOException:Port:USB1~Mess: SymbianOS error = -21 : General:
System error
IOException:Port:BT1~Mess: SymbianOS error = -44 : General:
System error

Is this a correct approach?

Smslib uses AT commands but I’m not understanding how do they execute AT commands or how they get the port on which to write the AT commands?

If not possible with J2ME I don’t mind not writing the execution of AT commands in some other language as long as both are able to communicate and the solution will support a most of the vendors.

Related – https://stackoverflow.com/questions/3803508/can-i-use-at-commands-insider-j2me-app

  • 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-06T20:18:42+00:00Added an answer on June 6, 2026 at 8:18 pm

    What you are trying to achieve is absolutely not possible.

    Your approach would only work if Java ME provided access to the GSM modem via COMM ports, which it does not!

    (I suppose there could possibly be a device somewhere which offers this, anything’s possible in Java ME land, but I have never seen or heard of this).

    The library you are referring to runs on a PC which has a device connected to it via the COMM port, it does not work in a Java ME context.

    I suspect that what you’re really trying to do is access the handset’s native SMS inbox via a MIDlet. I promise you, there is absolutely no way to do this!

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

Sidebar

Related Questions

I want to know how to programmatically execute commands (like dir C:\ or shutdown
What I want to know is, if I were to execute something like ping
i want know if is possible, to get a specific element value of a
I want to know how to configure your environment to execute some command with
I know how to execute commands on SQL server asynchronously using Begin/EndExecuteNonQuery, but is
I want to build a shell script to execute the following two commands, but
I want to be able to input java commands/code to execute during run-time (during
My problem is that I want to execute a python file with an argument
From inside a PHP program I want to know the location of the binary
I want to know how to execute more than one SQL command at once.

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.