Android has with version (4+ ?) introduced offline maps where I can on the handset select an area to cache and then Google Maps downloads that map data on the handset.
As I got a comment: I want to use the data, that is already on my device (if the user has done the downloading for offline maps use before). And not open a new data connection to Google's servers (e.g. because data charges would apply).
Can I use that map data from within my app - e.g. by sending the maps app an intent do show an area (perhaps with overlays)?
Or use even the map widget inside my app?
I am not talking about downloading some tiles from the Google servers into my app
Can I use that map data from within my app - e.g. by sending the maps app an intent do show an area (perhaps with overlays)?
Well, you can invoke a map application using ACTION_VIEW and a geo: Intent. Whether that will view some cached area depends on what map app the user uses and whether or not the user cached the area around your specified latitude and longitude.
Or use even the map widget inside my app?
While you can integrate a MapView in your app, it will not use this cached data. Partially, that is because the MapView code predates any of this caching stuff. Partially, that is because the cached data is owned by another process (the Maps app) and therefore is inaccessible to you.
Related
I want to open the default google maps application from my application, let the user pin a location, and get the pinned location details back to my application.
somekind of startActivityForResult(), where the result data would be a latitude,longitude or anything like that.
is there a way to do this? is it possible?
PS: I already know/worked with the maps sdk, but in this application this is the only use case with maps, that's why i can't afford using the sdk.
No, you can't do that with the Google Maps app. Here's a PlacePicker library that accomplishes this task though:
https://github.com/suchoX/PlacePicker
how to parse and store distance and time to reach in SQlite Database in Android when open Google Map from using intent showing route and distance Automatically by navigating between two points?.
I don't think you can parse data directly from the Google Maps app. There are a couple of ways to go about this though. I would look at implementing some of the Google Maps API in your app to run before starting the intent. Or setup navigation in your app between the two points directly.
If you only want distances and travel times, then I would look at the Distance Matrix API. If you want inbuilt directions have a look at the other maps API like the full Android Maps API.
I was trying to work on creating a shared map for all users by using the Google Maps API. I would like User A to be able to see User B on the map, assuming User B is sharing his location. How can this be accomplished using Google Maps API on Android or iOS? This would basically resemble the Uber application where the costumers can see the drivers on the map.
As far as I know this functionality isn't really available through the API. What you could do is check if the user's location is available for sharing. Then using your own backend, most likely a MBaaS, share the location data with people they allowed access to their location. Then you could just draw a marker on the map representing the user
I am developing an Android app that show the user's location in Google Maps API 2. Now I want it so that the user can download a custom area or custom city map for offline use of the map. How can I implement this? I also use OSMDroid, but it is not loading the map, even online.
Read the terms of use:
(b) No Pre-Fetching, Caching, or Storage of Content. You must not
pre-fetch, cache, or store any Content, except that you may store: (i)
limited amounts of Content for the purpose of improving the
performance of your Maps API Implementation if you do so temporarily
(and in no event for more than 30 calendar days), securely, and in a
manner that does not permit use of the Content outside of the Service;
and (ii) any content identifier or key that the Maps APIs
Documentation specifically permits you to store. For example, you must
not use the Content to create an independent database of "places" or
other local listings information.
I need to do map pre-cache of any zone previously chosen in my app. Is it possible to do this with google map android API v2? How?
Thanks.
What I've found is the google map seems to be cached automatically on android. Have you even tried to see what the response time is on a zone that was previously visited in your application?
Anywho,
It's against the terms of service to cache the google map for most situations. It's against the terms of service of course to reverse-engineer. You have to call the service via the api so I don't see how you can pre-cache the "MAP" legally.
See section 10.1.3 subsection (b) https://developers.google.com/maps/terms
10.1.3 Restrictions against Data Export or Copying.
...
(b) No Pre-Fetching, Caching, or Storage of Content. You must not pre-fetch, cache, or store any Content, except that you may store: (i) limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily (and in no event for more than 30 calendar days), securely, and in a manner that does not permit use of the Content outside of the Service; and (ii) any content identifier or key that the Maps APIs Documentation specifically permits you to store. For example, you must not use the Content to create an independent database of "places" or other local listings information.