×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    3

    Red face Java problem with Symbian Belle SDK v1.0_3

    (I hope I am not offending anyone with a question about Java here. I did not find a discussion dealing with Symbian and Java.)

    I am trying to create my first MIDlet by doing exactly what

    http://www.developer.nokia.com/Resou...-netbeans.html

    says. However, this fails with lots of error messages, the first being
    error: package javax.microedition does not exist

    Can anyone help?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Java problem with Symbian Belle SDK v1.0_3

    How does this relate to Symbian Belle ? (just asking before I move this to Java section, since I can not see the relation to Symbian at all in here)

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: Java problem with Symbian Belle SDK v1.0_3

    First guess: he is using the Belle SDK. Still, this question may have a better place in "Mobile Java Tools & SDKs", even if that board resides under "Series 40 / Asha" (which is a bit misleading, I agree).

    For the question: did you configure the SDK in Netbeans? The Getting started guide which you are referring to starts with a chapter "Setting up the development environment". Also, the very last link on that page says "Configuring NetBeans", which also shows an important step.

  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    3

    Re: Java problem with Symbian Belle SDK v1.0_3

    Quote Originally Posted by symbianyucca View Post
    How does this relate to Symbian Belle ? (just asking before I move this to Java section, since I can not see the relation to Symbian at all in here)
    I submit that my question relates to Symbian Belle as I am using the Symbian Belle SDK. As far as I understand, that SDK is different from that/those for Series 40/Asha. So, if I post my question in the Series 40/Asha forum, I presume people will ask "How does this relate to Series 40/Asha?"

  5. #5
    Registered User
    Join Date
    Apr 2013
    Posts
    3

    Re: Java problem with Symbian Belle SDK v1.0_3 [SOLVED]

    Quote Originally Posted by wizard_hu_ View Post
    For the question: did you configure the SDK in Netbeans? The Getting started guide which you are referring to starts with a chapter "Setting up the development environment". Also, the very last link on that page says "Configuring NetBeans", which also shows an important step.
    Yes, I did configure the SDK in NetBeans - that is what the Nokia Symbian SDK tutorial says one should do.

    Building the HelloWorld project in NetBeans (version 7.1), everything happens just like the tutorial says. Until the "Deploy" step.



    EDIT:
    The error turns out to be in Nokia's source code, that is, in lines like
    import javax.microedition.lcdui.Display;

    The correct form seems to be
    import javax.microedition.lcdui.*;

    This made the project build and even run on the emulator.
    Last edited by toseokwan; 2013-05-07 at 19:10.

  6. #6
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Java problem with Symbian Belle SDK v1.0_3 [SOLVED]

    EDIT:
    The error turns out to be in Nokia's source code, that is, in lines like
    import javax.microedition.lcdui.Display;

    The correct form seems to be
    import javax.microedition.lcdui.*;

    This made the project build and even run on the emulator.
    Just a short input on this issue. The Java Developer's Library for Symbian is now available in offline format from here:

    http://www.developer.nokia.com/Resources/Library/

    Java Developer's Library for Symbian (Eclipse plug-in)

    I did some testing with NetBeans 7.1.2 and Symbian Belle SDK 1.0 with the following code copied pasted from the offline library:

    Code:
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.midlet.MIDlet;
    
    public class HelloWorldMIDlet
            extends MIDlet {
    
        public HelloWorldMIDlet() {
        }
    
        // Sets the MIDlet's current Display to a HelloScreen object.
        public void startApp() {
            Displayable current = Display.getDisplay(this).getCurrent();
            if (current == null) {
                HelloScreen helloScreen = new HelloScreen(this, "Hello, world!");
                Display.getDisplay(this).setCurrent(helloScreen);
            }
        }
    
        public void pauseApp() {
        }
    
        public void destroyApp(boolean unconditional) {
        }
    }
    Code:
    import javax.microedition.lcdui.*;
    
    class HelloScreen
            extends Form
            implements CommandListener {
    
        private final HelloWorldMIDlet midlet;
        private final Command exitCommand; // Exit command for closing the MIDlet in the device UI.
    
        public HelloScreen(HelloWorldMIDlet midlet, String string) {
            super("");
            StringItem helloText = new StringItem("", string);
            super.append(helloText);
            this.midlet = midlet;
            exitCommand = new Command("Exit", Command.EXIT, 1);
            addCommand(exitCommand);
            setCommandListener(this);
        }
    
        public void commandAction(Command command, Displayable displayable) {
            if (command == exitCommand) {
                midlet.notifyDestroyed();
            }
        }
    }
    I do not see why import javax.microedition.lcdui.*; would fix the issue, as long as the Displayable class is also imported. I managed to successfully run the code as written in the library without any modifications.
    As a reference, my JDK version is 1.7.0_11-b21. Also you mention Symbian Belle SDK v1.0.3. The one currently available from here:
    http://www.developer.nokia.com/info/..._One_SDKs.html
    is Symbian Belle SDK 1.0.
    Last edited by skalogir; 2013-05-17 at 09:59.

Similar Threads

  1. Lost phone connectivity after webservice call (java) on nokia 701 symbian belle
    By Olsi in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2013-02-10, 15:16
  2. n8 (symbian belle) python problem
    By justhani07 in forum Symbian
    Replies: 4
    Last Post: 2012-09-24, 02:27
  3. Can we Stream you tube videos (Mp4) on Nokia Symbian Belle SDK v 1.0 J2me(java)
    By pavanragi in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2012-07-31, 19:15
  4. problem with nokia 701 symbian belle ...
    By super_rider in forum General Development Questions
    Replies: 1
    Last Post: 2011-11-04, 17:45

Posting Permissions

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