Loopt, a location-based social networking service, will be the first third-party iPhone service to work in the background while the app is not running.

Via a deal with AT&T, and with your permission, Loopt will be able to access your location all the time you have a network connection, even when you’re not actively using the iPhone app. (The app isn’t running in the background; it’s working server-to-server.) Loopt cofounder and CEO Sam Altman tells us that it’s been users’ most requested feature.

The basic idea behind Loopt is a map showing where your friends are at the moment, and some other location-based social networking features, like a « who’s nearby » list. But because Apple’s iPhone doesn’t yet support background processing for third-party apps, Loopt ordinarily only knows where you are when you’re actively pinging its servers. That’s not as useful. (And a limitation Loopt doesn’t have to deal with on other platforms.) But that’s changing via this new deal.

It also gives Loopt an advantage over competitors, like Google’s Latitude service, which you must manually activate every time you want to « check in. » Upstart competitor Foursquare also requires you to manually check in, too, but that’s a little different. (Though Loopt, based in Silicon Valley, must watch out for NYC-based Foursquare, which is gaining traction and is about to add a top Loopt feature, the « browse nearby people » feature, which makes flirting easier.)

What’s the point? Always-on, real-time location information is critical for the future of location services, Altman tells us. You’ll be able to get alerts when you’re near a person or place you’re interested in, for example. You can build a « life graph » of all the places you’ve gone, he adds. (Maybe a map for runners?) And — Altman doesn’t say this, but we’re making the next logical step, here — this opens the door to easier location-based advertising, promotions, etc.

Loopt will first offer the new always-on service in a trial for 5,000 users. You can sign up at Loopt’s site using your iPhone’s MobileSafari browser. After the 14-day trial, the always-on feature will cost $3.99 per month, added to your AT&T bill.

When will other apps be able to run in the background without AT&T’s help? That depends how far along Apple is on that project: We’ve heard the company is serious about letting a few apps run in the background. (Palm’s Pre does.) But because that’s not a feature in the new iPhone 3.0 software, it seems it’s still a future project — and might not arrive until next year’s iPhone update — or whenever Apple is ready.