【发布时间】:2014-12-29 19:28:52
【问题描述】:
我有一个 小型 服务器,其中包含 文本文件,它可能类似于:
http://127.0.0.1:59777/smb/192.168.0.250/Files/Interstellar.mp4
http://127.0.0.1:59777/smb/192.168.0.250/Files/уаау.mp4
http://127.0.0.1:59777/smb/192.168.0.250/Files/possible.mp4
在我的程序中有listView 用于构建应从文件中的列表构建的用途列表,所以我有 2 个问题。
1) 是否可以通过 URL 访问文件?如果是这样,那么问题编号 2 。
2)尽快通过URL从文件中读取数据到String[]数组中
private static String[] dataObjects = new String[]{ "Text #1",
"Text #2",
"Text #3","Text #4","Text #5" };
路人?
【问题讨论】:
-
第一:到目前为止你尝试了什么?第二: localhost 就是 localhost - 设备 /emulator 本身。
-
1) Is it possible to access the file via URL?是的。2) as soon as possible via the URL to read data from a file into an array of String []是的 -
@Simon,可以给出一个很简单的示例代码,如果不难,那就很plagodaren好了,或者链接。
标签: android list file android-listview android-file