I just want to confirm that the camera cannot be used without an SD card on Android?
I fire the MediaStore.ACTION_IMAGE_CAPTURE intent to use the camera and was trying to the get the camera to store the image in the apps data folder
ContentValues values = new ContentValues();
values.put(Media.TITLE, "Image");
values.put(Images.Media.BUCKET_ID, path.hashCode());
values.put(Images.Media.BUCKET_DISPLAY_NAME, name);
values.put(Images.Media.MIME_TYPE, "image/png");
values.put(Media.DESCRIPTION, "Image capture by camera");
values.put("_data", Constants.imagePath);
Uri uri = getContentResolver().insert(
Media.EXTERNAL_CONTENT_URI, values);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
startActivityForResult(cameraIntent, PICTURE_ACTIVITY);
I assume the camera can not access the apps data folder
So without a SD card there is no way to use the camera?
There is another way you can perform image capturing, using Camera preview on your surface view.
By using this thing, you can save previous image and take a capture. You can pass your application's cache directory getCacheDir()
method of context.
Reference:
1) https://github.com/commonsguy/cw-advandroid/tree/master/Camera/Preview/
2) http://android-er.blogspot.in/2010/12/camera-preview-on-surfaceview.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With