Issue #156: Camera.DestinationType.FILE_URI on Android not conforming to API Spec

Instead of capturing the orginal image to /sdcard/Pic.jpg or /sdcard/Capture.jpg we detect if the SD card is mounted. If mounted the file is placed in the apps temp directory at:

/sdcard/Android/data/{package name}/cache/

If the SD card is not mounted we default to internal storage at:

/data/data/{package name}/cache/
This commit is contained in:
macdonst
2011-07-15 03:30:22 +08:00
parent 53410781e4
commit eb0e0d9d11
3 changed files with 33 additions and 5 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ public class Capture extends Plugin {
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
// Specify file so that large image is captured and returned
File photo = new File(Environment.getExternalStorageDirectory(), "Capture.jpg");
File photo = new File(DirectoryManager.getTempDirectoryPath(ctx), "Capture.jpg");
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
this.imageUri = Uri.fromFile(photo);