HI, i have written a j2me application using netbeans..can anybody tl me how to install this application to mobile?????????????

Dani AI

Generated

Extra notes for (building on 's comment about threading): when a MIDlet works in the NetBeans emulator but fails to reach a server from a Sony Ericsson, the difference is usually environmental rather than a bug in the MIDlet. Four areas to check: (1) whether the phone can actually reach the server address used by the MIDlet; (2) carrier/APN or proxy behavior; (3) the phone's application security policy (permissions/signing); and (4) how the MIDlet handles slow mobile links (threads, retries, resource cleanup).

Practical checklist (in roughly the order to try): verify reachability from the phone browser using the exact URL the MIDlet uses — if the server is on a development PC, use the PC's LAN IP (not localhost) and open the firewall or use port forwarding/tunneling; try the phone on the same Wi‑Fi network to rule out carrier proxies; check the installed-app permission settings for network access (many handsets block network APIs for unsigned apps or prompt repeatedly); perform network I/O off the UI thread and capture the HTTP response code and any IOException so the root cause is visible (permission denied, DNS, HTTP 4xx/5xx, socket timeout, etc.).

A minimal pattern to run a GET on a background thread and safely close resources:

new Thread(new Runnable() {
  public void run() {
    javax.microedition.io.HttpConnection conn = null;
    java.io.InputStream is = null;
    try {
      conn = (javax.microedition.io.HttpConnection)javax.microedition.io.Connector.open("http://192.168.1.100:8080/path");
      conn.setRequestMethod("GET");
      int rc = conn.getResponseCode(); // numeric HTTP code
      if (rc == 200) { is = conn.openInputStream(); /* read */ }
    } catch (java.io.IOException e) {
      // record exception text for debugging
    } finally {
      try { if (is != null) is.close(); } catch (Exception ignored) {}
      try { if (conn != null) conn.close(); } catch (Exception ignored) {}
    }
  }
}).start();

Capturing the exact exception message and HTTP response code usually identifies whether the failure is reachability, carrier/proxy rewriting, or a permissions/signing issue.

Recommended Answers

All 8 Replies

Upload your midlet (JAR file of it) on mobile phone either memory card or device memory trough USB cable or bluetooth, from mobile phone browse and search for the file (most of the phones have menu option like "Files", "Media"). Once you find it click install it, simple like that...

but it is sayin as unsupported format???...only jar file is enough r do we need jad file also??

JAD is not need it, it is usually used when mobile device accessing web for download and you need fast way to determinate if your device will be capable to run midlet associated with that JAD.
I wonder why it is giving you unsupported format??? What device you using?
Do you want to upload midlet or perhaps whole NetBeans project so others can see and try?

i m usin sony ericson for installation....whole project is executing in perfect manner on simulator provided by netbeans... so u insist us to just install the jar file of dat midlet to ma mobile is it??

Thankx it s working great!!.. n actually in our project we r able to send some information to system where server has been installed n i ve written an http connection code for midlet which has been installed just now...but onw through mobile i cant able to achieve that connection so can you tl me how to achieve this ???

I guess you did not use Thread in your connection and because it is mobile device reply will slower then to emulator, therefore connection will time-out. Have look here how to do it with thread

ya i will go through dat... n in ma application i need to send some information to server n must validate that information so can u tell me the way to achieve this

As you are working on mobile application, validation should be done before you attempt to connect with server.
All you need to do is just create a method that will return boolean type (true/false) and inside that method verify that text filed wasn't left empty if must be filled, that length of string is as expected (for example no less then 6 characters and no more then 18) etc. JME, makes checks much simpler since you can declare field to accept only numeric, phone type or email values with little hassle.
This is how simple it gets...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.