ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar); avatarButton.setImageResource(R.drawable.avatar); strAvatarFilename = \"Image.jpg\";
The Android Library SiliCompressor provide this functionality for you to compress your images while keeping the image quality.