time between two places using public transport - android

Is there some Google Maps API for Android that could return time between two places using public transport (and walking)? Something like Google Maps does when selecting public transit, but I'm interested only in times.
Also, is there way on Android to get list of nearest transit stops (from given location, not necessary phone)?

you can refer google direction API .it provide all types of details. it gives a response based on JSON or xml. if you refer json then pass in url json.
used retrofit for getting direction API response and bind getting data according to google map.
below url is give all data..
https://maps.googleapis.com/maps/api/directions/json?origin=ahmedabad&destination=faizbad&mode=transit&language=gu&key=AIzaSyCMNK9WsbC2vgvMB_trDOjTs2QUvOd7ECw
more information u can refer below link
https://developers.google.com/maps/documentation/directions/intro#TravelModes

Hi below is the link which helps you for which you want
https://developers.google.com/maps/documentation/distance-matrix/intro
Where you find request URL throw which you can find distance or time duration between tow place using different-different parameter
Below is the sample URL for use
https://maps.googleapis.com/maps/api/distancematrix/outputFormat?parameters
You need to pass your API key in parameter compulsory.

Related

Google Place Details android

I am working with Google Places API.
My task is to type some name, example Amazon and it should return me the type of this place as Shop.
In short if I pass place name to some web service it should return me the type of that place.
I tried two solutions
1)Place Autocomplete
I don't want to use this, because It returns so many results
2)Google Place Details API
Here I need to pass place ID instead of place name.
So any one knows, How can I get Place details by passing it name to some web service.
Thank you
You have to use the combination of Google Places API and Places Autocomplete API.
Places Autocomplete API will provide AutocompletePrediction from there you can pick up the placeId that you will use with Google Places API to get the details of that place.
I know you said you don't want to use Google Autocomplete API but it can be configured to return a max number of results (default is 10 I think) and can be also configured to return certain types of places by adding AutocompleteFilter. This will limit the results and it will also return useful results for your case.

Create Here API Android Request Id?

I'm using the Here API for Android and I'm trying to calculate multiple routes.
I'm using RouteManager's calculateRoute method in order to do this.
The problem is that when using this method for multiple route calculations, the response is async and I want to be able to identify which response is for which request.
I found that for the REST API it's possible to do this by passing RequestId:
"Clients may pass in an arbitrary string to trace request processing through the system. The RequestId is mirrored in the MetaInfo element of the response structure."
Is there something similar for the Android SDK or do I have to compare GeoCoordinates or other route specific data?
The HERE Maps for Android API does not provide this functionality directly but you can write some code on top of the APIs to accomplish this.
As an idea you could implement a class which extends the RouteManager#Listener interface and assign an ID to that class. Then you can use a unique Listener for every request with a different ID value.

Getting all pins of a specific user Pinterest

Hey i'm trying to get all pins for a specific user from pinterest API in android app
but as i see for now there is no public Api after searching i found this Post which contain an end point for fetching all pins of specific user http://widgets.pinterest.com/v3/pidgets/users/eecolor/pins/
and this works perfectly but it doesn't contain the pin creating date.
Also i have checked the official website which contain a sample response for pins list and the data contain creation date
so how i can do this,is there any extra field should i added to the previous endpoint
Thanks
You can obtain scraping from here:
https://www.pinterest.com/pin/[put-pin-id-here]/
Ex. https://www.pinterest.com/pin/1234565787899/
See the page code:
meta itemprop="datePublished" content="2015-05-19T10:31:33"/
I found that there is no way to get pinterest pins from specific page unless you are the the admin of the page, but in this case you can use this url for using rest Api
"https://api.pinterest.com/v1/me/pins/?access_token=token&fields=id%2Curl%2Cnote%2Ccreated_at%2Cimage&limit=10
and the access token could be generated from here
https://developers.pinterest.com/tools/access_token
Regards

I want to get weather update in android

What i have: currently my app is telling me my current location (coordinates + name).
What i want: To get the weather update of my current location. and i want to update whenever my location is changed.
i have tried a tutorial but that was too much complex for me.
To my knowledge you need a server support for the same.
I saw the tutorial, which parses the HTML page in "Beginning Android".
If you want that to be in specified format, then you need server support. Try searching for free server providers.
Use google weather API, you will get a XML response
Replace the city-name placeholder with the city detected
http://www.google.co.uk/ig/api?weather=
I have created a sample project with my own Yahoo weather api wrapper.
You can find it here.
https://github.com/zh-wang/YWeatherGetter4a
Try Metwit weather API.
It's simply to use, what do you need is only a lat, lng and a GET request.
If you can implement them client-side: 200 request/day (ip based throttling) no authentication required. Worldwide coverage, JSON and REST compliant.
Here the documentation of the weather resource.
Disclamer: I own this API.

How to get Lat & Long Value for an address input in android?

I have gone through many post but did not got any clear answer. I want to get address input from user and want to get lat long value corresponding to that address.
Assuming you have access to the internet, you can use Google's geocoding api.
It'll give you a normal request that will return Json or XML containing everything you'd want about the address.
HLMGTFY: What you're trying to do is called Geocoding, and here are the API notes from Android on it: http://developer.android.com/reference/android/location/Geocoder.html. Note that you will need to have a valid Google Maps API key first.

Categories

Resources