Android Gallery (view) Video (also Thumbnail Issues)
Solution 1:
Here you go.. working very nicely....! http://mihaifonoage.blogspot.com/2009/09/displaying-images-from-sd-card-in.html
Solution 2:
If I understand correctly, you have images and videos served by content provider and accessible as URIs. You want to create thumbnails for such images and videos.
I don't know how to do this with video files, but this is how I will implement it with image files.
Open the image as InputStream using ContentResolver's openInputStream method. http://developer.android.com/reference/android/content/ContentResolver.html#openInputStream%28android.net.Uri%29
Create a BitmapDrawable with the above InputStream using this method http://developer.android.com/reference/android/graphics/drawable/BitmapDrawable.html#BitmapDrawable%28android.content.res.Resources,%20java.io.InputStream%29
Scale down the BitmapDrawable to desired width and height of thumbnail. Follow this tutorial. http://www.anddev.org/resize_and_rotate_image_-_example-t621.html
[Optional] You may want to cache the thumbnail, so that you don't have to repeat above steps everytime the user accesses your Gallery.
Solution 3:
I think for Images, the answers above could be useful. For videos, the class MediaMetadataRetriever is what is used by the native Gallery app., but unfortunately, that is not a published API.
Post a Comment for "Android Gallery (view) Video (also Thumbnail Issues)"