简体   繁体   English

从在线文件夹中打开图像

[英]Open images from online folder

I want to show images from a folder that I am hosting on my own website. 我想显示我自己网站上托管的文件夹中的图像。 But I can't seem to get it to work. 但是我似乎无法使其正常工作。 Currently I can load these images perfectly fine if I use a line of code for each image. 目前,如果我为每个图像使用一行代码,则可以很好地加载这些图像。 But I want to load the images from bulk by targetting said folder, but I can't seem to get this to work. 但是我想通过定位所述文件夹从批量加载图像,但是我似乎无法使它正常工作。

I am trying to make this work with the Universal Image Loader library. 我正在尝试使用Universal Image Loader库进行此工作。 And I am trying to show them all in a gridview. 我正在尝试在gridview中显示它们。

instead of loading www.mywebsite.com/images/1.jpg I want to load the whole images folder at once if its possible. 而不是加载www.mywebsite.com/images/1.jpg如果可能,我想一次加载整个images文件夹。

Is this doable with the universal image loader library or do I need to use something else? 这对通用图像加载器库是否可行,还是我需要使用其他东西?

Universal Image Loader: https://github.com/nostra13/Android-Universal-Image-Loader 通用图片加载器: https//github.com/nostra13/Android-Universal-Image-Loader

After a quick look at the Universal image loader library it does not support bulk image loading from a zip file. 快速浏览通用图像加载器库后,它不支持从zip文件加载批量图像。

Supported URIs are: 支持的URI为:

String imageUri = "http://example.com/image.png"; // from Web
String imageUri = "file:///mnt/sdcard/image.png"; // from SD card
String imageUri = "content://media/external/audio/albumart/13"; // from content provider
String imageUri = "assets://image.png"; // from assets 
String imageUri = "drawable://" + R.drawable.image; // from drawables (only images, non-9patch)

You can either load a zip file with eg HttpURLConnection yourself, unzip it and use the images or load images one by one. 您可以自己使用HttpURLConnection加载zip文件,解压缩并使用图像,或者一张一张地加载图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM