need change Google Maps example - java

I found an example that suits me, but I can not understand how to change the search. There is a "spinner", it spelled out "types" of google maps dev, and the search goes only on them (that is, atm, bank, etc.), and I need to make so that the search was for "keywords" or "name". here is the link http://wptrafficanalyzer.in/blog/showing-nearby-places-and-place-details-using-google-places-api-and-google-maps-android-api-v2/ , please help. it is very necessary to solve the problem, I will be very grateful.

Your question is not very clear but I think you want to find out where to change the request for the Google API. So that's at this line:
StringBuilder sb = new StringBuilder("https://maps.googleapis.com/maps/api/place/details/json?");
sb.append("reference="+reference);
sb.append("&sensor=true");
sb.append("&key=YOUR_BROWSER_API_KEY_FOR_PLACES");
That's where he builds the URL for the request. Then have a look at the API Docs and you'll be able to find what you want

Related

Foursquare Venue API returning empty venue list

I am working on the FourSquare venue API.
The following API link was giving results until this morning at 3 AM:
https://api.foursquare.com/v2/venues/search?ll=-6.21944223,106.80315059&intent=browse&radius=30&client_id=XXXX&client_secret=XXXX&v=20180512&m=foursquare
but now there is an empty venue array with status code 200. There is no update on the developer website.
Please help me understand why this is happening. Thanks in advance.
I had a similar problem with my app. Up until a couple of weeks ago we were able to make requests to the Foursquare api without specifying category ids. By doing this all place categories were considered. But now if you ommit categoryId no place is returned at all. I don't know if this is a bug on the Foursquare api or just a feature change (a VERY BREAKING change).
While we don't know the real answer, try adding a "categoryId" to your request, such as:
https://api.foursquare.com/v2/venues/search?
client_id={YOUR_CLIENT_ID}
&client_secret={YOUR_CLIENT_SECRET}
&v=20130815&ll={LATITUDE},{LONGITUDE}
&limit=50
&intent=browse
&radius=50
&categoryId=4d4b7104d754a06370d81259,4d4b7105d754a06372d81259
(the indentation on the URL above is just for legibility, you should pass this URL as a single line when doing your request)
As #FelipeFerri suggested, I have added following parameter in API and it start giving the result.
https://api.foursquare.com/v2/venues/search?ll=-6.21944223,106.80315059&intent=browse&radius=30&client_id=XXXX&client_secret=XXXX&v=20180512&m=foursquare&&categoryId=4d4b7104d754a06370d81259,4d4b7105d754a06372d81259,4d4b7105d754a06373d81259,4d4b7105d754a06374d81259,4d4b7105d754a06376d81259,4d4b7105d754a06377d81259,4d4b7105d754a06375d81259,4e67e38e036454776db1fb3a,4d4b7105d754a06378d81259,4d4b7105d754a06379d81259
Thanks
Same thing happens to me. I've changed the API version (v) also without any

Extract email id from place details that have website

How can i extract email id based on the website that i have got from Place Details using Google maps API.
I want to extract the generic email id from these place details or the website. I have attached a screen shot to show what i have. I am using open Refine.I am able to parse the phone number but can't parse email id's as its not present in these place details but i can see it on the website.
Thank you in advance.
This is the code i am using -
"https://maps.googleapis.com/maps/api/place/details/json?placeid=" + cells['PlaceID'].value + "&key=AIzaSyCSp-f-_FWHw8jfNFF9yd7mgUxaX-DZo8g"
According to the google maps places API this is not something that can be returned from the API. I believe that Google does not want its API to be used as a source for spamming companies. Based on that, I can't think of any legal option that would give you this email.
The only solution that I can think of would be to get the URL attribute from google maps API result and from then scrape the page and hope that there is a way to find the email address in the HTML code, but :
I don't think that google would present it in a easily scrappable way;
I believe it would go against terms of use of Google.
So to summarize I don't think there is an easy and legal solution to your question.

Get display name of document Author with Google Docs API?

I have to use Google Documents List API for an Android app until I have time to migrate to Drive API.
I want to get the First and Last name of the Author of a Document that is shared with me.
Currently I'm only able to get the username of the Author using the method below.
// entry is a DocumentListEntry
String aName = entry.getAuthors().get(0).getName();
Is there a property or method I'm missing? The documentation for the Java Docs API is sparse.
Nope. the docs here don't provide a lot of leeway on this. You might be able to try and tokenize the name, but there's no inherent guarantee a given name has to be made up of >1 part, and I wouldn't recommend that course of action.

Update a Raw Contact

I'm trying to update a contact using the 'new' api. i've got the raw contact ID of the contact and the contact is linked to an account, but i cant find anywhere some sample code or working code that i can study and adapt.
Dunno wherever i have to 'query' the contact first for any info? And is the raw contact ID enough to 'update' a Contact?
At the moment I'm using the ContentProviderOperation.newUpdate(Data.CONTENT_URI) Is this the best way? and if so what else do i need to add to add details to the contact?
Also i have read somewhere that you have to use something along the lines of .withSelection(Data.CONTACT_ID = 123... etc but I'm not too sure..
Any help would be brilliant and Thanks in advance!
Take a look at this SO question. It shows how to update the work number using the new API. Sems to do what you want.
How to update contact number using Android

Searching google images from java code

I am writing a java code.
I want to search a string on google and google images using my java code.
Previously i wasnt even able to search text and then i had to register with google and then i could do it.
Now i want to search a string against googleimages
How can i do it?
Regards
Manjot
It's pretty similar to text search, you just need to specify the URL as
http://ajax.googleapis.com/ajax/services/search/images
Standard arguments are described here, image -specific ones are here.
I agree with ChssPly76, but you have to include version number in URL as following
http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=
put q= watever you want to search for.
I hope it will help you.
Cheers.

Categories