Closed muhammadkamranlatifraza closed 4 years ago
i made it work by googling it myself.......
new code here DataBaseHelper.java........................... // // //
public UploadTask uploadImage(Uri uri, String imageTitle) {
StorageReference riversRef = getStorageReference().child(IMAGES_STORAGE_KEY + "/" + imageTitle);
// Create file metadata including the content type
StorageMetadata metadata = new StorageMetadata.Builder()
.setCacheControl("max-age=7776000, Expires=7776000, public, must-revalidate")
.build();
Bitmap b = null;
try {
b = MediaStore.Images.Media.getBitmap(context.getContentResolver(), uri);
} catch (IOException e) {
e.printStackTrace();
}
ByteArrayOutputStream os = new ByteArrayOutputStream();
b.compress(Bitmap.CompressFormat.JPEG, 25, os);
byte[] data = os.toByteArray();
//uploading the image
return riversRef.putBytes(data, metadata);
}
as far as i check it... the quality was not that damaged but size was reduced very effectively....
I think its solution should also be included in