>
> Hi, I used the code you suggested Simon in this way,
>
> try{
>
>               URL myURL = new URL("http://www.indulec.ie/weather.txt";);
>
>               URLConnection conn = myURL.openConnection();
>               conn.connect();
>
>               BufferedReader is = new BufferedReader(new InputStreamReader
> (conn.getInputStream(), "UTF8"));
>
>               FileOutputStream fOut = openFileOutput("news.txt",
> MODE_WORLD_READABLE);
>
>               OutputStreamWriter osw = new OutputStreamWriter(fOut, "UTF8");
>
>               String istr;
>
>               while ((istr = is.readLine()) != null)
>               osw.write(istr+"\n");
>               osw.close();
>               }
>               catch (IOException e) {
>                 throw new RuntimeException(e);
>
>         }
>
> but it doesn't seem to be editing my news.txt file. I have it saved in
> the assets folder of my application. Is this correct?

You are attempting to download news.txt. Given your code, when downloaded,
that file will appear in:

/data/data/your.package.here/files

> I have <uses-permission android:name="android.permission.INTERNET"></
> uses-permission> included in my Manifest, this just has to be
> physically typed in right? I don't need to add it in some way.

No, but it might be in the wrong spot. If you could, post both your
AndroidManifest.xml that you are using with the above code and the actual
Java error you are receiving (via adb logcat, DDMS, the DDMS perspective
in Eclipse).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to