Question

I was hoping that you could offer me some advice/guidelines for implementing my first app for handhelds.

I want to track movement, store it in a database and then allow users to see the track in Google Maps.

Since the app is for both Android and Ios I thought that I would make it browser-based.

Since it displays a (constantly growing) track, it requires a polyline on the Google map and may a few annotations.

My question is where to generate the Google Map. Since i have the data on my server, I can either send all points of the polyline back to the handheld and have it generate the Google Map. Or, I could generate the Google Map on the server, which has much more processing power, and send that back to the handheld.

Do you have any advice?

I notice that there is a Gogole Maps API for android, which implies that I would different code for the Ios version(?).

Was it helpful?

Solution 2

IMHO you should go Native, then:

Use Google Maps SDK for Android version 2 (https://developers.google.com/maps/documentation/android/) and its iOS analog (https://developers.google.com/maps/documentation/ios/), that way you will have the same Maps with the same objects and a similar if not equal API (same properties, methods, etc.).

As an example, note the BIG similarities in the Polyline object:

Android: https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polyline

iOS: https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_polyline

Pick a way to persist the geo data on the device (JSON strings, NSArray and NSDictionary types can be stored in Files with writeToFile or CoreData on iOS or in Files or SQLite on Android. You can even persist serialized Objects and/or collections of Objects.

To persist the App data on the Server, you can use Google DataStore and Maps Engine (http://www.google.com/enterprise/mapsearth/products/mapsengine.html) or Kii Cloud (http://www.kii.com/en/technology/kiicloud/data).

I'm building a travel app and I will use this lineup of SDKs and Services along with other Google Cloud Platform products.

Good luck!

OTHER TIPS

There are a few options here... basically you mentioned both.

1.) Render the google map and then use javascript or the google web api to draw a polyline on it. That seems like what you want to do, but I've never done that before. To render the google map look up the api on google.com -- If I remember correctly its just some params you pass in the url to google maps. You can choose from one of two ways to embed.

2.) Use the maps SDK on the device, have the page query the polyline and draw it. I have done this before and it will likely look nicer than a web page, but you'd have to have independent implementations for each of Android and iOS.

Out of the two, option 2 will look nicer since it will be rendered native, but it will require more work. In the first case, the server actually does not have to render the google maps, google will do that for you, but it will be difficult to get annotations and the polyline drawn nicely since your ability to draw on that map would likely have to go through some google api. If it were me, I'd go with option 2, it will look better in the end and you'll have more control over the UI.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top