的Android上传图像AWS-调整

问题描述:

我把文件上传到AWS S3服务器问心无愧代码:的Android上传图像AWS-调整

private void beginUpload(String filePath) { 
     if (filePath == null) { 
      Toast.makeText(this, "Could not find the filepath of the selected file", 
        Toast.LENGTH_LONG).show(); 
      return; 
     } 
     File file = new File(filePath); 
     TransferObserver observer = transferUtility.upload(AWSConfiguration.BUCKET_NAME, file.getName(), 
       file); 

    } 

之前上传我要调整图像(不是我的手机,但只有在服务器上)占用更少的内存。怎么做?

假设你file是位图让我们创建Bitmap对象如HERE然后调整它的大小,如HERE。用HERE创建带有调整大小的位图的新文件,发送并删除文件。