Flash On

Vodafone Micro SIM iPhone 4 Confusion

17-06-2010

Vodafone Micro SIM for iPhone 4

Having ordered my SIM-free iphone 4 on Tuesday morning super-quick before the Apple store got smudged, I then set about trying to aquire a micro-SIM. This has been a rather arduous task.

I would quite like to stay with Vodafone, since they seem to have the best network generally but am not hugely fussed. Quite staggeringly though, none of the UK networks seem to have any firm details on what happens come launch day. Probably due to how miffed they are at not getting any allocation of phones to sell on to their moronic hoards.

Today I went round every shop in Westfield, Shepherds Bush trying to find out what each operator is doing, not to mention various calls to customer services. No information other than a slightly dubious chap at O2 who promised phones and SIMs on launch day.

Luckily when I arrived home I had received a micro-SIM from Vodafone (destined for an iPad given the associated documentation) but confirmed to work in the new iPhone 4 according to customer services. Apparently I just need to call 03333040044 to activate it on the 24th.

The key seems to be that although you can’t use an iPad activated SIM in an iPhone 4, you can use an unactivated micro-SIM in an iPhone 4.

All very confusing…

Written By Tim for the Stuff section Tags: , , , , ,

Integrating AIR Application with iTunes

04-10-2009

iTunes has long been a closed platform and Adobe AIR is not designed to natively launch or interact with other applications except for the browser. I needed a solution to add MP3 files downloaded through an AIR application to iTunes or any other media player that the user may have installed.

Option 1…

Modifying the iTunes library XML file could potentially be done, but this has risks. Firstly, the XML file can get prohibitively big, and given AIR can only use the DOM method for parsing XML, it could crash the application and do untold damage to the XML library itself, which brings up the issue to backing up the library first. Also unknown is the behavior if iTunes tries to modify the library at the same time as the AIR application, not to mention the requirement to restart iTunes after the change to reflect the changes. All in all this was not a good option, with lengthy development, risky outcome and poor user experience.

Option 2…

iTunes has a COM api library accessible from a native java or .Net application, which in turn could be initiated by AIR. This is far from ideal due to having a second application running on the user’s computer, the volume of development effort to create the application and the complexity.

Option 3…

Users can commonly add songs to iTunes by dragging files into it. This is accompanied by the fact that iTunes launches when double-clicking on any file associated with it such as .mp4 or .mp3 and of course .m3u playlist files. By launching an m3u file with a collection of track paths contained within it, iTunes will launch, songs will be added to the library and user experience is not compromised and development is simple. Although AIR cannot natively launch iTunes, it can launch files, via the browser, thus launching any application that is associated with the file-type. m3u files are commonly associated with iTunes, but also windows media player and any other media player worthy of use.

The key area of development is to dynamically create m3u playlists before calling them with a URLRequest. This function uses Fzip to unzip any zip files that may have been downloaded and creates a collection of paths to write to the playlist file. The playlist data is stored in memory with each download item until the user decides to add the item.

private function generatePlaylist():void {
var playlistName:String = (tmpFile.name.split(’.'))[0]
var os:String = Capabilities.os.substr(0, 3).toLowerCase();

var playlistpath:String
if (os == “mac”) {
if (productType == “album”) {
playlistpath = unzip(File.desktopDirectory.resolvePath(tmpDownloadURL + artistPath + tmpFile.name.replace(”.tmp”,”")).url,File.desktopDirectory.resolvePath(tmpDownloadURL + artistPath).url);
} else {
playlistpath = viewableDownloadURL + artistPath + tmpFile.name.replace(”.tmp”,”");
}
} else {
if (productType == “album”) {
playlistpath = unzip(File.desktopDirectory.resolvePath(tmpDownloadURL + artistPath + tmpFile.name.replace(”.tmp”,”")).url,File.desktopDirectory.resolvePath(tmpDownloadURL + artistPath).url);
} else {
playlistpath = viewableDownloadURL + artistPath.replace(/\//g, “\\”) + tmpFile.name.replace(”.tmp”,”");
}
}
this.Playlist = playlistpath;
}

I kind of got into a mini pickle over forward slashes and back slashes that causes this function to be a little more complicated than is probably necessary, but you get the idea. Next it is necessary to create the playlist file and do the URLRequest after a button-click…

public function addToItunes(e:MouseEvent):void {
var playlistfile:File = File.applicationStorageDirectory.resolvePath(”playListCache/” + e.currentTarget.data[6] + “.m3u”);
var playliststream:FileStream = new FileStream();
var dlManager:DownloadManager;

for (var i:uint = 0; i < downloadManagerObjects.length; i++) {
dlManager = DownloadManager(downloadManagerObjects[i]);

if (e.currentTarget.data[2] == dlManager.FileID) {
playliststream.open(playlistfile, FileMode.WRITE);
playliststream.writeUTFBytes(dlManager.Playlist);
playliststream.close();
}
}
navigateToURL(new URLRequest(playlistfile.url), 'quote');
stage.nativeWindow.alwaysInFront = true;
stage.nativeWindow.alwaysInFront = false;
}

Notably I do a bit of mucking about with the stage to make sure the application stays in front when launching the URL through the browser.

Written By Tim for the Stuff section Tags:

London Run on Bikes

22-06-2009


Westminster, originally uploaded by Tim Tim Tim.

Saturday night saw us embark on the first London Run for a number of years. The basic premise behind a London run is to navigate around London’s various sights throughout the night, thus avoiding the crowds and using as much petrol as possible, then saving petrol on the return journey by cruising round the M25 at 56mph. The car journey usually passes through Heathrow, all the key sights in central London and finishing at a round about North of the Thames in view of the Millennium Dome.
Read more…

Written By Tim for the Stuff section Tags:

Agile Methodology: misconceptions

06-06-2009


Working to some kind of Agile methodology can be a great way to deliver web development projects but it can also be a complete nightmare if not done properly. Most people will be familiar with the standard waterfall approach of design, build test and may have heard about the possible benefits of Agile…
Read more…

Written By Tim for the Stuff, Web Technology section Tags: ,

Cricklewood Fridge Proliferation

04-05-2009


IMGP3312, originally uploaded by Tim Tim Tim.

For some time now, I have suspected that Cricklewood is a place that loves fridges. The reason I say the place loves fridges rather than the people that live there, is that its residents seem rather less keen on the devices, as shown by repeated cases of fridge abandonment at almost every opportunity.
Read more…

Written By Tim for the Stuff section Tags:

Daubeney School Website

24-04-2009

IMGP3270, originally uploaded by Tim Tim Tim.

I was lucky enough to work on website for a local school over the last few months with a group of people from work. It was a hugely rewarding experience and I went along to the school on thursday to launch it. The kind children and staff at Daubeney Primary School gave us each a card to show their appreciation for our work.

One of my ideas behind the development of the site, was to engage the children by getting them to design websites too. It was going to be a slightly simplified version of my craft afternoon pitch, but with 750 children at the school it would have been a little logistically difficult. Instead I produced a lesson plan about good and bad web design and the teachers delivered this to the children in the week leading up to the launch.
Read more…

Written By Tim for the Stuff section Tags: