English 中文(简体)
Reverse Geocoding Using J2ME
原标题:

My project runs on J2ME and requires me to get the user current street address. I am able to get the user coordinates using location based. But how do i go about getting the street address??

I know google map does the reverse geocoding. But how can i link that to my application?? And will there be any legal issues too??

Any guidance will be greatly appreciated. Thanks!!!

Kevin

最佳回答

There are legal issues with using Google Maps within J2ME apps. The Google Maps API can only be used from within a browser.

See 10.8 on this page: http://code.google.com/apis/maps/terms.html

Google Maps also has a limit on the number of unique maps you can download per ip address. Usually it would be good enough for any PC-based app. However, on mobile devices many devices will go via a proxy web service such that many devices have the same IP address. Because of that the limit is reached very quickly.

Yahoo Maps has no such restrictions in it s T&Cs and a much higher limit per ip address. They also flag certain ip address as proxy servers so they don t count towards the limits. We ve used this commercially.

As for reverse GeoCoding, there is the GeoNames webservice, though I ve not personally used it.

问题回答

Java ME does actually standardize native reverse geocoding as part of JSR 293 Location API 2.0: http://www.j2megame.org/j2meapi/JSR_293_Location_API_2_0/index.html?javax/microedition/location/services/GeocodingServiceProvider.html

Section "4.2.2. Geocoding" in the below paper describes reverse geoding using Location API 2.0 in Java ME: http://www.locationaware.usf.edu/wp-content/uploads/2011/09/Barbeau-Location-API-2.0-for-J2ME-COMCOM3573.pdf

However, currently JSR 293 is not widely implemented in commercially-available Java ME mobile phones, at least those available in the U.S. Instead, most phones still implement JSR179 Location API 1.0.

This is a late reply, but I was actually looking for the same thing and now I have finally done it.

What you need to do:

  • Send a request to the Google server by opening a HTTP connection on J2ME and then you will get response from Google either in XML or JSON based on the HTTP link you request.
  • Parse this response in order to retrieve the location from the XML or JSON document.
    • For XML, I would suggest using kXML 1.2 Parser
    • For JSON parsing using the json.org parser.

You can send me a mail if you are still stuck with it since I am through that phase already :). Mail me at prateek.football@gmail.com





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签