picasso

Canvas: trying to draw too large(144609280bytes) bitmap, at android.view.DisplayListCanvas.throwIfCannotDraw

☆樱花仙子☆ 提交于 2019-12-02 11:55:58
I get image from a web service, i do following to display it in imageView. Picasso.with(getApplicationContext()).load(imageURL).fit().centerCrop().into(ivNews); 2 days ago a 2048X1600 resolution images was uploaded on server, and all of sudden app start crashing with this exception Canvas: trying to draw too large(144609280bytes) bitmap There is a possibility that the image uploaded on server was higher than the mentioned resolution, and server can upload more high resolution images in future as well. I read this article, Its mentioned that glide is faster and better than picasso in terms of

downloading images with Picasso android disck

▼魔方 西西 提交于 2019-12-02 11:34:01
I'm using the Picasso library to download and display images in a listview, I'm using the following code: Picasso.with(mContext).load(listItem.getMainPhoto()).into(holder.image); where listItem.getMainPhoto() is a web url. But I need to download some of the images in a service, usually when the app is not working so the user can see them when he is off line, for example I need to download 10 images that will be used in the listview later. So I have two questions: How can I download images with Picasso and store them in permanent memory, so when I use Picasso.with(mContext).load(listItem

Why can't picasso load my url? Always defaulting to onError.

爷,独闯天下 提交于 2019-12-02 11:13:34
Here is the onCreate of myActivity thats gonna use picasso: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String url = "http://s3.amazonaws.com/snappie.watermarks/crssd.png"; sticker = (ImageView)findViewById(R.id.sticker); Picasso.with(getApplicationContext()).setLoggingEnabled(true); FrameLayout camera_layout =(FrameLayout)findViewById(R.id.fragment_container); previewWidth = camera_layout.getWidth(); Log.d("width","width is"+previewWidth); Picasso.with(this).load(url).into(sticker,new Callback() {

How do i pass picasso into listView adapter

心不动则不痛 提交于 2019-12-02 10:19:09
i need to pass this line into the list adapter Picasso.with(getActivity()).load(imageurl).into(imageOrders); List ListView list= (ListView) getActivity().findViewById(R.id.list); ListAdapter adapter=new SimpleAdapter(getActivity(),orderList,R.layout.order_usa_row, new String[]{TAG_PRICE,TAG_TITLE,TAG_PSTATUS,TAG_PRICESYMBOL,TAG_IMAGE},new int[]{R.id.price,R.id.title,R.id.pstatus,R.id.symbol,R.id.imageOrders}); list.setAdapter(adapter); i'm a begginer, i tried a lot but i can't figure it out , please help you can't "pass Picasso" to the adapter. You have to create your own custom adapter, it's

Cannot retrieve images from firebase storage

风格不统一 提交于 2019-12-02 09:25:17
问题 So Far i have succeeded uploading images to firebase but while retrieving them to recycler view i'm facing problems i.e images are not being retrieved at all. Take a look at my source code: This is Recycler View Adapter: public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ImageViewHolder> { Context mContext; private List<Upload> mUploads; public MyAdapter(Context context, List<Upload> uploads) { this.mContext = context; mUploads = uploads; } @Override public ImageViewHolder

Android PICASSO - Image Not Loading into ImageView + Stops all Statements following from occuring

陌路散爱 提交于 2019-12-02 08:21:39
Background: I have a Picasso Statement in my java file, which reads a JSON and then formats that data to the screen. The Issue: Once my JSON has been read, Picasso does not load Image from a URL to the ImageView, instead, it stops all statements after that from occurring, such as setting the text in a TextView The JSON I am reading: { "coord":{ "lon":139.01, "lat":35.02 }, "weather":[ { "id":800, "main":"Clear", "description":"clear sky", "icon":"01n" } ], "base":"stations", "main":{ "temp":285.514, "pressure":1013.75, "humidity":100, "temp_min":285.514, "temp_max":285.514, "sea_level":1023.22

ImageView image not showing after loading with Picaso and linking to layout file

谁都会走 提交于 2019-12-02 08:20:35
I want to show a radio button and next to it show a ImageView with image loaded by Picaso. I tried putting the ImageView object after loading it next to the radio button in Relative layout but only the radio button is showing up but not the the image. I am new to android and any help is appreciated. can anyone point out the issue? MainActivity.java package com.example.test.imageslider; import androidx.core.content.ContextCompat; import androidx.viewpager.widget.ViewPager; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.widget.ImageView; import android

uploading image not displaying however others is displaying

荒凉一梦 提交于 2019-12-02 07:47:26
I am facing something weird , I can see the image that I am uploading in the link however it is not showing in the app. but If I enter another image link its displaying in the app. what is the cause ? anyone can help ? the main_actvity //Downloading data asynchronously public class AsyncHttpTask extends AsyncTask<String, Void, Integer> { @Override protected Integer doInBackground(String... params) { Integer result = 0; try { // Create Apache HttpClient HttpClient httpclient = new DefaultHttpClient(); HttpResponse httpResponse = httpclient.execute(new HttpGet(params[0])); int statusCode =

Cannot retrieve images from firebase storage

一世执手 提交于 2019-12-02 07:28:09
So Far i have succeeded uploading images to firebase but while retrieving them to recycler view i'm facing problems i.e images are not being retrieved at all. Take a look at my source code: This is Recycler View Adapter: public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ImageViewHolder> { Context mContext; private List<Upload> mUploads; public MyAdapter(Context context, List<Upload> uploads) { this.mContext = context; mUploads = uploads; } @Override public ImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(mContext).inflate(R.layout

Draw a line on ImageView set by Picasso

故事扮演 提交于 2019-12-02 07:25:32
I am trying to figure out how to simply draw a line on an image that is being set in Picasso. I found that if I simply set the image, given a URI, with Picasso and try to draw paint to it using the following: canvas = new Canvas(bitmap); image.draw(canvas); topEdge = new Paint(); topEdge.setColor(context.getResources().getColor(R.color.blue)); topEdge.setStrokeWidth(5); canvas.drawLine(c1.getX(), c1.getY(), c2.getX(), c2.getY(), topEdge); Then I get a crash saying that the bitmap needs to be mutable first. So I added this above that code: Bitmap workingBitmap = ((BitmapDrawable) image