I'm not receiving any error. Its just that when I click the button in
my application which should call a function to go online and download
data to the news.txt file, nothing happens.

My Manifest reads as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="com.organiser.college"
      android:versionCode="1"
      android:versionName="1.0.0">
      <uses-permission android:name="android.permission.INTERNET"></
uses-permission>
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".CollegeOrganiser"
                                android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>


</manifest>



On Mar 21, 11:29 pm, "Mark Murphy" <[email protected]> wrote:
> > 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to