【发布时间】:2016-05-07 07:58:43
【问题描述】:
如何从 firebase 中检索图像。我首先将我的图像转换为 base64 字符串,然后将其保存到下面的 firebase 字符串代码中。
Bitmap bm = BitmapFactory.decodeFile(imgDecodableString);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG,100,baos);
byte[] byteArray = baos.toByteArray();
String encodedImage = Base64.encodeBytes(byteArray,Base64.ENCODE);
ref.push().setValue(encodedImage);
现在如何在我的活动中显示此图像。
【问题讨论】:
-
获取图片后使用DecompressFormat.......
-
我是新手,能否请您用代码解释一下。
标签: android firebase firebase-realtime-database