Android: Open default google map application and get the pinned location back - android

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

Related

Getting the name of a location from google maps

I am a dummy in android app development. I have developed an app that when a button is clicked, the google maps application opens. I want to get the name of the location that has been selected in the google maps application and use it in my own application. Is it possible to do so? Plus, can it be done without integrating google maps or google places API in the application?
You want to use the "Start activity for result" construct. With that, and some data in an intent, you can request a location like that from Google Maps.
I would also recommend allowing a person to share a location from Maps to your app. Depending on what your app would be doing with the data.
You can get location name from the point you clicked on a map.
You can do it using the device to query into the Google Map Api or you can write a rest service where you pass in your location and the service hand you back the location name.

Shared Google Map Between All Users on Mobile

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

is getting mapview working without api key possible on Android?

I am creating app to only show information about me, I wanna show the location on the map, then user can go from the mapview to the google maps to navigate if he wanted.
So, I dont wanna navigate, i dont wanna use maps api, i dont wanna use api key.
I just want to show a mapview then user can switch from the mapview to google maps.
is that possible ?
API_KEY is the way of Google to track number of Users using Map API and also promote new features and updates. I don't find any reason why you don't want to use API_KEY.
Follow this tutorial which has Graphic content to use API_KEY to generate Maps.
I wanna show the location on the map
To do this, you need to interact with the map.
To be able to interact with the map you need an API key.
So no, that's not possible.

Google Map needs an API or not?

If I need to lead someone to an address, I'll lead him through Google Maps .. so I code on applications some button link, when I click/thumb it, it will go to "Google map" to a coordinate 29.897717,31.203264 which aim at that place only, the question is, do I need an API for it?
No you don't need an api to navigate users. You simply start an intent.
Android Navigation intent

How to set a callback from googlemaps to my native android app?

In my android app, I plan to let the user pick a location and compute the distance from his current location. So to pick this location, I wanted to give a similar interface like the google maps website, where he searches for an approximate location and then picks the exact location from the map.
Ideally, I would like to launch the google maps application, let the user pick the location and obtain the geo-coordinates back in my app. Is there any way to do this?
If not, Could I achieve this by launching a webview? Is there a way to communicate the location picked from within the webview back to my launch Activity?
The class Geocoder has a method getFromLocationName which gives some results, but they are not as good as the google maps suggestions. So trying to build an equivalent interface as the google maps application does not seem possible.
Thank you for your time.
Ideally, I would like to launch the google maps application, let the user pick the location and obtain the geo-coordinates back in my app. Is there any way to do this?
No, sorry.
If not, Could I achieve this by launching a webview? Is there a way to communicate the location picked from within the webview back to my launch Activity?
You can inject your own Java objects into the WebView using addJavascriptInterface(). If you can arrange to get control in JavaScript when the user taps on a point, your JavaScript can invoke that Java object.

Categories

Resources