Search code examples
androidandroid-webviewandroid-wifi

How to read text from downloaded text file directly from an application?


I am implementing reading text file from an external SDcard through Wifi. Now I can download text files from SDcard at my android app. My questions are :

(1) How can I read text directly from the text files into my app? What i am doing is i am scanning all attached devices and choose the SDcard to see the contents through a url. The url is has ip address and port number of the attached SDCard. then i can see the files and the current status is just to download the file into the download folder. What i want is read directly the text from the text files. so that I don't need to download. Is it possible?

If not possible,

(2) Catch those downloaded text into my application directly so that i don't need one more step to get text from the text file in the download folder. May I have some suggestion? My intention is to read text files from the SDcard into my application. Thanks


Solution

  • It is not possible to read the text file without downloading it.
    Since you have the direct url to your textfile you can just access it and read it like this