I'm using Android SDK-1.0_rc2 on windows, I've emulated the sd card
and created on my D:\ drive as sdcard1.iso. My code for saving to the
SD card is as follows:
try
{
Log.e("filename",filename);
String filepath=Environment.getExternalStorageDirectory
().getAbsolutePath();
Log.e("FilePath",filepath);
FileOutputStream fos = openFileOutput(filepath +
filename, MODE_APPEND);
BufferedOutputStream bos = new BufferedOutputStream
(fos);
b.compress(CompressFormat.JPEG, 100, fos);
bos.flush();
bos.close();
}
When I view the Logcat I see the following error:
java.lang.IllegalArgumentException: File /sdcardobama.jpg contains a
path separator
So I changed the code to:
FileOutputStream fos = openFileOutput(filepath + "/" + filename,
MODE_APPEND);
The error is still occuring, so I tried to push the image using the
command:
adb push obama.jpg /sdcard/obama.jpg
I noticed 0 bytes are being pushed, any idea where I'm going wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---