I'm using this java code to compress an image in basic4android! However, nothing works!
#if java
import android.graphics.Bitmap;
import java.io.*;
import android.os.Environment;
public void Resize(Bitmap mPhoto)
{
try
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
mPhoto.compress(Bitmap.CompressFormat.PNG, 50, bytes);
File file = new File(Environment.getExternalStorageDirectory()+"/"+"11111.jpg");
file.createNewFile();
FileOutputStream fo = new FileOutputStream(file);
fo.write(bytes.toByteArray());
fo.close();
}
catch (Exception e) {}
}
#end if
No file is shown under ExternalStorageDirectory.