Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Talk:Advanced Routing with Java ME

From Wiki
Jump to: navigation, search


Kingassassin - error occur while extending this code in RoutingDemo code

final static Command BACK = new Command("Ok", Command.BACK, 1);

  final static Command PREVIOUS = new Command("Previous", Command.SCREEN, 1);
  final static Command NEXT = new Command("Next", Command.SCREEN, 1);

  • Shows illegal static declaration in inner class ! plzz help

    kingassassin 06:20, 23 February 2012 (EET)

Jasfox -

An inner class is a class which is not defined in its own file. You will get the inner class error you describe if you paste the Code Snippet above directly into the class. It needs to be in a separate class called As your compiler has noticed, inner classes aren't allowed static Command buttons in them.

jasfox 09:47, 24 February 2012 (EET)

Kingassassin -

Thank U so much !! :)

kingassassin 20:34, 25 February 2012 (EET)

Kingassassin -

sir, i m not able to understand where to put " commandAction(final Command c, Displayable d) " method.i m also not able to implement this method ! plzz help me !

kingassassin 19:45, 27 February 2012 (EET)

Jasfox -

In order to interact with Command buttons you need to implement a CommandListener This is the standard MIDP User Interface, an example of which you can see here: MIDP's User Interface Hierarchy: Event Handling - this defines "commandAction(final Command c, Displayable d)"

Set your Form to implement CommandListener and add the code to handle button presses there. In the Examples shipped with the Maps API for Java ME, the CommandListener can be found in the Base class. In the associated routing example the extension to this is called commandRun and is found in the RoutingDemo class.

There are probably other Command Buttons already in your code. Look for something like:

private final Command FOO = new Command ("Bar", Command.OK, 1);

and then search through the code to find where FOO is handled.

jasfox 16:38, 28 February 2012 (EET)

Arif Mubashir -

I have question about downloading Image Map, sir How to set the zoom level Image Map view ? I want to set the Image Map.

Thank you sir

Arif_Mubashir 09:47, 7 June 2012 (EEST)


Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.