×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    102

    Unhappy midlet not working on N95

    I have tried to install .jar files with the most simple codes from Sun java ME codes but the phone says application not compatible... The code is written below:



    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    // A first MIDlet with simple text and a few commands.
    public class FirstMIDlet extends MIDlet
    implements CommandListener {

    //The exit, info, and buy commands
    private Command exitCommand;
    private Command infoCommand;
    private Command buyCommand;

    //The display for this MIDlet
    private Display display;

    public FirstMIDlet() {
    display = Display.getDisplay(this);
    exitCommand = new Command("Exit", Command.SCREEN, 1);
    infoCommand = new Command("Info",Command.SCREEN, 2);
    buyCommand = new Command("Buy", Command.SCREEN, 2);
    }

    // Start the MIDlet by creating the TextBox and
    // associating the exit command and listener.
    public void startApp() {
    TextBox t = new TextBox("FirstMIDlet",
    "Welcome to MIDP Programming", 256, 0);
    t.addCommand(exitCommand);
    t.addCommand(infoCommand);
    t.addCommand(buyCommand);
    t.setCommandListener(this);
    display.setCurrent(t);
    }

    // Pause is a no-op because there are no background
    // activities or record stores to be closed.
    public void pauseApp() { }

    // Destroy must cleanup everything not handled
    // by the garbage collector.
    // In this case there is nothing to cleanup.
    public void destroyApp(boolean unconditional) { }

    // Respond to commands. Here we are only implementing
    // the exit command. In the exit command, cleanup and
    // notify that the MIDlet has been destroyed.
    public void commandAction(Command c, Displayable s) {
    if (c == exitCommand) {
    destroyApp(false);
    notifyDestroyed();
    }
    }
    }

  2. #2
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    174

    Re: midlet not working on N95

    Quote Originally Posted by ijazhasan View Post
    I have tried to install .jar files with the most simple codes from Sun java ME codes but the phone says application not compatible... The code is written below:



    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    // A first MIDlet with simple text and a few commands.
    public class FirstMIDlet extends MIDlet
    implements CommandListener {

    //The exit, info, and buy commands
    private Command exitCommand;
    private Command infoCommand;
    private Command buyCommand;

    //The display for this MIDlet
    private Display display;

    public FirstMIDlet() {
    display = Display.getDisplay(this);
    exitCommand = new Command("Exit", Command.SCREEN, 1);
    infoCommand = new Command("Info",Command.SCREEN, 2);
    buyCommand = new Command("Buy", Command.SCREEN, 2);
    }

    // Start the MIDlet by creating the TextBox and
    // associating the exit command and listener.
    public void startApp() {
    TextBox t = new TextBox("FirstMIDlet",
    "Welcome to MIDP Programming", 256, 0);
    t.addCommand(exitCommand);
    t.addCommand(infoCommand);
    t.addCommand(buyCommand);
    t.setCommandListener(this);
    display.setCurrent(t);
    }

    // Pause is a no-op because there are no background
    // activities or record stores to be closed.
    public void pauseApp() { }

    // Destroy must cleanup everything not handled
    // by the garbage collector.
    // In this case there is nothing to cleanup.
    public void destroyApp(boolean unconditional) { }

    // Respond to commands. Here we are only implementing
    // the exit command. In the exit command, cleanup and
    // notify that the MIDlet has been destroyed.
    public void commandAction(Command c, Displayable s) {
    if (c == exitCommand) {
    destroyApp(false);
    notifyDestroyed();
    }
    }
    }
    Have you checked midlet entries?
    Regards,
    Snehal

  3. #3
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    102

    Re: midlet not working on N95

    I changed the settings to MIDP 1.0 and it works now. N95 does not have MSA compatibility???

  4. #4
    Regular Contributor
    Join Date
    Mar 2006
    Location
    South Africa
    Posts
    178

    Re: midlet not working on N95

    Which SDK did you compile it with? N95 definitely supports MIDP 2.0.

  5. #5
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    102

    Re: midlet not working on N95

    @Larry: J2me wireless toolkit...
    @snehal: Sorry, I dont have an idea of midlet entries. I have just started with j2me and java recently.... Please guide

  6. #6
    Regular Contributor
    Join Date
    Mar 2006
    Location
    South Africa
    Posts
    178

    Re: midlet not working on N95

    If I was to guess, you probably just had an API included which the N95 doesn't support. N95 supports MIDP 2.0, but not all of the latest APIs (Mobile Sensor API, for example). If you use the SDK specifically for the N95 (S60 3rd edition, feature pack 1 SDK which you can download from forum nokia), then you shouldn't have that problem. The wireless toolkit is just the generic SDK, which leaves it up to you to make sure that all the APIs you include are actually supported by the device. If you use an IDE such as Netbeans, you can see under project properties which APIs you are including.

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: midlet not working on N95

    You can find API support (and other specs) for the N95 here. Remember that the N95 is a three year-old device. So far as I know, it's not certified as MSA compliant.

    In your case, I suspect your JAD/MANIFEST specified MIDP-2.1 as the required profile, while the N95 supports only MIDP-2.0. It will reject a MIDP-2.1 app as incompatible.

    Graham.

  8. #8
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    102

    Smile Re: midlet not working on N95

    I just checked the settings, I was selecting MSA which had MIDP 2.1, just checked with MIDP 2.0, thanx everybody for the help... Really obliged..
    Please help me with another thing... I was developing an application to send SMS, the WMA api gives a notification to the user before sending the message. Can I tweak with the API??? As in, is the source code available...?
    Thanks again Graham and Larry...

  9. #9
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: midlet not working on N95

    No, you can't modify the API on the device. MIDP applications run in a security "sandbox", which protects the user. Any time the application wants to access personal data (such as the file system or the address book), or do something that would spend the user's money (like connect to the network or send an SMS), the user sees a security prompt. This means that you can safely download a Java app, without worry that it might go through your contacts and send them all SMS at your expense.

    Depending on the device, these can sometimes be set (by the user, not by the application) to "ask first time" rather than "ask always". Then you only see the prompt the first time the app attempts to send (each session). There might also be an "always allow" option, which disables these prompts altogether. If it exists, it is only possible to select it if the application is considered "trusted". Trusted apps are signed with a digital certificate recognized by the device. Which certificates are "trusted" depends on the handset, but may include Thawte, Verisign and Java Verified. No, before you ask, you cannot install your own certificates. If you want to make your application trusted, it will cost you money. In general, you are better to live with the security prompts, as signing is a complicated area.

    Graham.

  10. #10
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    102

    Exclamation Re: midlet not working on N95

    Well that was such a comprehensive reply. Ummmm that would save me trouble working in java anymore. Which language can I target then to do it. can symbian C help me regarding this???
    Thanks a lot for your time. I feel a lot obliged.

    cheers,
    Hasan

  11. #11
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: midlet not working on N95

    I'm sure it can... ask about it over on the Symbian C++ discussion board.

    Graham.

Similar Threads

  1. Nokia N95 Midlet not displaying form element
    By vanpersie17 in forum Mobile Java General
    Replies: 18
    Last Post: 2009-02-26, 12:23
  2. Apps not working with FL3 on N95
    By korstiaan in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2008-04-11, 20:38
  3. help with n95 working with lifeblog on vista
    By miremare in forum PC Suite API and PC Connectivity SDK
    Replies: 2
    Last Post: 2007-08-08, 17:11
  4. 技术文档:MIDP 2.0安全机制 与 MIDlet 数字签名
    By wotrust in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 0
    Last Post: 2006-12-30, 07:42
  5. Exit not working in a midlet
    By ferozekadamapuzha in forum Mobile Java General
    Replies: 2
    Last Post: 2003-06-06, 05:55

Posting Permissions

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