Hi I'm working on Google Places API, with Google Places Photo request I can get different images of a specific place. But I don't know how to display this image in a android device.
This is the request URL that I'm using to retrieve the image
https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photoreference=CoQBegAAAFg5U0y-iQEtUVMfqw4KpXYe60QwJC-wl59NZlcaxSQZNgAhGrjmUKD2NkXatfQF1QRap-PQCx3kMfsKQCcxtkZqQ&sensor=true&key=AddYourOwnKeyHere
Need some help on this..
https://github.com/koush/UrlImageViewHelper
include the library in your project.
and use the following code
UrlImageViewHelper.setUrlDrawable(imageView, "YOUR URL HERE");
its very simple
Related
I'm developing an app and one of the components involves the user recording where they have gone for the day. I use some NLP to identify the location, however it would be awesome if I could also after obtaining the location or any other string for that matter get an image from an external API. I've seen people use image urls to get images for their android app but, how can I get an image without a URL, kind of of like a google images search? If this isn't possible is there a way to get an image url?
You can use Google Images Api:
https://serpapi.com/images-results
So I'm trying to obtain a direct display url to images in a drive, using their document id's, like the url's that end in ".jpeg" and such, that only display the image, then use this link within my code to download the image.
I found a url that was supposed to do that:
https://drive.google.com/thumbnail?id=[file_Id]
but once this url is typed in and enter is clicked, it changes to a long url beginning with lh6.googleusercontent.com, this url is what displays the image the way I want when typed into a browser.
The problem now is, in my code, when I try to use https://drive.google.com/thumbnail?id=[file_Id] it doesn't work but when I use the long code beginning with lh6.googleusercontent.com, it downloads perfectly, so I want to know how to generate this lh6.googleusercontent.com url from the doc id, within my code, so I can use that as the download link.
The app I'm trying to make is Android, and I'm making it using Corona with lua.
Thanks
Im currently using Google Drive REST API in order to create folder/files in my Drive.
However i would like to know how could i use the rest api to display an image from Drive in my app ? Is that even possible ?
iv = (ImageView) myFragmentView.findViewById(R.id.imageView1);
iv.setImageURI(Uri.parse("https://drive.google.com/uc?export=view&id={fileid}"));
This doesnt work i have nothing displayed on my screen.
I've not been able to figure out a way of doing this using the id or the URL...
However, if you are using the Google Script, you could try a solution similar to this:
var file = DriveApp.getFileById(fileId)
var base64CodedFile = Utilities.base64Encode(file.getBlob().getBytes());
and use that base64 variable to be sent to your app. With this format you will find a way of displaying your images (don't know Picasso, but Fresco library can do it easily...)
It is not an immediate solution, and requires to do somework in other platform that is not your Android app, but it works perfectly.
Hello i'm tring to get the url's from Bing images. i.e this link return cat images
how can i get only the .png url's?
If bing supplies an API, then you should use that.
If it does not, then you get the .html file and parse it. Last time I did something like this, I used JSoup library.
I'm currently working on a directory application on ANDROID.
it's my first time working on an mobile application.
While working for the app, I decided to add a map feature as well to locate buildings from the search result.
Instead of using google api, I'm trying to pinpoint the location on an image(map) I have.
since the image is really big as well. I want to zoom into the building when it's pinpointed.
Unfortunately, I don't know where to start.
The help will be really appreciated.
thank you.
Sincerely
Google offer the static map API for free.
You can download a dynamically configured bitmap from the web, store it on the filesystem or on memory, then get a drawable from it in order to set it to the ImageView.
You need to generate an url from your coordinates to load the data from the web using this url. Exemple for a 200x200 bitmap showing the eiffel Tower in Paris:
String latEiffelTower = "48.858235";
String lngEiffelTower = "2.294571";
String url = "http://maps.google.com/maps/api/staticmap?center=" + latEiffelTower + "," + lngEiffelTower + "&zoom=15&size=200x200&sensor=false"
StackOverflow already have some answer on how to download an image from the web in order to display it in an imageview: https://stackoverflow.com/search?q=imageview+url+%5Bandroid%5D
You can find here the documentation for the Google Static Maps API.