I set myself a little challenge yesterday, I wanted to see just how quick it was to develop in Flash Lite, that being a major selling point. My chosen project was a (greatly simplified) version of Jermain Andersons TV Guide application. I’m not sure exac…
I set myself a little challenge yesterday, I wanted to see just how quick it was to develop in Flash Lite, that being a major selling point. My chosen project was a (greatly simplified) version of Jermain Andersons TV Guide application. I’m not sure exactly how he put his together, but I can talk about how I went about it. I’ve also provided all source code and a demo at the end.
First a demo
View in new window!
Now some info
The first step was to set up the XML files that contain the "playlists", I’ve created one for each of the major TV services in the U.K. and one for BBC radio channels, but you could easily create one for "Entertainment", one for "Movies" etc. Here’s a sample for your bog standard soon to be phased out terrestrial channels:
<?xml version="1.0" encoding="UTF-8"?>
<channel title="BBC1" url="bbc1.xml" />
<channel title="BBC2" url="bbc2.xml" />
<channel title="ITV1" url="itv1.xml" />
<channel title="Channel4" url="ch4.xml" />
<channel title="five" url="five.xml" />
Now of course Flash Lite cannot handle XML directly, so the next phase was to write some PHP files to spit this data out in name value pairs, something like this:
chTotal=6&ch0=BBC Radio 1&url0=bbc_radio1.xml&ch1=BBC Radio 2&url1=bbc_radio2.xml&ch2=BBC Radio 3&url2=bbc_radio3.xml&ch3=BBC Radio 4&url3=bbc_radio4.xml&ch4=BBC Radio 5Live&url4=bbc_radio5_live.xml&ch5=BBC Radio 5Live Sports&url5=bbc_radio5_live_sports_extra.xml
What is REALLY important to note here is that we are still operating on a 2.5G (GPRS) network or slower, 3G just isn’t that popular yet (unless your in Japan), so every single byte really does count, for this reason I’ve shortened "channel" to "ch" in the response, but I would go even further and use simple "c" if I weren’t distributing this app for others, it really does make a huge difference.
So with Flash now reading the data using emulated arrays (pdf link) we can start to show some channels, and the same process is used to display actual listings. Here’s a couple of screenshots:
If I were to continue to develop this app, I’d be adding in some graphics to show what is currenly playing, a now and next page, and perhaps shave some extra bytes off the download (removing the : from times and replacing it in Flash etc), but for now it’ll do.
Download all files here
Download just the SWF to put on your Flash Lite enabled phone here