Get bitmap of the image from browsers - java

I am trying to get the bitmap of the image which i am viewing in browser. is it possible to get those bitmap values from any of contentProvider. Pl suggest me how to do this. Thanks in advance.

You can use a crawler to get the web-page contents, like Jsoup, then find the image url & either download its bitmap with Glide library or directly load it into a ImageView (using Glide again).

Related

which the easiest way to donwload an image from sql and import to imageView?

as mentioned in the title, which is the easiest way to retrieve an image from sql and show it on image view?
I'm really new into Android world and I would like to achieve something without copy and paste other's code.
the images are stored in the sql as url in the webserver and not ad blob file.
What do you think about it?
thank you in advance!
Picasso is a great and simple library that can help you download/cache and manipulate images on android

How to cache image downloaded from URL in Java?

I have downloaded an image from a URL using ImageIO.write, so now I am wondering if there was a possibility of somehow caching that image. Is there a possibility to compare the downloaded image with the URL it's downloaded from to know that the image is from that URL? I need this because if I download an image and than later call that same URL for downloading, my app can recognize that it already has the image downloaded, so it doesn't download it again.
You should try to see if you can integrate the code to upload the picture to google and search by image. Or, you can also save the url of the image with an array while storing the image if you have multiple images you want to download at once.

retrieve the URL images from SQlite

When retrieve the images from Firebase to SQlite it comes as link, so I am trying now to show the images through Picasso as the following:
Picasso.with(context).load(favoritesList.get(position).getFoodImage())
.into(viewHolder.food_image);
but the image not showing. How can I do it?
The first check value of this favoritesList.get(position).getFoodImage(), if not null, paste url to browser and see result. Check your image in xml file and maybe Picasso library error, because in one of my project, Picasso not working but when I using Glide, it's work fine, and i don't understand why :D. BTW you should set placeholder for image.

How to Get Image Path in my App which is Selected from Whats app's Chat?

i have demo application with image view and in this image view i need to set image from which selected from whats app Chat,
Currently i was getting Path of selected image i.e. content://com.whatsapp.provider.media/item/245429
Does any idea to resolve this ?
Thank You in Advance.
There is no image path, as there is no requirement that this Uri point to a file, let alone point to a file that you have direct filesystem access to.
Use an image-loading library (e.g., Glide, Picasso) and provide it the Uri that you get from WhatsApp. Those libraries know how to use ContentResolver and openInputStream() to read in the bytes associated with that content, convert those bytes into a Bitmap using BitmapFactory.decodeStream(), and put the Bitmap into your ImageView.

Android set image from file

I have a question file. I am reading it and I want set image to ImageView from file. For ex:
img.setImageResource(R.mipmap.+"simdikiSoru.getUlkeAdi()");
but it isn't working.
R.mipmap will refer to resources, not files on the device's filesystem.
The best solution is to use one of the many image-loading libraries available for Android, such as Picasso.
Picasso.with(this).load(...).into(img);
where this is your Activity and ... is a File or Uri pointing to your image.
If you do not wish to use a library, then you can create your own subclass of AsyncTask, use BitmapFactory to load in a Bitmap in the task's doInBackground() method, and then set the Bitmap on the ImageView in onPostExecute().
The images your put into res/drawable are handled by Android. The best way to call upon an image in the folder would be
setImageResource(R.drawable.your_image_name)

Categories

Resources