File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Help on developing Google Maps application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Help on developing Google Maps application" Watch "Help on developing Google Maps application" New topic
Author

Help on developing Google Maps application

VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hi fellow ranchers,

I am trying to develop a Google maps application for the Android platform. I have so far managed to implement basic geocoding, overlaying and simple map controls. Now I am stuck over implementing, 'plotting of points of interest 'on a map. All the examples I have seen over the internet, explain this in the terms of Google maps web service. I need to develop it on the Android platform. Also I came across a pdf , which states that it is not possible without 'hacking' in Gmaps(refer:link).

I also tried to get help from the Google API reference, provided with the sdk.

Can anyone guide me in the right direction(references, links etc.) to implent this?


Thanks in advance


Copy Paste is a design error!!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

The Google Maps API is JavaScript that allows you to take a Google Maps webpage and overlay stuff on it. That's in contrast to the Yahoo maps API, which redraws the whole image on their own servers and sends it out.

Well, Google Maps API does more than that, but that's one of its most popular features. So the easiest way would be to embed a webpage window to Google in you application and use the Javascript API (assuming that your target device can handle it).

Alternatively, you could fetch the Google images and overlay your own local API on a canvas, allowing for any legal constraints. That would require a bit more programming on you part, however.


Customer surveys are for companies who didn't pay proper attention to begin with.
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hi Tim,

Thanks for the reply. I too think the method suggested by you (through overlays) is the only solution at sight. But if I intend to have many points of interests(POI) in my application, the amount of data I need to store on the device(latitude, longitude, address, etc. of the POIs) would be very high.

I was wondering if there was a way to dynamically get this data from the Google maps service itself, instead of providing it in my application(like it is done as simple search of a location on Google maps).

Hope you get my problem.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

I'm not really certain what you're looking for, but if you've got a large and changeable collection of POI's, I'd definitely recommend keeping them somewhere besides the device, as long as the device can connect to whatever server you're getting them from in a reasonably timely manner. From the way you're talking, it sounds like you're looking for points that Google themselves considers "interesting", which means that you should be able to use AJAX or HTTP tunnelling to get the data you need. If you have your own collection, you can set up a server of your own along with a suitable web service API to deliver the data to you mobile app.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

Tim Holloway wrote:I'm not really certain what you're looking for, but if you've got a large and changeable collection of POI's, I'd definitely recommend keeping them somewhere besides the device, as long as the device can connect to whatever server you're getting them from in a reasonably timely manner. From the way you're talking, it sounds like you're looking for points that Google themselves considers "interesting", which means that you should be able to use AJAX or HTTP tunnelling to get the data you need. If you have your own collection, you can set up a server of your own along with a suitable web service API to deliver the data to you mobile app.


Since, you have mentioned this allow me to add that this is already being used in Augmented Reality applications such as Wikitude and Layar; they use XML to represent and store data about POIs. They are also trying to standardize the format. Read about it here


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

I've done KML. It's a good thing to pair with REST services.
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
I was planning for a thick client application, but by your responses, it seems I would have to create a web service, to support this application.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

Well, as it happens, I was looking at the Android Widget gallery last night and as of Android 1.5, there's a Google Maps widget. Have you seen it?

Google maps itself is a "web service" in the sense that the image data comes from their servers. But if you mean for the Points of Interest, that's basically a matter of how much data you want to dump into the client device and how much trouble it would be to keep devices full of up-to-date data.
VineetK Singh
Ranch Hand

Joined: Jun 02, 2009
Posts: 47
Hi Tim,

I am basically trying to develop an application, which marks essential services(eg hospitals,schools etc.) within certain range of the device. For this I would have to keep detailed information of every place on the map(like latitude, longitude, info etc.), that is to be marked on the map.

Now if I have to prepare this application for a city, taking into account atleast 10 services, the amount of data that needs to be ready for use, is certainly not feasible to put on the device. Therefore I was thinking of developing a web service, just to serve information about the points of interset to the client application, on the device. The map part would still be retreived from the Gooogle maps web service, but the information about the POIs would be retreived from the web service.

Does this sound logical, or can there be a more efficient way to acheive this?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16058
    
  21

VineetK Singh wrote:Hi Tim,

Does this sound logical, or can there be a more efficient way to acheive this?


Sounds like what I'd do. I have a Bus Route system that operates like that. Gets the list of stops from the web server and uses Google Maps client-side javascript to flag the bus stops on the map and draw the route that connects them. That part of the app is presently desktop-based, but should be workable on an Android device.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help on developing Google Maps application