It took me more then an hour to get my certs working for publication (painful). I could code something that gave you a random answer in about the same amount of time. Really depends on what features you want it to do.

I can make a button respond to touch input and give you a random answer in about 10 minutes. However I have never worked with shaking the iPhone or anything like that, you can see how things become complex.

There are several free 8 ball apps on the store right now that all seem to behave slightly differently. The short answer is not long, the long answer is depends on how you want it to act.