Android 如何使用Firebase数据库中的图像路径显示图像?
首先,我从gallery中选择图像,将其上传到Firebase存储,并在Book节点中存储路径,以及关于书籍的其他信息 那个么我怎样才能得到图像并在imageView中显示呢 我的活动(我正在做什么来获取关于这本书的其他信息): 布局文件中的图像视图:Android 如何使用Firebase数据库中的图像路径显示图像?,android,firebase,firebase-realtime-database,imageview,uri,Android,Firebase,Firebase Realtime Database,Imageview,Uri,首先,我从gallery中选择图像,将其上传到Firebase存储,并在Book节点中存储路径,以及关于书籍的其他信息 那个么我怎样才能得到图像并在imageView中显示呢 我的活动(我正在做什么来获取关于这本书的其他信息): 布局文件中的图像视图: <ImageView android:id="@+id/book_picture_display" android:layout_width="@dimen/feed_ite
<ImageView
android:id="@+id/book_picture_display"
android:layout_width="@dimen/feed_item_profile_pic"
android:layout_height="@dimen/feed_item_profile_pic"
android:scaleType="fitCenter" />
节点书:
首先,请存储完整的图像路径,包括firebase存储域,如
gs://.appspot.com/images/
,使用此路径,您将能够从firebase存储下载图像
对于当前可见的datasnapshot,这就是解决方案
谢谢我曾经解决过
FirebaseUI
:
storageRef = storageDisplayImg.getReferenceFromUrl(item.getChemin_image()); // return gs://mydreambook-32321.appspot.com/images/test23-03-2017_16:46:55
Glide.with(convertView.getContext() )
.using(new FirebaseImageLoader())
.load(storageRef)
.into(profilePic);
profilePic.setVisibility(View.VISIBLE);
我现在这样做了。我的映像路径如下:
gs://book-…com//images/sport23-03-2017\u 15:22:54
,但我有一个错误:StorageException发生。对象在位置不存在。code:-13010 HttpResult:404
storageRef = storageDisplayImg.getReferenceFromUrl(item.getChemin_image()); // return gs://mydreambook-32321.appspot.com/images/test23-03-2017_16:46:55
Glide.with(convertView.getContext() )
.using(new FirebaseImageLoader())
.load(storageRef)
.into(profilePic);
profilePic.setVisibility(View.VISIBLE);