×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    72

    Building Offline Map Application in Mobile phones

    hello,

    I need to develop an application where i need maps, this map server can be any server for example i have my own maps server where i have map data.

    Now the problem is I have to build application, in which user can request for maps of specified location, and must be able to save it in his mobile phones so that he don't have to read it again from internet, and he can use those maps where there is no internet.

    Can anyone suggest how this can be done using J2ME?

    Looking for reply.

    Thank You

  2. #2
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    89

    Re: Building Offline Map Application in Mobile phones

    Hi Amishra

    There is an example on Forum Nokia Wiki regarding use of Google Maps in your application.

    As for using your own map server what sort of map server you are using? if it is an OGC compliant map server then you can simply make a WMS request to the map server and then handle the returning tile(s) in your application. You will have to give bounding parameters as well when making the request to your map server and request PNG output form your map server. Please note that it will cost your users to query and receive this data on their phone.

    As for saving you will have to check first if data licence allows you to do so.

  3. #3
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    72

    Re: Building Offline Map Application in Mobile phones

    Thanks for the reply.

    yes my server supports the format that you have told. If is it so then can i use my own server instead of google??

    and if so then what are the steps that i have to follow please let me know, i don't know much about this.

    and I am building this application in J2ME, for nokia 6110 mobile set.

    waiting for your reply.

    Thanks

  4. #4
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    89

    Re: Building Offline Map Application in Mobile phones

    Hi

    what map server you are using?

    Keep in mind that map data is licenced and will cost you or your company to host it and making it available to public/customers.

    Just think about your options as to what you want to achieve with this application. what are the goals? It is very critical as it might turn out that it is easier and cheaper for you to use Google rather than being responsible for maintaining a production map server. if simple map viewing is required then Google will do the job and it will not cost you to buy map data in.

    As for config steps it will be difficult to tell without knowing the scope and servers involved.

  5. #5
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    72

    Re: Building Offline Map Application in Mobile phones

    thanks for the reply.


    If i want to use google map services then what are the steps that i have to do.

    there is API in wiki, but i didn't understood how to use that.

    can you tell me anything that i could consider while developing such applications, and what things i have to consider.

    Your little help will be a great thing to me. Looking for your reply.

    Thanks

  6. #6
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    89

    Re: Building Offline Map Application in Mobile phones

    Have a look at this example on Forum Nokia Wiki.
    http://wiki.forum.nokia.com/index.ph...oogle_Maps_API
    http://wiki.forum.nokia.com/index.ph...e_applications

    It has code that allows you to have a static map image and also provides functions to implement scroll support.

    An example midlet is also included to see it in action.

    As for saving for later viewing you will have to check if Google's Terms and Conditions of use allow you to do so. You will need to signup for a new GoogleMaps key for which you only need a valid Google account.

    Use of API is included at the end of the example. Add googlemaps class in the wiki example code to your source folder. Simply instantiate it and make necessary calls to retrieve the map.

    It is very clearly included at the end of this example.

    Have a play around with it and then if needed get back with specific questions and if you are able to make any improvements help the developer community by sharing your experience at Forum Nokia Wiki.

    Goodluck
    Last edited by morash; 2008-09-05 at 16:32. Reason: missing URL

  7. #7
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    72

    Re: Building Offline Map Application in Mobile phones

    Thanks,

    I am able to load the Image, but without scrolling facility and without zoom. Its a still image. If i need to implement those things then what are the things that i have to consider?

    I looked at API, but there is nothing about implementing zoom, it says something about scrolling, but i didn't understand. Can you make it clear to me?

    Looking for your reply.

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Building Offline Map Application in Mobile phones

    Hi amishra,

    if you look at Google Static Maps URL, you'll find a zoom parameter: you simply need to change it to adjust your zoom level.

    About scrolling, there's an 'adjust' method in Java ME API, that takes these parameters:
    * lat: current latitude
    * lng: current longitude
    * deltaX: the x pixels you want your map to scroll
    * deltaY: the y pixels you want your map to scroll
    * z: your map zoom level

    Hope it helps,
    Pit

  9. #9
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    72

    Re: Building Offline Map Application in Mobile phones

    yes i tried all those things that you said, but it didn't worked.

    The problem was what value should i give for deltaX and deltaY?


    and one more question:

    Image map = gMap.retrieveStaticImage(320, 240, 51.510605, -0.130728, 8, "png32");

    does the value of first 2 parameters affect while loading the image, because when i tried to increase the number the image didn't load.


    Thanks

  10. #10
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Building Offline Map Application in Mobile phones

    About scrolling:

    let's say you have a 320x240 map, and your user want to scroll RIGHT: to load the right-adiacent map tile, you should use a deltaX of 320 (or less, depending how much you want to scroll right) and a deltaY equal to zero.

    About the first 2 parameters in retrieveStaticImage method, they're the actual map size: so, you should modify them accordingly to the map image size you want to use in your application.

    Pit

  11. #11
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Pune
    Posts
    223

    Error while loading map image

    hi all,
    i am devloping an application to retrieve image using follwing sample codes......

    http://wiki.forum.nokia.com/index.ph...oogle_Maps_API
    http://wiki.forum.nokia.com/index.ph...e_applications

    but while loading image it throws illegal argument exception...

    java.lang.IllegalArgumentException:
    at javax.microedition.lcdui.ImmutableImage.<init>(Image.java:906)
    at javax.microedition.lcdui.Image.createImage(Image.java:367)
    at Map.GoogleMaps.retrieveStaticImage(GoogleMaps.java:38)
    at Map.MapMidlet.get_MapForm(MapMidlet.java:204)

    please suggest me solution to overcome such kind of errors....

  12. #12
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Error while loading map image

    Hi devdattac,

    which image format are you using, and on which device/emulator are you testing?

    Pit

  13. #13
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Pune
    Posts
    223

    Re: Building Offline Map Application in Mobile phones

    hi pit,
    i am doin this application in netbeans ide, I use png32 image format.

  14. #14
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Building Offline Map Application in Mobile phones

    If you're testing on Sun's WTK, then you should try using png8 format.

    Hope it helps,
    Pit

  15. #15
    Regular Contributor
    Join Date
    Aug 2008
    Location
    Pune
    Posts
    223

    errors in loading image

    hi pit,
    still there are errors --------

    Running with storage root temp.DefaultColorPhone1221130532296
    Msg: OK
    Code: 200
    java.lang.IllegalArgumentException:
    at javax.microedition.lcdui.ImmutableImage.<init>(Image.java:906)
    at javax.microedition.lcdui.Image.createImage(Image.java:367)
    at Map.GoogleMaps.retrieveStaticImage(GoogleMaps.java:39)
    at Map.MapMidlet.get_MapForm(MapMidlet.java:204)
    at Map.MapMidlet.commandAction(MapMidlet.java:91)
    at org.netbeans.microedition.lcdui.SplashScreen.doDismiss(SplashScreen.java:160)
    at org.netbeans.microedition.lcdui.SplashScreen.access$200(SplashScreen.java:37)
    at org.netbeans.microedition.lcdui.SplashScreen$Watchdog.run(SplashScreen.java:184)


    i am not using sun's wtk instead i am using netbeans mobility .

Similar Threads

  1. The very first Augmented Reality application on mobile phones!
    By Tukora in forum News and Announcements
    Replies: 4
    Last Post: 2010-01-22, 15:31
  2. How to get Cell ID for S60 2nd ed. FP2 mobile phones?
    By SanjayKhuntia in forum Symbian
    Replies: 29
    Last Post: 2009-08-27, 20:31
  3. channel for going to market
    By matrix241 in forum News and Announcements
    Replies: 12
    Last Post: 2008-04-05, 17:42
  4. Replies: 0
    Last Post: 2007-06-22, 08:22
  5. Mobile application security and IMEI
    By abhijitbhosale in forum Mobile Java General
    Replies: 0
    Last Post: 2007-05-04, 09:40

Posting Permissions

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