I want to resize an image on the sd card and send it to a Web service, the call is asynchronous and ParcelFileDescriptor and CountingInputStreamEntity use to display progress bar. What should I do to resize and send in the same way ! This is my current code:
ParcelFileDescriptor fileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r");
InputStream in = context.getContentResolver().openInputStream(uri);
CountingInputStreamEntity entity = new CountingInputStreamEntity(in, fileDescriptor.getStatSize());
entity.setUploadListener(this);
entity.setContentType("application/octet-stream");
put.setEntity(entity);
Thanks in Advance.
The image can be re-sized by using BitmapFactory.Options
You need to create a new small width and height of the image like following: