I wonder if it is possible to have access to deleted photos or other way to have a listener on the button to remove any pictures?
Or a collector of memoir where I can find a trace deleted photos?
Answer1: How to delete photos ?
this depends where the photos are placed, files like photos, audio or video file are generally placed on the sdcard. you can use the code in the following link to delete any file from sdcard
How to delete a file from SD card?
Related
My app saves images to a subfolder of the DCIM folder on the SD-card in the phone.
I do not wish these images to be shown in the androids gallery app.
How can I achive this?
add an empty file called .nomedia in the directory where you store the images
To hide your image file add . to file name for example sdcard/DEIM/yourapp/.yourimage.jpg
this will hide an Image.
If you want to hide one folder add . to the folder name sdcard/DEIM/.yourapp/image1.jpg
I found this solution: Stop saving photos using Android native camera
The idea is to check which files are in the gallery just before taking the picture and just after it, delete that one that is new.
It's not the cleanest solution but it works.
May It will helps you!
I want all camera picture from storage. I know that all images are in DCIM folder and i will get it from that folder (Environment.getExternalStorageDirectory() and then folder dir name ) but Is there any API or any internal method to give it? because in DCIM folder there is also Facebook folder and may others any i think DCIM folder name wary with device to device
Thanks in advance
Is there any API or any internal method to give it?
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
because in DCIM folder there is also Facebook folder
Individual apps are welcome to create sub-folders within DIRECTORY_DCIM. Conversely, there is no requirement for any camera app to store its pictures in DIRECTORY_DCIM, or to even store the images as files of any form.
I am developing an app in android where it download image files and use it as app resource. I want to save the file in a directory so that user can't see this as media files shown in gallery. I just need to know the specific directory where i can save the file and the user wouldn't able to see it.
Android would automatically scan all folders on external storage for media files. If you don't want your image files to show in the gallery, maybe you could add some extension like ".myapp", this way cheats the scanner.
Using the Internal Storage You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.
Just Simple apply your own logic.
when u read the file from internet is byte format.
and after right in to sdcard.
this time just change the some byte of read file.and store this byte in some place like a sharepreference,Static varibale anything.and when you read file and display else play then change the same byte agian and replace this byte with orignal.this call incrypt and decrept.
it`s work dear i do for image file.
Just add a file named .nomedia in the directory you want to exclude from MediaScanner.
Another alternative is to save your image in a Database as a BLOB.
With this you are 100% sure that only your application can access it.
I am facing a problem in android emulator.
In my app i want to download image from url and stored in to sd card.
I am able to download and store the images on sdcard but there is one problem ?
When i download the images and store them, when I want to see that on sdcard gallary I cant see them. But when i scan the sdcard from dev tools-->Media Provider--Scan sdcard .
I got the images.
But dont want to scan sdcard in this way every time?
How to avoid it?
any suggetion?
Use MediaScanner.scanFile() to notify the system of the new files.
If you post your code snippet we may give some suggestion
It depends on how you are giving sdcard path to save the downloaded image
I keep some png files on the user's sd card. Some users report that these images are showing up in their gallery application. Sounds like the gallery implementation on some devices search out any image files they can find on the sd card and show it in the gallery. Is there a way to tell the system not to include these images in the gallery? It's just an annoyance to the users.
Thanks
You can hide individual files from the gallery with a . prefix. For example .myimage.png
I'm not sure what version dependencies the above has and it doesn`t work with some third-party picture tools like the Gallery.
You should add a file named .nomedia into the directory where your images are. You may need to eject and re-insert the SD card before the images disappear from gallery (or otherwise trigger the media scanner) after creating this file on a phone that the Gallery has already picked up the files in the Gallery.
I think the .nomedia option is the best solution, although again, third party tools may not respect the .nomedia flag.
Hiding your files from the Media
Scanner Include an empty file named
.nomedia in your external files
directory (note the dot prefix in the
filename). This will prevent Android's
media scanner from reading your media
files and including them in apps like
Gallery or Music.
In http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
You may also consider saving those files as cache files or in the internal memory. More info in that link.
just keep the files in a folder and name the folder starting with a '.'
for example:
Pictures
Videos
.private--> will not be scanned for any media
Eboks
Along with these solutions using picasa is an alternative too... and .nomedia or .foldername suggestions are generally useful but...
Including accepted answer none of the solutions solve album covers problem.
A large number of android users are storing album covers inside the album folder and .dirname or .nomedia solutions are hiding all from both gallery and music player. The required functionality is hiding from gallery and showing in music player (else there is no reason for not deleting cover pics if we will not see them right? )
Here is the solution ;
Rename all album cover picture files to albumart.jpg
(or what picture you desire to hide from gallery)
This way gallery will not include them and music player will still use :)
Alternatively for any folder if you place a folder.jpg file in it that file will be ignored by gallery application.
As you can see we can only exclude max 2 files (pictures) from gallery application, not more :(
After you do this changes no need to clean caches of gallery and media scanner and reboot (still an option) just run an application that triggers scanning of media on every run. I prefer vaulty it refreshes media gallery on every run on photos, but there are lots of apps, maybe you already have one installed , just use it no need to install an application for just this media scan deal.
Knowledge source : http://code.google.com/p/android/issues/detail?id=35879
While making external directory use something like this
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory("YourDirectoryName"),"YourFolderName");
Instead of
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "YourFolderName");
These files won't be detected by gallery for more reference check saving media files on this link
http://developer.android.com/guide/topics/media/camera.html#intent-receive
Neither Windows nor Android allow the creation of the file .nomedia
It's seen as a file extension without a name.
i tried everything but only this solution worked 100% you need to plug in your urb and format the sdcard check quick format box and press on restore defaults and then it will show everything in ur gallery just you need to move all your images again :)
You can easily create the folder in Windows using Powershell
New-Item -path 'C:\Users\Google Drive\Pictures\.nomedia' -itemtype directory