0

Is there is way to tell to:

Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE ); 

do not create images at all, but return data in [] bytes??

Bartzilla
  • 2,768
  • 4
  • 28
  • 37
Steve
  • 19
  • 1
  • 3

1 Answers1

1

You may want to use startActivityForResult to get the image and the convert it yourself:

Get the image using the method in the accepted answer of this question: Android camera intent

and convert the resulting bitmap to a byte array as in this one: converting Java bitmap to byte array

Community
  • 1
  • 1
Aleadam
  • 40,203
  • 9
  • 86
  • 108
  • ooo, I see... but basically there is not way, as far as I know to force mentioned above Intent do not create image?? The reason I want to eliminate image creation - is that now it creates 2 images: in sdcard/ and sdcard/DCIM/.... – Steve May 15 '11 at 00:58
  • honestly, it's not problem for me do delete image under /sdcard/ root, the problem I can't find working example to find dynamic path to gallery(which would work in any android)... and finally: because I'm going to save image to DB - I see it as too expensive operation within program.... – Steve May 15 '11 at 01:04
  • @Steve, using those links, you will create the Bitmap *object* in memory, **not** a bitmap *file*. There's nothing to delete! – Aleadam May 15 '11 at 01:06
  • looks very promising!!!! – Steve May 15 '11 at 22:37
  • +1 for sharing my question =) – Tom Fobear Jun 09 '12 at 00:38