In my application, I use a GalleryView to display thumbnails. I also have some code to delete a photo. However when I refresh the GalleryView, the thumbnail for the deleted photo is still there. Aside from refreshing the sd card, its there a easy way to delete the thumbnail?
show code for the delete - Gallery tries to pick up pictures so unless the delete is working correctly that may be where the failed-delete is
Related
I need a help. In my android application, I have adding image option.Each time I can choose or take images and send the image to server. here
While sending the image ,I set the image to SD card and send it to server.
after successfully send to server,I removed the image from SD card.
after adding i am showing images from server to list view.
Each and every time I am adding images and showing it like this.
I can able to edit the images also by setting new images.
My problem is,
When editing how to solve cache problems in SD card
what library will be useful for this kind of process.
how to load the images from server in list view.
how to update the particular cell image.
how to manage efficient memory for storing images in SD card.
I am working on an Android app where I have customized the camera. Now I want to delete all the images from the gallery that have been clicked once they have been uploaded in the server. This has been done successfully. However I am not sure whether they are retained in Android's own database. Can anyone please tell me how to see if the image data are saved anywhere in Android's own database once they have been deleted from the picture gallery as I need to take care of this as well.
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:
avoid saving pictures to gallery.
delete the picture somewhere in the APP.
Any comments are appreciated.
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.
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:
as '#auselen' pointed, save all the images to a specific folder. How to save image captured with camera in specific folder.
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);
I used the MediaStore.images.thumbnail.external_content_uri to query the thumbnail on the phone. It works ok with my new phone with some photos taken from camera or the download images from browser.
When using it one friends phone, there are some thumbnails duplicated shown on the gridview and some not even shown.
Do I need to rescan the media before querying the thumbnails in the mediastore.
My experience in working with MediaStore.images.thumbnail is that it cannot be trusted. I guess this is due to different implementation of phone vendors. For example, on my HTC, the thumbnails of gallery is cached by itself (since it is not standard size), not via MediaStore, so those entries are absent in MediaStore. (PS, entries in MediaStore.images.thumbnail are not essentially mapped to an existing picture, that means, it may have an entry on Picture A, if later on you removed Picture A, the thumbnail could still be there pointing to nothing)
The more reliable way is to query the ID of Images from MediaStore.images, and then use MediaStore.images.thumbnails.getThumbnail to retrieve the Image with the IDs.
I would like to know the location of the stored thumbnails in android sdcard. I used the adb push service to upload images and videos to the sdcard. But even after deleting few images, my application is loading the thumbnails of the deleted images which is creating problems. When I click the thumbnails, instead of the corresponding image, some other image is opening. How to delete/ re-populate the thumbnails? Also How to load the original image of the clicked thumbnail? How does android retrieve the original image corresponding to its thumbnail? what's the mapping between these two?
Thanks in advance.
Well, if you are are using system intents, like ACTION_PICK, then you probably need run media scanner ( Applications > Dev Tools > Media Scanner )