×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    31

    Angry Problem running s40 application with WTK emulator

    I'm trying to use the "FullCanvas" class in an application but if I use the "Sun Java(TM) Wireless Toolkit 2.5.2_01 for CLDC" SDK with a custom designed emulator that replicates my phone's exact resolution it can't find the class because it doesn't have the "nokiaapi" included. If I manually import it, it compiles, but then the emulator closes and it gives me this error: "java.lang.NoClassDefFoundError: com/iulianonofrei/canvas/MinesweeperCanvas: com/nokia/mid/ui/FullCanvas". It's so frustrating not being able to test my app, and the new Nokia Asha SDK emulates the 502 with touchscreen and I have the 302 with qwerty and another resolution so it doesn't help.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Problem running s40 application with WTK emulator

    Code:
    Canvas.setFullScreenMode(true); // requires MIDP 2
    Did that help?
    Last edited by traud; 2013-05-27 at 10:37.

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: Problem running s40 application with WTK emulator

    Your problem is that your using the Nokia UI api which is specific to Nokia and is not part of the general MIDP/CLDC jars so when your testing it on WTK it wont have that jar and that specific class.
    You have 2 options import the entire Nokia UI jar to your project and compile with it and then test with WTK (not recommended to the starter/novice)
    Test your app with a Nokia SDK that fits your device screen resolution (which is the reason your trying to test with WTK from what you said).
    look at https://www.developer.nokia.com/info...form_SDKs.html
    on the right side at "Download version for" you have alot of s40 versions sdk i'm sure one of them have a device with 320x240.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by Revolter View Post
    I have the 302 with qwerty and another resolution so it doesn't help.
    Now I got it: Yes, none of the emulators are landscape. You can test your MIDlet with the SDK 1.1 which is a Nokia 303. It does have a QWERTY keyboard for input. Furthermore, if you want to test your Canvas in landscape, change the Nokia 501 emulator to landscape (from the menu) and implement the Nokia Orientation API. Alternatively, for testing, you can rotate your Canvas and use it with the Nokia 303 emulator.

  5. #5
    Registered User
    Join Date
    Feb 2013
    Posts
    31

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by shai.i View Post
    Your problem is that your using the Nokia UI api which is specific to Nokia and is not part of the general MIDP/CLDC jars so when your testing it on WTK it wont have that jar and that specific class.
    You have 2 options import the entire Nokia UI jar to your project and compile with it and then test with WTK (not recommended to the starter/novice)
    Why is it not recommended for novice? I did it but it gives me that error, and I can't understand why, if it clearly is there and it compiles. I would prefer to use the wtk emulator, I find it more clear and straight to point and also emulates best my real phone so, I only need a one time solution for it to work and then I'll continue with it as it is. So, shortly, I would like to use the Nokia UI api with WTK emulator, can you help me in this direction, please?

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Problem running s40 application with WTK emulator

    What you did was successful compiling. The runtime environment (WTK) does not have that class (and you cannot add this one). Furthermore, it is a very bad idea to use (and test) only one emulator because there are big differences between the emulators and their behaviour. Sometimes things work with WTK which are not covered by the specification and therefore do not work in Nokia.

  7. #7
    Registered User
    Join Date
    Feb 2013
    Posts
    31

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by traud View Post
    What you did was successful compiling. The runtime environment (WTK) does not have that class (and you cannot add this one). Furthermore, it is a very bad idea to use (and test) only one emulator because there are big differences between the emulators and their behaviour. Sometimes things work with WTK which are not covered by the specification and therefore do not work in Nokia.
    Soooo, I can't use nokia api with the wtk, right? that sucks so very very much

  8. #8
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: Problem running s40 application with WTK emulator

    Revolter its not recommended because as you can see you tried and failed.
    i'll try and explain to you how to try and achieve this (this will not always work, it depands on your app code as well)
    I'm assuming your using eclipse
    step #1 find the path location where you installed Nokia sdk2.0 on your pc
    #2 go to libs folder in that path and copy frameanimator.jar, gesture.jar, inapp.jar, nokiaui.jar jars
    #3 create a libs folder in your j2me eclipse project and copy the jars to it
    #4 go to the project properties and then "Java build path" go to the Libraries tab and add the 4 jars you copied to the libs folder
    #5 go to Order and Export tab and mark all 4 jars and click ok
    #6 clean and rebuild the project, hopefully you wont have errors and try and run the project with the WTK emulator of your choice or build the project (create jar & jad) and run those outside of eclipse with the wtk emulator.

    On a different issue in order to fully try to help you, why are you using FullCanvas? and not simply GameCanvas with full screen set as true?
    GameCanvas is part of the midp2 specs and would work for you on all j2me supported phones.

  9. #9
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by Revolter View Post
    I can't use nokia api with the wtk, right?
    Well, it is not there.
    Quote Originally Posted by Revolter View Post
    that sucks so very very much
    No. There is not a single use-case. Therefore there must be another understanding problem.

  10. #10
    Registered User
    Join Date
    Feb 2013
    Posts
    31

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by traud View Post
    Well, it is not there.No. There is not a single use-case. Therefore there must be another understanding problem.
    I am the use-case! I said that I want that, simply as that, even if I may be the single one needing it.

  11. #11
    Registered User
    Join Date
    Feb 2013
    Posts
    31

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by shai.i View Post
    On a different issue in order to fully try to help you, why are you using FullCanvas? and not simply GameCanvas with full screen set as true?
    GameCanvas is part of the midp2 specs and would work for you on all j2me supported phones.
    I am trying to make an application exclusively for my Nokia Asha 302 and I understood that FullCanvas is specialy designed for nokia phones and I thought it is more powerfull having a nokia mobile phone. After second though, what is your opinion? Is there any thing I can do with nokiaapi and not being able without it?

  12. #12
    Registered User
    Join Date
    Feb 2005
    Location
    Campina Grande/PB - Brazil
    Posts
    138

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by Revolter View Post
    I am trying to make an application exclusively for my Nokia Asha 302 and I understood that FullCanvas is specialy designed for nokia phones and I thought it is more powerfull having a nokia mobile phone. After second though, what is your opinion? Is there any thing I can do with nokiaapi and not being able without it?
    The Nokia UI API was designed to add some extra supports, like the fullCanvas, on devices with MIDP 1.0.

    The FullCanvas is equal to Canvas/GameCanvas + setFullScreenMode(true).

    This method was mantained just for backwards compatibility.

  13. #13
    Registered User
    Join Date
    Feb 2013
    Posts
    31

    Re: Problem running s40 application with WTK emulator

    Quote Originally Posted by TK2000 View Post
    The Nokia UI API was designed to add some extra supports, like the fullCanvas, on devices with MIDP 1.0.

    The FullCanvas is equal to Canvas/GameCanvas + setFullScreenMode(true).

    This method was mantained just for backwards compatibility.
    Aha, so I went full retard trying something useless, thank you for the help, I reverted to GameCanvas and everything works well

Similar Threads

  1. Application running on emulator but not running on Device
    By syedshakeel2004 in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 3
    Last Post: 2010-09-28, 13:55
  2. Replies: 1
    Last Post: 2008-01-03, 12:41
  3. Problem in running application in S60 emulator
    By abhisarswami in forum Mobile Java General
    Replies: 0
    Last Post: 2006-10-26, 07:46
  4. problem running j2me application on Nokia Emulator 60 series
    By chancp in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2002-07-03, 02:59
  5. problem running j2me application on Nokia Emulator 60 series
    By chancp in forum Mobile Java General
    Replies: 0
    Last Post: 2002-07-03, 02: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
  •  
×