Michael said:
>I'm doing this in an unreleased application. I made an account
>over at Amazon.com, and make a simple HTTP request to their
>server, retrieve the XML result, parse it, locate the image URL,
>fetch the image, and cache it on the SD card.
Hi Michael,
I'd agree that fetching the album art is a java exercise, but
coaxing android to use it once downloaded seems tricky. Once saved to
the card I guess that your android app would then have to trigger a
rescan to pick up the new album art and associate it with the already
scanned media. Otherwise the the album art URI would remain null even
though you've saved the .jpg to the card.
Have you been successful with doing that (getting android to use the
downloaded and saved .jpg)? Have you gotten the downloaded art to
appear in any of the media players?
Or, as an alternative to triggering another scan, maybe the app could
cache the .jpg to the sc card, then run an update() itself to modify
the album art URI of the media.(?) That would circumvent having to do
a rescan. I've been attempting that today without luck (so far!) with
varients of the following:
//the following code does not work and I'm not yet sure why...
//---
long idOfAlbumIwantToSetArtFor = 1; //source of the '1': from a
previous query I did against albums.
Uri itemUri = ContentUris.withAppendedId
(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI,
idOfAlbumIwantToSetArtFor);
ContentValues values = new ContentValues(1);
values.put(MediaStore.Audio.Albums.ALBUM_ART, artURIonSDCard);
context.getContentResolver().update(itemUri, values, null, null); //
<-- the money call
//---
Unfortunatly, the update keeps returning failed for me. Log says
content://media/external/audio/albums/1 is an Unknown or unsupported
URL. I know that URL exists since a .query call does yield a list of
albums and one of them is id 1.
Anyone know if it's 'A Bad Thing' for an app to attempt to update the
album art URI itself? If not, anyone know what I might be doing wrong
above? Anyone know if it's legal to use a remote URI for the album
art?
ty-
-dom
On Jan 5, 2:18 pm, Michael <[email protected]> wrote:
> > Does anyone have a working Example of ALBUM_ART, I have tried every
> > example out there and cannot find any that actually retreive theart.
>
> I'm doing this in an unreleased application. I made an account over
> at Amazon.com, and make a simple HTTP request to their server,
> retrieve the XML result, parse it, locate the image URL, fetch the
> image, and cache it on the SD card.
>
> I don't really see this as an Android-specific issue, it's a simple
> task in Java really.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---