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 +--);
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
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
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
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
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
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
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
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
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
10 matches
Mail list logo