Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using camera with no SD card on Android

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?

like image 668
user964283 Avatar asked Dec 04 '11 18:12

user964283


1 Answers

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

like image 135
Chintan Rathod Avatar answered Oct 04 '22 16:10

Chintan Rathod