i am creating an android app where in i am getting all the images from the gallery to display in a grid view in my activity. I am also displaying checkboxes along with the images so the user can select multiple images and upload it to the server. to upload it to the server i am using
and the calling function to this class is
UploadToServer upload=new UploadToServer();
public void uploadImage(View v){
progressDialog = ProgressDialog.show(MultiPhotoSelectActivity.this, "", "Uploading files to server.....", false);
Thread thread=new Thread(new Runnable(){
public void run(){
for( int i=0;i<selectedItems.size();i++)
{
doFileUpload(selectedItems.get(i));
runOnUiThread(new Runnable(){
public void run() {
if(progressDialog.isShowing())
progressDialog.dismiss();
}
});
}
}
});
thread.start();
}
private void doFileUpload(String imagepath) {
// TODO Auto-generated method stub
try{
upload.uploadFile(imagepath);
}
catch(Exception e){
Log.e("log_tag", "Error in http connection "+e.toString());
}
}
I want to put a compression code for the images as the user is gonna select multiple images...can somebody please suggest what compression code to use and where should i put it??? i m very new to android app development and i hav never used any image compression code before.. Please suggest where can i put a compression code for images in my app???
Please help!
Thanks in advance!