Jeffrey Blattman
Jeffrey Blattman

Reputation: 22647

android Thumbnails.getThumbnail() and phones w/o ext storage

HTC incredible, no SD card only internal memory. my app uses MediaStore.Images.Thumbnails.getThumbail() to retrieve image thumbnails. looking at the code, Thumbnails hard codes the external storage URI in its impl!

worse, MediaStore is final so it can't be extended, and it uses internal SDK calls so it can't be copied.

Is anyone aware of a workaround for this? worst case is I need to factor out what i need from Thumbnails and maintain it myself. highly undesirable.

Upvotes: 1

Views: 655

Answers (2)

Noah Seidman
Noah Seidman

Reputation: 4409

A year later it seems that 2.3+ versions of Android no longer use the INTERNAL_CONTENT_URI for user media; existence of an external SD card is irrelevant. Of all android models I have the INTERNAL_CONTENT_URI is only used for system apps, and HTC devices use it for tutorials and other weird media files. All photos and videos taken from the camera, all downloads, and every other media type I've seen will save to the EXTERNAL_CONTENT_URI. I feel confident in saying the INTERNAL_CONTENT_URI can now be completely avoided, and just using the EXTERNAL_CONTENT_URI will retrieve all user media; at least anything that the user will be interested in.

Some devices I've worked with include the HTC Thunderbolt, the HTC Droid DNA, the Galaxy Nexus, and the Samsung Galaxy S3. Samsung devices rarely ever use the INTERNAL_CONTENT_URI, and I have yet to see anything on Nexus devices. The only modern device I've seen that still uses it is HTC devices, but to reiterate and conclude there is absolutely nothing useful to the user stored in the INTERNAL_CONTENT_URI on HTC devices.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007494

android Thumbnails.getThumbnail() and phones w/o ext storage

All Android devices with the Android Market have at least 2GB of external storage when they ship. Whether or not that storage is available at any given moment may vary.

HTC incredible, no SD card only internal memory.

The HTC Droid Incredible has external storage. It is not an SD card. External storage does not mean "removable storage", but rather storage that can be mounted by the user as a drive/volume on their desktop or notebook.

my app uses MediaStore.Images.Thumbnails.getThumbail() to retrieve image thumbnails.

One presumes you are encountering problems with this. It is often useful to explain your problem if you expect to get help in resolving it.

looking at the code, Thumbnails hard codes the external storage URI in its impl!

Looking at the code, I'm not seeing where this hard-coding is occurring. There is no reference to sdcard anywhere in MediaStore. Consider in the future using a hyperlink to point to such resources.

worse, MediaStore is final so it can't be extended, and it uses internal SDK calls so it can't be copied.

None of that would do you any good, considering that you cannot replace the MediaStore except via a complete firmware replacement.

is anyone aware of a workaround for this?

Possibly, but since you declined to explain what "this" is, it is impossible to answer your question.


UPDATE based upon comments:

I own an HTC DROID Incredible. /mnt/sdcard/ is user-writeable. I wrote a program that wrote to it. If you know how to program, you might try writing a program that writes to it -- be sure to hold the WRITE_EXTERNAL_STORAGE permission. The permission bits (which are 075 for my /mnt/sdcard/) aren't especially relevant for external storage on Android 1.x/2.x devices AFAIK, because external storage is vfat on those OS versions and therefore do not really honor Linux permissions.

With respect to EXTERNAL_CONTENT_URI, that turns into a content:// Uri, which does not "hard codes the external storage".

Upvotes: 1

Related Questions