take camera picture with ACTION_IMAGE_CAPTURE

Last Updated:

  1. android88

    android88 Member This Topic's Starter

    Jan 6, 2010
    Likes Received:
    Hi everyone, I just found out that there is a standard camera intent and I want to use it to take a picture in my application. I'm calling the picture taking intent like this:

    Code (Text):
    1. Intent intent2= new Intent("android.media.action.IMAGE_CAPTURE");
    2. uri = Uri.fromFile(new File("TempPicture"));
    3. intent2.putExtra(MediaStore.EXTRA_OUTPUT,uri);
    4. startActivityForResult(intent2,0);
    And in the onActivityresult:
    Code (Text):
    2. Bitmap leftImage = (Bitmap)data.getExtras().get("data");
    But the image doesn't get the filename I specify (TempPicture), but just a numbered filename (e.g. "IMAG0119"). Also, the line above for getting the bitmap doesn't get the real image, but a very scaled down version (the image that gets stored on my sd card is much bigger).

    Does anyone know how to get it to make the file with my own filename? The reason I want to know this is because I don't actually want to save the image on the phone, I just want to read it in an other part of my application and then delete it. But for deleting it I need the filename.

    PS: Is it true that I can't get a full sized image when using the standard camera intent? (The images I get are about 600x400, and by googling it seems like fullsized images are not possible)


Share This Page