android - Getting full-sized image from the camera does not work on Galaxy S -


I'm having trouble capturing the image with the built-in camera app on Samsung Galaxy S.

I have a button on my app, when pressed, the camera launches:

  ContentValues ​​value = new content value (); Values.put (Images.Media.MIME_TYPE, "image / jpeg"); MPicUri = getContentResolver (). Insert (Media.EXTERNAL_CONTENT_URI, value); Intent = New Intent (Mediastore.action_IMUNCCCT); Intent.putExtra (MediaStore.EXTRA_OUTPUT, mPicUri.getPath ()); StartActivityForResult (intent, REQ_CODE_TAKE_PIC);  

From what I have read on the Interviews, I can get the fully captured picture using the URI which I had passed on purpose. And so I have this activity on: Research:

  Uri selected image = MPIRI; String [] filePathColumn = {MediaStore.images.Media.DATA}; Cursor cursor = getContentResolver (). Query (selected image, filePathColumn, blank, empty, empty); Cursor.moveToFirst (); Int columnIndex = cursor.getColumnIndex (filePathColumn [0]); String filepath = cursor.gate string (column index); Cursor.close ();  

And then using the variable file path, I have set the image in an image view. I am not getting any image, and when I stepped through the code, I came to know that BitmapFactory.decodeFile () back null .

  bitmap chosen picture = bitmapfinder Decodefile (filepath);  

So I tried a little more debugging. I found that mPICURI gives the expected URI valid, such as: content: // media / external / images / media / 90 . After taking the picture and the user chooses to save the picture, the cursor fixes the following file: /sdcard/DCIM/Camera/1285601413961.jpg . Although no bitmap is decoded, but when I looked through the gallery, then the picture I've taken is there. So I tried to take a look at the URI of that picture, and I found this:

  URI is: content: // media / external / picture / media / 91 file path: / sdcard / DCIM / Camera / 2010-09-27 23.30.30.jpg  

And it seems that the price last URI will be used with MPCureri.

Am I missing a step here? I really want to do this, just retrieving the picture of the picture picture.

Thank you in advance, Zarah.

Did you try to specify both the files before taking the file and after that? Public static file getTempFile () {// it will / sdcard back /image.jpg final file path = new file (environment .getExternalStorageDirectory (), "MyApp"); If (! Path.exists ()) {path.mkdir (); } Return new file (Path, "image.jpg"); }

I am using this function and setting file path.


Comments