Re size images on device

  • Replies:0
  • OpenNot stickiedUnanswered
  • Forum posts: 21

Nov 25, 2014 9:00:10 PM via Website

Hi everyone,
I'm trying to create an android application that on one of its activities it uploads images from the device to a server.
I'm trying to re-size the image's size and sending it to the server.
I found that link: "voidcanvas.com/whatsapp-like-image-compression-in-android" and than created these functions.
These functions compresses the image without a great loss of quality. Similar to WhatsApp's image compression. It returns a string with the filename which can be used in your FileInputStream.

User uploaded photo
User uploaded photo
User uploaded photo
User uploaded photo
User uploaded photo

I receive an error on the row where it is written: "Cursor cursor = getContentResolver().query(contentUri, null, null, null, null);".
The compiler doesn't recognize the function getContentResolver(). I'm using android studio. How can I run the getContentResolver function?