|
yes, it's just as easy to read from an SD card. Here's
an example to list the files on an SD card: File sdRoot = new File( "/sdcard/" ); String [] sdRootFiles = sdRoot.list(); if ( sdRootFiles != null ) { int noFiles = sdRootFiles.length; Log.v( tag, "number of file found on sd = " + noFiles ); for ( int i = 0; i < noFiles; i++ ) { Log.v( tag, "\t" + sdRootFiles[ i ] ); } } else Log.v( tag, "no sd found" ); But, before the above works, here's some steps to take to "make an SD card". On the Android tools directory, 1) have a look at 'mksdcard --help'. eg. to create an 8 MB FAT32 file system image named sdcard: mksdcard 8M sdcard 2) start the android emulator with the file system you've created: emulator -sdcard sdcard & 3) copy a couple of your files into the emulator: adb push YOUR_FILE_A /sdcard adb push YOUR_FILE_B /sdcard 4) have fun! Naveen Garg wrote: Thanks Bruno!! It was really helpful. I would appreciate if you could tell me how to do this using SD Card.On May 5, 10:46 am, Bruno Sauer <[EMAIL PROTECTED]> wrote: --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-no... For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~--- |
- [android-developers] How to do file handling in android Naveen Garg
- [android-developers] Re: How to do file handling in andro... Bruno Sauer
- [android-developers] Re: How to do file handling in a... Naveen Garg
- [android-developers] Re: How to do file handling ... Mark Murphy
- [android-developers] Re: How to do file handling ... Bruno Sauer

