If you trust your local transit authority's posted timetables, then you could gather GPS coordinates for bus stops and write an app that correlates the two with your current location and time.
That's the thing - unless you're in Japan, you can't rely on timetables. Otherwise this idea wouldn't make much sense (it would still be cool to amaze your friends with it while waiting for the bus though ;)).