Hi,

Following code is writting data to the Sdcard.

try {


        FileWriter fOut = new FileWriter("/sdcard/samplefile1.txt");

        final String TESTSTRING = new String("Hello Android
Development team");

        BufferedWriter osw = new BufferedWriter(fOut);

            // Write the string to the file

            osw.write(TESTSTRING);

            /* ensure that everything is
             * really written out and close */

            osw.flush();
            osw.close();

} catch (IOException ioe) {
            ioe.printStackTrace();
            Toast.makeText(this, "WriteFailed!",
Toast.LENGTH_SHORT).show();
       }



<uses-permission
                android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>




Regards,

Mahendra G

On Feb 3, 10:09 am, Ace <[email protected]> wrote:
> Hello Mark,
> Yes, I do get the  SD card image, attached is the screen-shot for your
> reference.
>
> Thank You again for your help
>
> Regards
> Acer
>
> On Wed, Feb 3, 2010 at 12:56 AM, Mark Murphy <[email protected]>wrote:> 
> > Regarding your question ....."Are you sure your emulator has an SD card
> > > image? They don't by default"
>
> > > Yes I think it has SD card image as I'm able to see the same through DDMS
> > > File Explorer when I startup the emulator.
> > > However, when I try and access it through Downloader.java I get Card Not
> > > Mounted.
>
> > A better test is to bring up the AVD Manager (run tools/android from your
> > SDK, or Windows|Android and AVD Manager from Eclipse). From there,
> > highlight your AVD and click the [Details...] button. If the emulator has
> > an SD card image, it will appear just above the horizontal line.
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
> > --
> > 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]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
>
>
>  my-emulator-details.bmp
> 1462KViewDownload

-- 
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