Re: [android-developers] Re: Writing files SDCard on Emulator

2010-02-03 Thread Ace
Mahendra/String, Thank You for your reply on this. The problem was with the following code as pointed correctly by you folks String state = Environment.getExternalStorageState(); if(state != Environment.MEDIA_MOUNTED) { Log.d(DEBUG, The Card is Not Mounted + state +--);

Re: [android-developers] Re: Writing files SDCard on Emulator

2010-02-03 Thread Mark Murphy
After hardcoding the path as per the code below (pointed by Mahendra) I'm able to write the file onto the SD Card and see the same in DDMS /sdcard/somefilename Do not hardcode /sdcard. Use Environment.getExternalStoragePath() to get the path to the SD card. 2. Would the path name like

Re: [android-developers] Re: Writing files SDCard on Emulator

2010-02-03 Thread Ace
Thank you Mark for your reply. Reg: Do not hardcode /sdcard. Use Environment. getExternalStoragePath() to get the path to the SD card. 1. When I use the above method, I end up with the problem of device not mounted, how can I overcome this on an Emulator. 2. On the actual device, how can I

Re: [android-developers] Re: Writing files SDCard on Emulator

2010-02-03 Thread Mark Murphy
Thank you Mark for your reply. Reg: Do not hardcode /sdcard. Use Environment. getExternalStoragePath() to get the path to the SD card. 1. When I use the above method, I end up with the problem of device not mounted, how can I overcome this on an Emulator. That method works perfectly

[android-developers] Re: Writing files SDCard on Emulator

2010-02-02 Thread String
On Feb 2, 5:58 pm, Acer aceofli...@gmail.com wrote: With the above code I'm able to see the The Card is Not Mounted -- message in the logcat. If you comment out the MEDIA_MOUNTED check, are you able to write to the SD card image? Perhaps the problem is in the check, not the SD card. String

[android-developers] Re: Writing files SDCard on Emulator

2010-02-02 Thread Mahendra
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

[android-developers] Re: writing to sdcard

2009-08-19 Thread Mark Murphy
Andrei wrote: Can we assume that App can write to /sdcard some file? What can be reason one can not do that? You would not be able to write to /sdcard if there is no card there, or if the card is not mounted, if the device is hooked up to a PC via USB and the PC has mounted the card, or if

[android-developers] Re: writing to sdcard

2009-08-19 Thread Jack Ha
You can always do the following check in your code: if (android.os.Environment.getExternalStorageState().equals( android.os.Environment.MEDIA_MOUNTED)) { // SD card is present and writable } -- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together The views, opinions

[android-developers] Re: writing to sdcard

2009-08-19 Thread Andrei
Thanks I check String s = Environment.getExternalStorageState(); if( Environment.MEDIA_MOUNTED.equals(s) ) then i get path Environment.getExternalStorageDirectory() I also check there is enough space If it does not work after this? Can user change sdcard write permissions? On Aug

[android-developers] Re: writing to sdcard

2009-08-19 Thread Jack Ha
I don't believe user can change the sdcard write permissions. -- Jack Ha Open Source Development Center ・T・ ・ ・Mobile・ stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile