title: How to load large bitmap efficiently with Picasso?
body: <p>I am developing a Wallpaper app where I am showing the images with the help of firebase and Picasso in GridView. I want to retrieve the image from the server and resize it as per the screen resolution. Let the image size is 3000 * 5000 and the device screen size is 720 * 1280, then the image cropped to 720 * 1280.</p>
  
  <p><a href="https://developer.android.com/topic/performance/graphics/load-bitmap" rel="nofollow noreferrer">https://developer.android.com/topic/performance/graphics/load-bitmap</a> gives the solution but it resized the drawable file and with a fixed size.</p>
  
  <p>But I want to resize server image with the device screen size.</p>
  
  <p>RecyclerView ViewHolder</p>
  
  <pre><code>public void setDetails(Context ctx, String image){
  
          ImageView mImageTv = mView.findViewById(R.id.rImageView);
  
          Picasso.get().load(image).into(mImageTv);
  
      }
  </code></pre>
  
  <p>Passing image from Fragment to FullscreenActivity with putExtra</p>
  
  <pre><code>ViewHolder viewHolder = super.onCreateViewHolder(parent, viewType);
                  viewHolder.setOnclickListener(new ViewHolder.ClickListener() {
                      @Override
                      public void onItemClick(View view, int position) {
  
                          ImageView mImageView = view.findViewById(R.id.rImageView);
  
                          Drawable mDrawable = mImageView.getDrawable();
                          Bitmap mBitmap = ((BitmapDrawable) mDrawable).getBitmap();
  
                          Intent intent = new Intent(view.getContext(), PostDetailsActivity2.class);
                          ByteArrayOutputStream stream = new ByteArrayOutputStream();
  
                          mBitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
                          byte[] bytes = stream.toByteArray();
                          intent.putExtra("image", bytes);
                          startActivity(intent);
  
  
                      }
  </code></pre>
  
  <p>Show image in FullScreen Activity</p>
  
  <pre><code>mImageTv = findViewById(R.id.full_imageView1);
  
  
          byte[] bytes = getIntent().getByteArrayExtra("image");
          Bitmap bmp = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
  
          mImageTv.setImageBitmap(bmp);
  </code></pre>
  
  <p>Please help me if you can....if anyone needs more details of code or about my problem, please comment for those....Thank you</p>