Sorry for asking,

But after doing

File file = new File(Environment.getExternalStorageDirectory(),
"alert.txt");

I thought of doing something like
file.append(string) or file.write(string) but there is no such
methods.

How do I use the file to write to the "alert.txt"?
The file must be created before writing, but does file does it or must
I use
file.createNewFile();

Thanks in Advance,
Perumal


On Mar 30, 11:31 pm, Mark Murphy <[email protected]> wrote:
> perumal316 wrote:
> > Yes, I have added the permission and have installed SD card in
> > emulator.
>
> > But how to l look at stack trace to see if got an exception
>
> Use adb logcat, DDMS, or the DDMS perspective in Eclipse.
>
> > and use
> > android.os.Environment?
>
> new File(Environment.getExternalStorageDirectory(), "alert.txt");
>
> That gives you a File object pointing to /sdcard/alert.txt for devices
> that have /sdcard as the path to external storage.
>
> You can read more about this in the docs for android.os.Environment.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _Beginning Android 2_ from Apress Now 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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to