Pergunta

The device is Samsung Galaxy III. I developed an APP to run the camera activity and capture an image. After analyzing the image, I print out some text information. Right now every captured image is saved at gallery. I don't need the image to be saved in gallery or SD card. I think either of the following two solutions will work for me, but I don't know how to program it:

  1. avoid saving pictures to gallery.
  2. delete the picture somewhere in the APP.

Any comments are appreciated.

Foi útil?

Solução

Read Android Camera tutorial.

...

Storage - Are the images or videos your application generates intended to be only visible to your application or shared so that other applications such as Gallery or other media and social apps can use them? Do you want the pictures and videos to be available even if your application is uninstalled? Check out the Saving Media Files section to see how to implement these options.

or see this one: How to save image captured with camera in specific folder.

Outras dicas

In the Camera intent when starting, add this:

intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(getTempFile(context)));

I solved my problem with following two steps:

  1. as '@auselen' pointed, save all the images to a specific folder. How to save image captured with camera in specific folder.

  2. delete all the images in that folder somewhere in the APP. How to Delete Image From SDCard in Android

use this for delete a pic 

ImgPhoto1.setImageBitmap(null);

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top