Android 从文件到字符串数组[]

Android 从文件到字符串数组[],android,list,file,android-listview,android-file,Android,List,File,Android Listview,Android File,我有一个小型服务器,其中包含文本文件,该文件类似于: 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,用来建立一个使用列表,它应该从文件中的列表中建

我有一个小型服务器,其中包含文本文件,该文件类似于:

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,用来建立一个使用列表,它应该从文件中的列表中建立,所以我有两个问题。 1是否可以通过URL访问该文件?如果是,那么问题2。 2尽快通过URL将数据从文件读入字符串数组[]

        private static String[] dataObjects = new String[]{ "Text #1",
        "Text #2",
        "Text #3","Text #4","Text #5" };
路人?

简而言之:

在Web视图中加载您的url 向webview添加两个客户端,如 使用html拆分html。拆分\n; 并查看此链接以将其放入列表:

首先:到目前为止,你都尝试了什么?第二:localhost就是localhost——设备/仿真器本身。1可以通过URL访问文件吗?对2尽快通过URL将数据从文件读入字符串数组[]Yes@Simon,可以给出一个很简单的示例代码,如果不难的话,会很不错的,或者链接。
try {
    URL url = new URL("www.yoursite.com/file.txt");

    // Read all the text returned by the server
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    String str = in.readLine();
    in.close();
} catch (MalformedURLException e) {
    in.close();
} catch (IOException e) {
    in.close();
}