iPhone location games like Foursquare and Gowalla have one big drawback - you can't run them in the background. To "check in" at a location, you have to pull your phone out, connect to the Web, and then let the app do its thing.
But a new entrant to the space, Stalqer, has managed to sneakily hack the iPhone's email systems so that it can record you and your friends' locations in the background. The iPhone doesn't allow third-party apps to run in the background, so it's quite a feat that Stalqer has managed.
Here's how it works. The app sets up a secret email account on your device, and then monitors the iPhone's autocheck function. When it looks for new messages, the service inspects the POP or IMAP handshake, and particularly the IP address. That happens, apparently, every 15 minutes or so and the app then gets a location point.
There's also the option to check in manually on a Google map, and see your friends' locations. You can tie in your Facebook account, too, so that you can see where any friends who are also running the app are. Quite smartly, Stalqer can also show the location of friends who aren't signed up, grabbing public information off their profile like "City".
As you can imagine, the app comes with a plethora of privacy settings that give you fine-grained control over exactly who gets to see your location and when. Stalqer isn't monetized just yet - the company wants to see if people will go for it. It's not quite available yet, but has been submitted to Apple and you can sign up for an email when it's available.