简体   繁体   English

将XML文件从Web服务返回到Android设备?

[英]Returning an XML file from a web service to android device?

I have a set of mp3 files on my computer which i want to be the server. 我的计算机上有一组要作为服务器的mp3文件。 Now i have a web service(Songs_Collection). 现在,我有一个Web服务(Songs_Collection)。 This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server. 该Web服务将服务器上存在的所有歌曲的列表返回给用户。用户可以直接从服务器下载所需的文件。

I have a small problem : 我有一个小问题:

How does my web service get the list of audio files kept on the server in the folder c:\\Audio Files . 我的Web服务如何获取保存在服务器上的c:\\Audio Files夹中的c:\\Audio Files

Someone suggested that i need to keep the names in a "Web Content" folder, but can anyone suggest how should i approach it? 有人建议我需要将名称保留在"Web Content"文件夹中,但是有人可以建议我该如何处理吗?

I worked out on this part . 我在这部分上做了工作。 But now how do I send it to the client on device ? 但是现在如何将其发送到设备上的客户端?

Can i send it directly as an array? 我可以直接将其作为数组发送吗? (I guess then some seriliazation-deserialization needs to be done. please suggest) (我想这时需要做一些丝化反序列化。请提出建议)
Or If send it as an XML file then how should I proceed? 或者,如果将其作为XML文件发送,那么我应该如何进行? (This is more important) (这更重要)

This is working perfectly fine : 这工作得很好:
for- 对于-

public static void main(String[] args) {
    File directory=new File("C:/copyimages");
    String filename[] = directory.list();

    for (int i = 0; i < filename.length; i++) {
        System.out.println("\n");
        String listFilenames = filename[i];
        System.out.print(listFilenames);
    }
}

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

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