picasso

Picasso Load image from filesystem

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Can I use Picasso library to load images from the filesystem? I'm using startActivityForResult to let the user pick a photo from his gallery, and then want to show the selected image. I already have working code to get the image filesystem Uri , but can't get the Picasso.load() method to work. 回答1: Of course you can. Its actually pretty straight forward: File f = new File ( "path-to-file/file.png" ) or File f = new File ( uri ) Picasso . with ( getActivity ()). load ( f ). into ( imageView ); also Picasso . with ( getActivity ()).

Transparent part of image in ImageView become black

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have problem when displaying image with transparency in Android KitKat (Nexus 7), it is OK in nexus 4 (KitKat) and other previous Android OS, here the image: and ImageView layout: and here the screenshot when running on Nexus 7 (Android 4.4) also, I use Picasso for download & caching image from the URL. 回答1: After some trial: first I try using the image as resource drawable and it still happen (transparent part of the image become black), secondly I convert the image to png image and it is work, so the problem is in the file type (gif).

Download and Save Images Using Picasso

末鹿安然 提交于 2019-12-03 01:56:14
I'm trying to show my news in a custom ListView . Each news is included of some images and I want to 1.download images from server 2.save in local storage 3.save path of images into SQLite 4.show images in ListView using my custom adapter. I just have problem with steps 1 & 2 . I can get news from server and show them in my ListView and show images from cache by add below code in my adapter: Picasso.with(context).load(image[position]).into(iv); By using Picasso.with(context).load(image[position]).into(target) , just I can save one image in storage. Please suggest me your idea ... UPDATE : When

How to display or get an image from Firebase storage

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm new to Android and I have a problem upon displaying an image from FirebaseStorage. This is my code in MainActivity.java : ImageView image = ( ImageView ) findViewById ( R . id . profilePic_image_view ); mStorage = FirebaseStorage . getInstance (). getReference (); Uri downloadURI = mStorage . child ( "circleako.png" ). getDownloadUrl (). getResult (); Picasso . with ( MainActivity . this ). load ( downloadURI ). fit (). centerCrop (). into ( image ); Inside my gradle are these: compile 'com.google.firebase:firebase-database:10

Unable to set Firebase Image Uri in Image View

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am retrieving an image from my firebase database and setting it in an Image View. I am using the following code. mStorageRef . child ( "Book_Photos/" + firstBook . bid ). getDownloadUrl (). addOnSuccessListener ( new OnSuccessListener < Uri >() { @Override public void onSuccess ( Uri uri ) { Toast . makeText ( getApplicationContext (), "GET IMAGE SUCCESSFUL" , Toast . LENGTH_LONG ). show (); if ( uri == null ){ Toast . makeText ( getApplicationContext (), "URI IS NULL" , Toast . LENGTH_LONG ). show (); } try { ImageView image2 ;

Error:Execution failed for task &#039;:app:transformDexWithInstantRunSlicesApkForDebug&#039;. Failed to read zip file

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I get the following error when I tried to build my project. I'm using Android Studio 2.3.3 and macOS High Sierra. Error:Execution failed for task ':app:transformDexWithInstantRunSlicesApkForDebug'. > java.io.UncheckedIOException: java.io.IOException: Failed to read zip file '/Users/tanyalertwichaiworawit/AndroidStudioProjects/BensBoat/app/build/intermediates/split-apk/debug/slices/slice_1.apk'. Gradle file apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion "26.0.1" defaultConfig { applicationId "com

Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried using okhttp and picasso ( following this answer ) for disk caching of images that was i downloading from firebase storage.Now app gives exception and crashes.I have seen these posts post 1 , post 2 but no relevent solution is found.i also tried to clean and rebuild project but no luck. Here is build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "social.com.networking.social.media.app" minSdkVersion 16 targetSdkVersion 25 versionCode 1

Execution failed for task &#039;:app:transformClassesAndResourcesWithProguardForRelease

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to export apk and I want to enable Proguard but it throwing below error. I read so many answers and tried but didn't worked. Getting below error: Warning:Exception while processing task java.io.IOException: java.lang.NullPointerException Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease StackTrace: :app:transformClassesAndResourcesWithProguardForRelease ProGuard, version 5.2.1 Warning: Exception while processing task java.io.IOException: java.lang.NullPointerException :app

Picasso load image with HTTP post

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My API needs some verification mechanism for verifying every HTTP request. The API have the functionality to load a image using HTTP post method. The post request body have contain a JSON object which is verified from the server side. For that i need to include a json like this on the http post request body. { "session_id": "someId", "image_id": "some_id" } how can I do this with Picasso ? 回答1: I got the solution from the hint given by Mr.Jackson Chengalai. Create a Okhttp request interceptor private static class PicassoInterceptor

onBitmapLoaded of Target object not called on first load

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my function : public void getPointMarkerFromUrl(final String url, final OnBitmapDescriptorRetrievedListener listener) { final int maxSize = context.getResources().getDimensionPixelSize(R.dimen.icon_max_size); Target t = new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { if (bitmap != null) listener.bitmapRetrieved(getBitmapDescriptorInCache(url, bitmap)); else loadDefaultMarker(listener); } @Override public void onBitmapFailed(Drawable errorDrawable) { loadDefaultMarker(listener); } @Override