I m using a Webview for a nice page and i need to upload images. Now the Problem, most Images on phones are 2-3MB and i need to resize the image and lower quality before upload starts. So how could i resize it with the sample code found on stackoverflow ?
This code is opening the Filechooser :
//Android 3.0
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
startActivityForResult(
Intent.createChooser(i, "Image Browser"),
FILECHOOSER_RESULTCODE
);
}
Now i need some resize and make a copy and upload the resized. (I know howto create a resized copy, but not how i could interact with the above code)
i did some research and create a solution with the content on SO..
It would directly open gallery from filechooser html and resize the image to sample size of 200x200 and quality 75.
Hope it could help someone...