Where to put php code in Android?


Or another way to parse an image from returned xml file? I know this question will be getting a lot of negatives, but the thing is I am a noob at this networking thing. As foolish as this may sound, still I had to ask: where should I put the PHP code? I am developing an app which has to display the image of an artist as the background, and I came across this code:


$url    = 'http://api.discogs.com/artist/';
$artist = 'deadmau5';
$data   = json_decode(file_get_contents($url . $artist));

$image  = $data->resp->artist->images[0]->uri;


But I don't know where to put this code. If I put this code in the XML file wrapping it around the tag <![CDATA[ will it work?

You can read from this site, XMLparser and ImageLoader class http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/