Android – layout available space

This is one of the most common questions around Android layout, and one that’s not at all intuitive or well documented. Let’s take the most simple use case: you have a thumbnail that’s 75dp on the right, and you want a TextView to take up the rest of the space. Of course, you could satisfy […]

Getting Progress (bytesLoaded, bytesTotal) from dynamic XML

Seldom do I use straight XML files anymore; they always seem to be generated from dynamic content, often from PHP running through a DB table.  By dynamically generating the XML file, the system has no way of knowing the size of the final output, so ProgressEvent.PROGRESS listeners will silently fail.  It’s easy enough to remedy […]

PHP – List Most Recent YouTube videos

Include a list (as links, or embeds) of your most recent X videos from a YouTube channel: <?php // change <YourChannelName> and <X> $url = ‘http://gdata.youtube.com/feeds/api/users/<YourChannelName>/uploads?orderby=updated&max-results=<X>’; $xml = simplexml_load_file($url); foreach ($xml->entry as $entry) : // get nodes using mrss (‘media’ rss namespace) $kids = $entry->children(‘http://search.yahoo.com/mrss/’); // for the embed src (just the flv location – […]

Creating a simple RSS feed – the upshot

Really Simple Syndication is simple. Really. The upshot: 1. It’s an XML document (so open it with a standard XML tag) <?xml version="1.0" ?> 2. The root node should be an “rss” element with (at minimum) an attribute for the version: <rss version="2.0"> 3. Children are described with “title”, “description” and “link” elements. None have […]