1

I would like to be able to retrieve contents of a .txt file from the internet, and load it in an EditText. I tried using the code on this page: Reading Text File From Server on Android

It didn't work, as you might have guessed. I've read on numerous sites about this type of problem, but I can't get anything to work. Someone suggested AndroidHttpClient but I simply can't find any examples with this.

As I'm a newbie in Android programming, I would love if someone could please give me a small example.

Community
  • 1
  • 1
gosr
  • 4,593
  • 9
  • 46
  • 82

1 Answers1

1

This isn't so much of an Android question as it is a Java question. There are a few ways you could go about doing this, but the simplest might be using java.net.HttpURLConnection.

skyler
  • 8,010
  • 15
  • 46
  • 69
  • Thanks. I can't seem to find any good examples on this though, can you help me out? As I said in the first post, I only need to retrieve contents from a simple .txt file. – gosr Jan 15 '11 at 13:03
  • Update: I was able to find a good example here: http://micropilot.tistory.com/category/Android/HttpClient%20example – gosr Jan 15 '11 at 18:25