picasso

Downloading multiples images from Picasso in Android

一笑奈何 提交于 2019-12-09 06:17:41
问题 I'm using Picasso library to download images from URL. This is my first attempt on Picasso Scenario : I want to download some images from server and store them into a file. I know how to store into file and retrieve. When I ran the below code, I happen to see that I'm getting only last image. It seems like Picasso runs parallelly. I checked it by displaying a toast message. Is there anyway to solve this issue? Problem : I'm getting only the last url image. Here's my code static int count = 0;

HTTP static resources caching forever stategy

痞子三分冷 提交于 2019-12-08 16:31:37
问题 In Effective Android HTTP Jesse Wilson mentioned the following: Serving static resources like images? Use a permanent URL and let it cache forever I am using Picasso with a specific OkHttp instance for fetching and caching images. I am wondering how to setup the let it cache forever strategy? I can only think about overriding the HTTP cache control header max-stale ( Cache-Control: max-stale= )with the highest possible value, is there another (better) way? 回答1: Best way is to configure your

Clear Disk/SD Card Cache of Android's Picasso Image Library

匆匆过客 提交于 2019-12-08 16:03:43
问题 I am using Picasso to load images from my server. It works fine, but I am loading an image, and changed it later. But Picasso has the image cached somewhere in disk (I checked the SD card, and could not find any directory that Picasso is storing in). I tried to remove the cache as suggested by the accepted answer to this question : Invalidate cache in Picasso I also tried skipping cache when loading images using : Picasso.with(ctx).load(new File("/path/to/image")).skipMemoryCache().into

Android : Load image with Picasso onBitMapLoaded not called

泪湿孤枕 提交于 2019-12-08 10:50:31
问题 I'm trying to share image on Instagram in my app. I've url of the image and using Picasso library to download image. Target target = new Target() { @Override public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) { Log.d(TAG, "Bitmap Loaded"); File outputDir = getApplicationContext().getCacheDir(); // context being the Activity pointer try { File outputFile = File.createTempFile("instagram", "png", outputDir); outputFile.createNewFile(); FileOutputStream ostream = new

Is there a way get the progress of the queued downloads in Picasso?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 10:45:01
问题 I'm developing an app which should be able to pre-download all images used from within the dataset so that the app can function fully offline. It should download about 600 images of each 500KB (~300 MB in total). For this I'd want to loop through all url's and execute Picasso fetch() method. This will fetch all images, which is great. The only thing I'm missing is a way to see what the progress is of all the image downloads. Is there any way to see the progress of the download queue of

Image View not set in Android L using Picasso after loading from gallery

久未见 提交于 2019-12-08 09:40:00
问题 @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==RESULT_LOAD_IMAGE && resultCode==RESULT_OK && data!=null) { Uri selectedImage = data.getData(); String [] filePath = {MediaStore.Images.Media.DATA}; Cursor cursor = getContentResolver().query(selectedImage, filePath, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePath[0]); picturePath = cursor

Caching Images and strings using Retrofit, okhttp, picasso

孤者浪人 提交于 2019-12-08 09:03:33
问题 I am working on an app with a lot of dynamic and changing content. I pull all my data from my server when the app is loading. As a result, nearly every activity/fragment is loading separately which will cause the user to wait a lot of time for each "page" to load individually. My goal is to create one loading page when the app starts while being responssible for all the downloading and will disk cache all the images and info(strings) and ti pull them at the right time. (or at least to most of

Random image gets rotated when using picasso

ε祈祈猫儿з 提交于 2019-12-08 08:50:42
问题 I load different images in my RecyclerView and I use Picasso to get them from internet, but randomly an image from iPhone is getting rotated upside down and I don't understand why. It looks fine on the internet. my code is: Picasso.with(context) .load(URLConstants.URL_BASE + imageURL) .placeholder(image) .error(image) .into(new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { Matrix matrix = new Matrix(); try { ExifInterface exif = new ExifInterface

Android Imge Picasso Square Cache Size

北战南征 提交于 2019-12-08 07:08:56
问题 Im using Picasso square library to load images in my android application. This works fine when doing it like this: Picasso.with(getApplicationContext()).load(Properties.IMAGE_URL + i).transform(transformation).centerCrop().fit().into(imgeButton); My problem is that the loading of the image is too slow and I would like the cache to be bigger than it is right now. I see that when working with only one image the cache works properly; The first time the image will not be cached and right after

Picasso clear memory [duplicate]

允我心安 提交于 2019-12-08 06:46:10
问题 This question already has answers here : Load large images with Picasso and custom Transform object (2 answers) Closed 3 years ago . I have many images loaded using Picasso in a view flipper which is in a fragment. I want to know if the images are still in memory when I change to a different fragment. If they persist in the memory how can I remove them. Any suggestions on any other method to load images to a view flipper would be appreciated. The images are in the internal memory of the