0

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

Mehul Ranpara
  • 4,245
  • 2
  • 26
  • 39
batuman
  • 7,066
  • 26
  • 107
  • 229

1 Answers1

1

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

Community
  • 1
  • 1
Adnane.T
  • 280
  • 1
  • 4
  • 13
  • So I need to scan all urls in the Webview first to see what are available to download. Thanks. – batuman Feb 13 '14 at 03:56
  • I suppose that you can get the html of your webview the parse it and get all the urls, I don't know much about what you are developing but I thing that you should be more specific on the decription of your problem above. Thanks – Adnane.T Feb 13 '14 at 08:35
  • Now I tried to get url of the text file when the user click the url using public boolean shouldOverrideUrlLoading(WebView view, String url). Thanks – batuman Feb 13 '14 at 14:09