0

I want to access the Google map API in series 40 mobiles. I tried with using http connection but the map displayed statically. I want to load the map and moving the location in the map so that I have to use the Google map dynamically.

Please give an idea to do this.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
seipl
  • 11
  • 3

1 Answers1

1

The Google Maps API site does not contain a specific SDK for JavaME (or Series 40). The static Maps API can be used, but only for static images (no dynamic panning or zooming).

A good alternative is to use Nokia's HERE Maps. Its API is designed to work with JavaME and it offers a dynamic experience in Series 40 devices. Code Examples are also available and seem to be quite comprehensive, including panning, zoom and different map types.

PS: I'm not affiliated with Nokia in any way. I do use Here Maps on my Nokia quite frequently and I find it a good mapping solution.

EDIT: I got the Nokia HERE Maps working on a Java SDK1.1 emulator doing the following:

  1. Download the Nokia Asha SDK 1.0. This (HUGE) download contains the most up to date libraries.
  2. Create a new JavaME project using the Java SDK 1.1.
  3. Sign in to HERE Maps and create an App Id and Token.
  4. Add the following code in your MIDlet.

    public class MapMIDlet extends MIDlet {
        protected void startApp() throws MIDletStateChangeException {
            ApplicationContext.getInstance().setAppID("API IP");
            ApplicationContext.getInstance().setToken("API TOKEN");
    
            Display display = Display.getDisplay(this);
            MapCanvas mapCanvas = new MapCanvas(display){
                public void onMapUpdateError(String description, 
                    Throwable detail, boolean critical) {
                    // Error handling goes here.
                }
                public void onMapContentComplete() {
                }
            };
    
            mapCanvas.getMapDisplay().setState(
                new MapDisplayState(new GeoCoordinate(52.51, 13.4, 0), 10));
            display.setCurrent(mapCanvas);
        } 
    }
    
  5. Reference the maps-core.jar located in "C:\Nokia\Devices\Nokia_Asha_SDK_1_0\plugins\maps api\lib".

  6. Clean the project and run. This should display a basic pannable and zoomable map.
igordsm
  • 464
  • 2
  • 8
  • Thank you for your response. I know the here maps API used for nokia series 40 devices. I am developing for nokia asha 300 and sdk is nokia sdk 1.0 for java(series 40 developer platform 1.0) . In this sdk map jars are not found. Nokia supports map API in series 40 developer platform 2.0. Is it right. Please help me . – seipl Jun 17 '13 at 04:21
  • [This document](http://www.developer.nokia.com/Resources/Library/HERE_Maps_Java_ME/#!index.html;#toc_Devicecompatibility) says that the only dependencies are CLDC1.1 and MIDP2.0, so it should work. I'll try to figure something out when I get home later. – igordsm Jun 17 '13 at 14:52
  • @seipl, I updated the answer with a solution. Does it work for you? – igordsm Jun 18 '13 at 01:43