Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Developing J2ME apps?

  • 02-07-2009 4:54pm
    #1
    Registered Users, Registered Users 2 Posts: 721 ✭✭✭


    Hi, I've been into programming for quite a while, but nothing more than Visual Basic, HTML and a little bit of css.
    I'd be very interested in learning how I could make J2ME apps. If there's anyone here who's into that, is there anything I could read or look into that would help me learn?
    Thanks!


Comments

  • Registered Users, Registered Users 2 Posts: 21,611 ✭✭✭✭Sam Vimes


    Here are instructions for how to set yourself up to start programming J2ME in the java eclipse development environment (it assumes you have eclipse installed because I wrote it for someone else):
    1. Get eclipseME:
    http://eclipseme.org/

    Then in eclipse, click help->software updates->find and install->search for new feature to install->new archived site

    Select the eclipseME zip file and click finish.

    A new menu will pop up. Tick eclipseME, the follow the prompts



    2. Get the Sony Ericsson SDK: (there's a nokia sdk too. You have to sign up to a free account to download it)
    http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp


    When it's installed, on eclipse click file->new->other->j2me midlet suite. Make up a project name and click next.

    Then it'll ask you what device you want to use. Click manage devices->import->browse

    and select c:\sonyericsson

    click refresh and a load of phones will appear. Leave them all ticked and click ok.

    The device I use usually is:
    SonyEricsson_China_JP8_240x320_Emu so tick that and click ok.

    You might have to cancel out at this point and go back into creating the project before the new device will appear. Once you get to that screen again, click finish. Ignore the next button.

    Then right click on the project, click new->other->j2me midlet. Call it something and click finish.

    And that's it. You're ready to start programming J2ME :)
    I have a book (pdf format) called Sams J2ME application development too if you want a copy. No I didn't write it :D


  • Registered Users, Registered Users 2 Posts: 721 ✭✭✭mk6705


    Thanks Sam, that was very helpful...
    I have a little problem though, when I try to make a new J2ME midlet suite, I get a few errors, summarized in this picture below:

    attachment.php?attachmentid=84265&stc=1&d=1246724275

    Any idea what I'm doing wrong? Would love to find my feet with this at least! :)


  • Registered Users, Registered Users 2 Posts: 21,611 ✭✭✭✭Sam Vimes


    When the app is created it's supposed to generate the src folder where your code goes and the res folder where resources like images go

    It looks like it hasn't imported the J2ME libraries at all. Right click on the project and click properties then click on J2ME.

    It should list a device group and name. If it doesn't, click manage devices->import->browse->select c:\sony ericsson->click refresh

    then select the Sony ericsson emulator and click finish->ok->Pick a device group and name->finish

    You might have to delete that project and create a new one with the library referenced properly to get it to make the src and res folders

    If there's already a device group and name there post back telling me what they say and I'll see what else can be done. Most likely a complete new install would be necessary. I've just gone through the whole process myself and got it to work but I realised the guide I gave you is out of date so you might have missed a step or two. I'll do up a new one in that if this doesn't work


  • Registered Users, Registered Users 2 Posts: 721 ✭✭✭mk6705


    Hi sam, I've overcome all those issues and built a small application that displays an alert when it starts on the emulator. How do I deploy it?


  • Registered Users, Registered Users 2 Posts: 21,611 ✭✭✭✭Sam Vimes


    Adro947 wrote: »
    Hi sam, I've overcome all those issues and built a small application that displays an alert when it starts on the emulator. How do I deploy it?

    Right click on the project and click J2ME->create package

    and then the jar and the jad will be in the project directory in the 'deployed' directory

    You won't be used to a jad file. It contains meta data like the midlet name, the vendor, the version etc and if you want to have a variable that can be changed without recompiling the jar you put it in there and read it using the getAppProperty("") method.


  • Advertisement
Advertisement