1

I get from Gallery through a SEND_MULTIPLE action selected desired images. For each image I achieve an Uri like:

content://media/external/images/media/11

My intention is to encrypt the selected image. For this reason I extract at first the path to the file by:

String[] proj = { MediaColumns.DATA };
Cursor actualimagecursor = context.managedQuery(uri, proj, null, null, null);
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaColumns.DATA);
actualimagecursor.moveToFirst();
String img_path = actualimagecursor.getString(actual_image_column_index);

In this example, I get

/sdcard/DCIM/11.jpg

Now I am able to handle the file (in this case to perform encryption).

The problem remains, that Gallery cashes thumbnails of the file. Therefore, I would like to encrypt them also.

For this reason, I need also for all thumbnails, that represent the image, the associated file paths. How to achieve that? I don't have experiences with the underlying data base. I would be grateful if someone could send a short example.

Is there a general way to handle this (independed of the phone)? In the next step, I want to extend the approach also for video files. Is there a difference on how to handle this problem?

Thanks in advance!
Arik M.

Arik M.
  • 11
  • 1
  • 2

0 Answers0