Posts tagged 'iPhone'

How to get Dirt Cheap O'Reilly Books (Legally) on any Device!

Over the last few years, I've picked up a few O'Reilly books on my iPhone from the App Store. It's not particularly fun reading on an iPhone screen (especially pre-iPhone4), but the books are crazy cheap. Like £3 cheap!

I figured that the reason these books were so cheap, was that they're locked to the iPhone, and you can't read them on your PC or other device. So I was pretty made up when I realised that any (most) iPhone apps work sync to the iPad!

Unfortunately, I didn't realise the iPad would render text so nastily at double-size (I'm hoping iOS4 will fix this).

Nevermind. Today, I found a gem on the official O'Reilly site. How to extract EPUB books from those cheap book-apps we've been buying. This will allow you to read them in your browser, or any other device that supports the EPUB format. This means you can read those books in iBooks on your iPad :)

For the less technical, I've put together some screenshots showing how to do this. First, find the app in the Apps section of iTunes. Right-click and choose "Show in Explorer/Finder".

Windows Explorer (or Finder, if you're on a Mac) will open, and highlight the file for this book. Right-click and choose Copy.

Paste the file somewhere temporary, and rename it to end in ".zip".

Double-click the zip file, and navigate to the Payload folder.

Inside the Payload folder, you'll see a .app folder. Navigate into that.

Inside, you'll find a folder called "book". This is the interesting one. Right-click, and choose Copy.

Paste the folder somewhere, and navigate inside it. You'll see three items: A folder called "META-INF", a folder called "OEBPS" and a file called "mimetype". Highlight these files, right-click and choose Send To -> Zipped folder.

Rename the new folder to end with the extension ".epub" and copy it to a folder where you would like to store your books. Then from within iTunes, choose "File -> Add Folder to Library" and select this new folder. Alternatively, you can drag the epub file into iTunes.

That's it! Now your book will appear in the Books section of iTunes, and will sync into iBooks on your iPad. You can also transfer the file to other devices that can read this format.

This makes those very-attractive O'Reilly books look even more attractive!


Wanted: Artist for iPhone Game

I posted this on Buzz, but thought it worth also repeating here. I'm working on a few iPhone games, but I'm no good when it comes to graphics. I'm looking for someone that might be able to do the graphics for me. One of the games involves a penguin with an umbrella, falling from the sky :-)

Edit: Got a designer signed up. Time to start coding!


Serving Different Ads/Content Based on a Users Location (Geo-Targeting)

You probably haven't noticed, but this blog serves up different ads depending on where you're visiting from. Or at least, it'll serve Amazon UK ads if you're near the UK, and Amazon US ads otherwise. Serving up US ads to UK visitors (and vice versa) is pretty pointless, and I've always tried to avoid showing any ads unless they're relevant and at least targeted to the right country.

There are a number of ways to determine where your visitors are coming from, so I spent some time yesterday trying to find the most reliable way (and preferably one that didn't involve having a huge IP database sat alongside my site!). After much hacking and testing, I found what I believe to be the best way. Google.

Google has a JavaScript loader API, which allows developers to load JavaScript libraries from Google with various benefits. That's not really what we're interested in though, it has something more exciting:

google.loader.ClientLocation

It appears that you do not need an API key to use the JavaScript loader, you can simply reference it at http://www.google.com/jsapi. If you look at the JavaScript served up (which is incredibly fast), you'll see something like this:

google.loader.ClientLocation = { "latitude":50.123, "longitude":-2.876, "address": { "city":"Liverpool", "region":"Merseyside", "country":"United Kingdom", "country_code":"GB" } };

Not only do you get the country, but you get the county, city and even lat/lon pair. For me, the location given was within 2-3 miles of where I live, so if you wanted, you could really localise your ads!

On this site, the country is just sent to a script that will serve up some ads based on keywords I've tagged against a post. You might wish to be a bit more exciting and show your users places or people nearby. This could be especially useful for mobile applications/sites, though be sure to read any associated terms and conditions before using it!


Balloons! - The World Just Got Smaller!

Note: As I post this, Balloons! has been reduced to £0.59 for the paid version. Get it while it lasts!

A few weeks ago I was lucky enough to participate in the beta of Balloons! for iPhone. Since it's now available to buy, I thought I'd share my thoughts on the app here.

Balloons! is purely for entertainment, though it doesn't really fall into the category of games. The basic idea is that you pick a balloon and attach a message and/or photo to the label, and launch it into the air. The balloon will travel around the globe (electronically, of course) to be caught by other Balloons! users. When someone catches your balloon, they may attach their own message and photo and relaunch it into the sky for someone else to catch.

I've included a few screenshots below, and although you can see the level of polish Balloons! has, unfortunately you can't see the subtle animations that really bring the app to life. The official website has a video that might give you a better idea of how it looks.

The Balloons! menu screen

The Balloons! menu screen.

The balloon selection screen

When you launch a balloon, you get to choose how it looks from a selection ranging from normal round balloons to heart and bear-shaped balloons.

The catch balloon screen

Catching a balloon is easy. You can catch balloons from all over the world, though realistically, they have to have been travelling for some time to get from one side of the globe to the other!

The balloon tracker

The Balloon Tracker allows you to see all balloons you've launched, along with the messages and photos that have been attached to them. This is only available in the paid version.

The balloon screen

If you click on a balloon in the Balloon Tracker, you get to see the original message/photo, along with any other messages added to it.

Paid vs Free

Like most apps on the App Store, there's a free version and a paid version of Balloons! With the exception of ads, the only difference is the "Balloon Tracker", which lets you see all balloons you've launched, and the messages that have been added to them. It's well worth paying for this additional feature, or you'll be left wondering whether anyone has caught and added messages to your balloons!


Importing iPhone Dev Keys on a new Mac

When I set my Mac Mini for iPhone development, I was told to backup a key file (.p12) because if I lost it and needed to reinstall, I wouldn't be able to deploy to my iPhone (yikes!). I backed it up as suggested, and made sure I had copies of it all over my Mac, PC and the interwebs.

With a clean install of Snow Leopard, it was time to import this keyfile and make sure everything still worked. As instructed in the docs, I double-clicked on the .p12 file and was asked for the password. I entered it and got the following message:

An error has occurred. Unable to import an item. The contents of an item cannot be retrieved.

Oh, shit.

I tried multiple times to import, and even imported other keys I'd exported before it. I'm 100% sure I was putting the password in correctly. No joy, just lots of errors. Although the key appeared in the list (after apparently failing), Xcode refused to recognise it and I'm unable to deploy to my iPhone. This was looking pretty bad...

Google to the rescue!

After a bit of searching, I came across a post from someone having the same issue, and a workaround. Importing via the terminal apparently works. I gave this a shot, and all is good. I can now deploy to my iPhone again. Thanks Dave K!

Just in case you're reading this with the same problem and the link above is now broken, here's a copy of the solution:

Work-around provided by Dave K.

You can use the 'security' command line tool:
security import priv_key.p12 -k ~/Library/Keychains/login.keychain
security import pub_key.pem -k ~/Library/Keychains/login.keychain


I'm Blogging... From a Mac!

I'm shaking my head with shame. I never thought this day would come. I'm writing a blog post... from a Mac!

Those that know me will probably know I'm a massive Microsoft fanboy. I love .NET, XNA, WPF, Visual Studio, Vista and all the other things that come from Redmond. I don't like Apple.

Last year I bought an iPhone. I just couldn't help myself. I've had many Windows Mobile devices from iPaqs to XDAs and they suck. Big time. The iPhone came along and it just wiped the floor with anything out there, so I had to get one. I love it!

Months on, and I've released an Xbox game called Jungle Blocks using XNA. The whole process was pretty awesome. I got to write it in Visual Studio using C# and for very little money my game was out there being played by other people. They were paying money to play my game. That was a cool feeling!

Then my mind started to wonder... Maybe I should dabble in iPhone development? I could release iJungle Blocks! (Ok, maybe I won't call it that). In a lot of ways the App Store seems to work very similar to XNA and the Indie Games and since I'd already filled in all the forms and got an ITIN I figured I didn't have much to lose trying.

Well, except my pride. It turns out that Mr Jobs doesn't want you making money from his iPhone if you don't have his computer. You can only develop for the iPhone on a Mac (legally). This was a bummer. Macs stink. They won't do .NET and they certainly don't do Visual Studio. It was time to do some research!

I started browsing the web and speaking to a few people to find out what coding on a Mac would be. This is what I found out:

  • The cheapest new Intel Mac is £500
  • Xcode (the Mac IDE) is crap. It does not have all the features of Visual Studio 2008 :(
  • Objective-C is verbose and long-winded. There is no Garbage Collection!
  • All my friends will laugh and point if I buy a Mac

Things were looking grim, but I decided to go nuts. This week, I bought a Mac Mini. After a few hours I discovered a few more things:

  • Mac keyboards suck. Thankfully my Microsoft Keyboard/mouse works :)
  • I can't type " @ or #. They're just mapped wrong.
  • The Mouse on a Mac starts slow and then accelerates veryquickly. It's a pain in the ass.
  • Alt+Tab is Windows+Tab. Ctrl+C is Windows+C. etc. This is madness!
  • The Home and End keys don't work as expected. Neither do Ctrl+Left or Ctrl+Right.

I got Xcode installed and started playing around to see how bad this thing was. After a few nights of wrestling with Xcode, Objective-C, Cocoa-Touch and Mac OSX here's what I've found out:

  • Xcode is not crap. There's still time, but Xcode is not frustrating the hell out of me like I thought it would. It's not all that bad. Nowhere near as bad as some of the crap I've had to use (I'm looking at you, FlexBuilder). I might just get on with it!
  • Microsoft have Mac drivers for my Microsoft Keyboard and mouse. They not only fix the crazy mouse acceleration, it includes a proper mapping to fix " @ and #!
  • Even on the highest setting, the mouse still moves too slow on a Mac. The max setting on a Mac doesn't come close to the Max setting on a PC.
  • Cocoa-Touch is actually really nice :)
  • There is no nice fix for Alt+Tab. I can swap Windows/Alt keys, but then Copy/Paste becomes Alt+C/Alt+V instead of Windows+C/Windows+V.
  • These is seemingly no fix for Home/End/Ctrl+Left/Ctrl+Right

So far, things are not as bad as I imagined. And the Mac does have some nice stuff. But will it tempt me away from the lovely world of Visual Studio and C#? Unlikely. It's not as bad as I expected it to be, but it's just not the same experience as developing on a PC.


Using iPod with Windows Media Player instead of iTunes

Up until recently, I've never had an iPod. It wasn't that I didn't like them - I think they're the best looking MP3 players out there. There was one reason, and one reason only that I hadn't bought one - iTunes. On Windows, and it has to be amongst the clunkiest applications from a major software company I've ever used. I'm not sure if it's because of the desire to make it look like a Mac and custom-draw everything, or just sloppy coding. It just always seems clunky and unresponsive, and hogs machine resources.

To make things worse, Apple started telling people not to upgrade to Vista because iTunes didn't work properly on it. WTF! Apple had how long to sort this out? You can't just tell people not to upgrade their operating system because you failed at meeting the deadline for your music player! (I do see this has since been fixed).

Anyway, back to the point. What stopped me buying an iPod was iTunes. The software is nasty, and I already have my music collection in Windows Media Player, which plays nice with Windows Media Center and my Xbox 360. If Apple made the iPod work with Windows Media Player, I'd have bought one. Assuming there are other people like me, Apple are losing potential business by trying to force people on to iTunes. I found there were a few ways to get Windows Media Player to work with the iPod, but it required 3rd party plugins (and cost money), and I wasn't about to buy an iPod to find these solutions aren't stable.

As fate would have it, I received a Blue 4GB iPod nano from my auntie when she was visiting from the states. The whole idea of not wanting to buy one in case it didn't work was squashed. I had an iPod, and I was going to use it, with or without Windows Media Player support!

When I got home, I downloaded a trial of MGTEK dopisp - one of the plugins claiming to get the iPod working with Windows Media Player. There are a few other plugins to do this, but a quick Google revealed less unhappy people using this one! I installed the plugin, connected my iPod, and fired up Windows Media Player.

Error! I was greeted with a dialog telling my my iPod had never been set up (via iTunes) and couldn't be used. I had a feeling this would happen, and luckily I had a laptop running Windows XP I was about to flatten! I installed iTunes and set up the iPod, then tried again. The iPod now appeared (with the name I assigned in iTunes) in Windows Media Player as a mobile device. I grabbed a few songs and tried to sync. It worked. It worked exactly like I wanted it to. It was that easy.

That makes me wonder why Apple didn't write a similar plugin? I understand they really want people to use iTunes, but is it really worth losing iPod sales over? Forcing people to use your software is not the way to do business. Sell your iPod on what it is. Sell iTunes on what it is. If people just want one, let them have it. You're lucky I received an iPod as a present, because you'd have missed out on this sale without native Windows Media Player support.