Fetch Image without URL in Android - android

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

Related

Are we allowed to make our own image uploaded in different website in our app for download?

We have our own Artwork and photography images uploaded in different websites like Tumblr,500px,Deviantart,Flickr etc.So for every image there will be already some URL which is publicly available for everybody to view or download.
Example of such a URL is : http://40.media.tumblr.com/b12772f7533b6283ca008ba8d7ec2192/tumblr_nsezua4hur1r4xqayo1_500.jpg
Like there will be a lot of URL, and we are able to show this in our app and app let user to download this URL. Since the server is not our own, But the images are our own, are we allowed to use these urls in our app to show as a gallery app and let the user download it to their own.
Is it allowed? This is related to programming, because we have seen same websites providing their own APIs to fetch data. But we dont want too many details, Our requirement is simple, So we are trying to keep it simple and economical.
You should be fine, but check that the URLs don't change, or you'll be left with a lovely little error.

Display image with Chromecast

I'm developing a gallery app and I want it to be compatible with the Chromecast.
I searched and tried for days but I can't get it to work. I learned that I need to create a webserver (NanoHTTPD) and send the url of the image. Can someone show me a simple tutorial?
If I have the path of the image, how can I display it in the simplest way possible?
Thank you!
There is plenty of examples and resources that show you how to cast a video, so familiarize yourself with that. Then, for sending an image, you need to follow the same steps but your MediaInfo object that represents your item (image in this case) needs to have its URL set to the url of the image, served by your embedded server (for example, if you put that url in your web browser on your laptop on the same network, you should be able to see the image). Then load that media item the same way you would load a video. For the simplest solution, you can use the default receiver; it supports images.

Display Google Places photos in android device

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

Images, Caching and Sprites in Android

I've got a really simple (so far) Android app, which basically shows your friends on a Google Map. Think Latitude.
The friends are represented as avatar pins, the images of which are downloaded from the internet.
When a "friend" is added, i fetch the avatar in a background thread. I then don't need to download the avatar again (i'll probably check for updates during app start, but not too fussed about that right now). The actual images will most likely come from a social network (Facebook, Google, Twitter, Gravatar, etc)
Now, the map view will basically always be displayed, so the images are essentially always present. I will however be performing image manupilation, stacking, etc for these avatars.
Given the above information, here are my questions:
Where should i cache these images? Looking at the docs, i feel like a Disk Cache would be the best option?
Should i think about creating an image sprite? Remember, these images don't live in the APK/resources, they are dynamically fetched. Perhaps i could create a per-friend sprite with all the different image sizes i will require?
I also have access to the server which returns these images (right now they just return a URL) - so should i enable this server to instead do image processing/resizing etc based on my requirements, or simply download the original image and then perform the processing on my client application?
You can use lazy loading to dynamically download the users images from the URl and store it in cache. I believe this link would help you out in this :
https://github.com/thest1/LazyList

How to get image name from website?

I've not been successful in searching for this answer, but basically, how can I find the image file name from a website that blocks saving of the images? Normally, the url source will have the image filename and it is easily searchable.
However, some sites lets you hover over the picture and it then zooms to a larger image. The source shows,
for example,
http://example.com/pictures.aspx?ImagePath=ABCDEFGHIJ1234567989KLMNOPQRST==.....
E.g.: A random long string of code, but no .jpg or .png indicating the file name. When right clicking to save, it shows the image is blocked.
How can I get the images using Android code?
Tks
If it's not allowing them to be taken from a website, then it probably shouldn't be taken. That being said, there are a couple of options if you are the owner of the website.
If they are in a database then you can get the url address of them. Also, right clicking anywhere on the page to "View source" should get you some sort of URL of the image.
This seems more of a web service implementation issue rather than anything andriod specific. Many websites have this feature where you are not meant to retrieve information from the url.
However there should be a corresponding supported web service interface for fetching the metadata of a particular resource. If this is not supported then it's meant to be blocked.
The other trial and error sort of way is to invoke a 3rd party API like oEmbed (or Embed.ly : http://embed.ly/) that would return the metadata of the resource for which you have the URL. These services cover a wide range of websites and their resources.
You can search around in their site or find similar such services that would get you this information. Embed.ly is more of a personal preference due to its exhaustive list of supported sites.

Categories

Resources