Yet Another Programming Blog Rotating Header Image

Android, NetBeans, and the Assets directory

Working on an Android app this week, I wanted to add some resources in the assets directory for use in a WebView as described in the SDK docs. I loaded up my project in NetBeans with the cool nbandroid NetBeans plugin for Android development. I built the application, loaded it up in the WebView, and… File not found?

I found a few posts about WebView being unable to open local files, and the need to use a ContentProvider to get around the limitation. Tried that, no luck. So, I eventually expanded the .apk and…  No assets?

Continue reading →

Introducing YetiUp!

Ever since I signed up for Facebook a few months ago I’ve been bummed that their ‘Mobile’ application doesn’t support my carrier (T-Mobile). Since I’ve got a pretty basic phone (Nokia 6133), I couldn’t install a Facebook application on the device either. (For those not familiar with it, their Mobile app allows you to upload photos, update your status and more from your phone)

Since I’d been meaning to experiment with the Facebook APIs anyway, I built an application that lets me do the basics from my phone. This is something that can be used by anyone with a camera phone, on pretty much any carrier (worldwide!).

Presenting YetiUp! a simple application that lets you easily upload your camera phone pictures to a photo album on Facebook.

It is built using the excellent (though lacking in documentation) Facebooker rails plugin, deployed to Dreamhost.

My wife & I have already uploaded several photos that were previously just confined to our phones.

If you end up using the application, I’d love to hear your feedback!

Sinatra on Dreamhost

EDIT 2: My patch to the Sinatra Book has been accepted. The instructions below can now be found in the book itself.

EDIT : I’ve created a page on the dreamhost wiki that includes this information.

There is a lot of good information on how to run Sinatra on Dreamhost, but after following all the excellent advice, I still ended up with Passenger failing to start with the following error :

can’t activate rack (>= 0.9.1, < 1.0, runtime), already activated rack-0.4.0

Luckily, the solution was pretty easy.

Continue reading →

Running IE on your Mac in VirtualBox (for free!) revisited

I’ve been developing a few rails applications recently and wanted to test them in IE. A quick google search turned up this excellent article. While that writeup (and its comments) has some excellent content, it is a little dated. Thanks to advances in VirtualBox, I was also able to reduce the number of steps required.

This procedure still isn’t for the tech savvy. You will encounter a Windows blue screen of death for example, and have to use the command prompt, but hopefully it’ll be worth it in the end.

What I wanted to achieve is the ability to test my site using licensed versions of IE6, IE7 & IE8, on my Mac, for free. As it turns out, Microsoft supplies free VirtualPC images “for testing websites with different IE versions on Windows XP SP2, Windows XP SP3 and Windows Vista”. Sweet!. Continue reading →

Receiving emails in Rails using Gmail & IMAP, while staying efficient and RESTful.

For a recent project I had a need to receive emails (actually MMSs, but that’ll be the subject of a future post) in a Rails application. My requirements for the solution were:

  1. Shouldn’t require root access: I’m deploying this app to a shared hosting service on which I don’t have root.
  2. Shouldn’t require firing up the Rails stack for every incoming email: A number of the solutions I came across use this method. Seems awfully inefficient, especially if you expect to receive lots of messages. Since I’ve already got a running rails application, why not just create a new service/controller in it?
  3. Can be scheduled to run automatically: Pretty obvious. I want to be able to retrieve messages periodically.

There is already a lot of information out there on how to achieve parts of these requirements, including the Rails wiki, Rails Tips and Craig’s writeup. My solution is really just piecing together bits of each. Here’s a high level overview of the components in my solution :

High level overview of components and desired interaction

High level overview of components and desired interaction

Continue reading →

Does the iPhone support…?

I recently got stuck in really bad traffic on 520 on my way to work. Bored, and moving at exactly 0 MPH, I sent my boss a picture message of the parking lot the bridge had become as a way of telling him I’d be late. When I got to work, I discovered that his phone didn’t actually receive the picture! He did get a message from me, but absent the photo. What’s this you say? A phone that is incapable of receiving an MMS? It is 2009 after all! What kind of back assward phone does he have? Wait for it.. wait for it.. an iPhone of course!

Did you know the iPhone doesn’t support MMS? I didn’t until this incident. It doesn’t support copy & paste either! I love me some apple action (all 3 computers in this house are Macs), but come on Apple! Pretty basic features don’t ya think?

Short story long, that is what inspired me to create :

Does the iPhone support MMS? : http://doestheiphonesupportmmsyet.com/

Does the iPhone support copy & paste? : http://doestheiphonesupportcopyandpasteyet.com/

Enjoy!