×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2011
    Location
    Coimbatore
    Posts
    6

    Question Help Please - Image with horizontal and vertical scroll

    Hi,

    I am doing my engineering.Now I am doing my mini project of third year. I want an image(i.e map) should open in my application with both horizontal and vertical scroll to view complete image. I was used "append" syntax,its just showing a part of image. Please help me.

    I don't know about "canvas",will it help me to do my project?

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

    Re: Help Please - Image with horizontal and vertical scroll

    Hi d2mathi and welcome to Nokia's Discussion Boards,

    It is possible to use an external library, such as the Nokia Maps API for Java ME, in order to display an interactive map screen with zoom in, zoom out, satellite/map view and scrolling capabilities.

    You can look at the example here:
    http://www.developer.nokia.com/Commu...ustom_Map_View

    Make sure that you download the external library from here:
    https://projects.developer.nokia.com/LBSPJME/wiki

    In case you need a start-up guide, and some help in setting up your development environment you can take a look at this link:
    http://library.developer.nokia.com/i...C2D2937BC.html

  3. #3
    Registered User
    Join Date
    Dec 2011
    Location
    Coimbatore
    Posts
    6

    Re: Help Please - Image with horizontal and vertical scroll

    Thank you skalogir...!

    I was using sun java wireless toolkit for my project, will it support the Nokia Maps API?

    And I just need a city map,so an Image is enough for me,so i need to know whether it can be append with both horizontal and vertical scroll bar?
    Last edited by d2mathi; 2011-12-22 at 16:33.

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

    Re: Help Please - Image with horizontal and vertical scroll

    Hi d2mathi,

    Yes the API works with the Wireless Toolkit.

    Is it just a still image that you need to load to the device, where the image's resolution is larger than the screen's resolution and you can use the navigation keys to focus on a different area of the image each time?

    Or is it that you need to scroll beyond the image's boundaries? If that's the case, I wouldn't suggest using still images and displaying them one after the other, when you reach the image's borders, as some low end devices have limitations on the size of the .jar file.

    You could use the Nokia Maps API in order to display a particular city by giving the city's coordinates as arguments to the appropriate functions and the zoom level you wish to have. The API uses tiles that are dynamically downloaded over the network, each time a new location is needed, thus you could run your code on a very large range of mobile devices that support MIDP2.0/CLDC1.1.

    I tested successfully this code that displays Rome on the toolkit's DefaultFxPhone1 emulator:
    Code:
    import com.nokia.maps.common.GeoCoordinate;
    import com.nokia.maps.map.MapCanvas;
    import com.nokia.maps.map.MapDisplay;
    
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.midlet.*;
     
    public class NokiaMap extends MIDlet
    {    
       Display display;    
       MapCanvas mapcanvas;    
       Form f;
       MapDisplay mapdisplay;
       GeoCoordinate geo;
       public void startApp()        
       {   
    	  f=new Form("");
    	  display=Display.getDisplay(this);
    	  try
    	  {
    		  mapcanvas = new MapCanvas(display);
    		  mapdisplay=mapcanvas.getMapDisplay();
    		  geo=new GeoCoordinate(41.90311, 12.49576, 0.0f);
    	      mapdisplay.setCenter(geo);
    	      mapdisplay.setZoomLevel(14,0,0);
    	      
    		  display.setCurrent(mapcanvas);
    	  }catch(RuntimeException e)
    	  {
    		  display.setCurrent(f);
    		  f.append(e.getMessage());
    	  }
       }
       public void pauseApp() {}
       public void destroyApp(boolean unconditional) {}     
    }
    though I would strongly recommend that you use the appropriate Nokia SDK if you plan to run the application on a Nokia Device.

    For Nokia Series 40 devices, you can use this SDK:
    http://www.developer.nokia.com/Devel..._SDK_for_Java/

    For Nokia Symbian/S60 devices you can select an SDK from the link below:
    http://www.developer.nokia.com/info/..._One_SDKs.html

  5. #5
    Registered User
    Join Date
    Dec 2011
    Location
    Coimbatore
    Posts
    6

    Re: Help Please - Image with horizontal and vertical scroll

    Thank you,

    In Wireless toolkit I am getting error("package com.nokia.maps.common does not exist").

    And it is just a still image that I need to load to the device, the image's resolution is larger than the screen's resolution and how can I use the navigation keys to focus on a different area of the image each time?

    Can You please give me a code for this?

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

    Re: Help Please - Image with horizontal and vertical scroll

    The reason for this error is because you have not included the external Nokia Maps API for Java ME library. I have already provided the link in one of my previous posts. You need to download the .jar file from this location:

    https://projects.developer.nokia.com/LBSPJME/wiki

    Then depending on which IDE you are using, you will have to import the library in your working project. In Netbeans for example, you can do this by right clicking on your project> properties > Libraries and Resources> add Jar/Zip> OK. Also from the Properties Platform Menu, make sure that you enable all Optional Packages.

    There is already an example for a scrollable image, that I have just updated a bit in order to support both Touch and Keyboard devices. You can find the article as well as its source and binary files here:
    http://www.developer.nokia.com/Commu...ing_in_Java_ME

Similar Threads

  1. change widget size when vertical/horizontal layout applied
    By skyjun in forum [Archived] Beginning Qt
    Replies: 2
    Last Post: 2011-05-03, 05:14
  2. How to Horizontal Scroll
    By somnathbanik in forum Symbian
    Replies: 2
    Last Post: 2009-08-24, 13:53
  3. ListBox with Horizontal & Vertical lines Suppressed
    By gowthamyemme in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-12-27, 19:10
  4. ListBox, vertical & horizontal separator
    By Jeepy in forum Symbian
    Replies: 2
    Last Post: 2005-06-24, 10:26
  5. Horizontal scroll ????
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-15, 03:05

Posting Permissions

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