Another way to get the bitstream for the picture is thru the picasa api....
applying some mapping to content provider uri ...
content://com.google.android.gallery3d.provider/picasa/item/5703943700733980450
one can map it to a picasa api like the following:
item=>photoid
name??
albumid??
picasaweb.google.com/data/entry/api/user/$NAME/albumid/nnnn/photoid/nnnn
Above is an api request for photo entry - see picasa docs for details.
API requires
Name
albumID
photoID
Name i think u can get from the account on the phone.
AlbumID is tricky because the /item/ node value in the content provider is not a GUID that can use a relationship to infer the album that its in. I don't think.. AFAIK in picasa , you need the user,album,photo tuple to get a reference to a photo entry and the photo entry has the URL for the large photo in the API element:
"media$group":{
"media$content":[
{"url":
You can take the textvalue of the url attribute and request it using http(s) if the visibility of the album is public. The response is the binary stream of the JPG.
php picasa api show large image
see the accepted answer in the above link for more details on getting the image that you want from the picasa api.
Using one of my own content URI's in an example...
content://com.google.android.gallery3d.provider/picasa/item/5703943700733980450
is not available in cache so how to get the image?
well the name on the account is 'rowntreerob' and
i know that photoid 5703943700733980450 belongs to albumid 5703943611411433905.
So, i make an api request for the entry
https://picasaweb.google.com//data/entry/api/user/rowntreerob/albumid/5682316071017984417/photoid/5682316083381958690?fields=media%3Agroup%2Fmedia%3Athumbnail%5B%40url%5D%2Cmedia%3Agroup%2Fmedia%3Acontent%5B%40url%5D&alt=json
and check the response for the text value of
"media$group":{ "media$content":[ {"url":
value=https://lh3.googleusercontent.com/-_FFMNGPU1TQ/TtukXyN4eCI/AAAAAAAACso/EzPmut2iKVQ/DSC01612.JPG
I make a photo image request using the value above and i have the image.
The Gallery 3D app also has the code you could fork because whereever it detects a 'touch' on one of the list of thumbnails, it delegates to the contentProvider interface to 'get' the BMP. I believe that this interface encapsulates all the gory implementation nits mentioned above. By asking the ContentProvider to produce the BMP, the developer doesnt have to worry about the flavor of implementation?? On the thumbtouch, Gallery3d may just ask the provider to return the BMP and its the provider instance that is responsible for resolving the various states of the cache and whether network calls will be required to return the BMP.