3 ms·
This is very interesting- I am developing a webapp that allows you to track other people's taxi journeys, and right now I'm AJAX polling every 30 seconds becuas
by untog 15y ago
This is very interesting- I am developing a webapp that allows you to track other people's taxi journeys, and right now I'm AJAX polling every 30 seconds becuase I figured WebSockets would be too intensive on a phone (open connection = drained battery).
Does anyone know if this would also end up with an open connection the whole time?
- jiggy2011 15y agoI would imagine it is using stream sockets , so yes (unless it's really just doing polling in the background). What we really need is some way of doing UDP via javascript, this would enable many things. EDIT: Why would I want someone else able to track my taxi journey?
- untog 15y agoWith regard to your edit: so that they know where you are, essentially. There's a social aspect ("when are you getting to the bar?") as well as a safety one (travelling late at night, someone will always know where you are). There's also some interesting benefits from my POV- it's effectively returning live data on the average mph on every street in the city. Relies on getting a decent number of users before being useful of course, but still. Gratuitous plug for the site with more info: http://www.taxono.my/ http://www.taxono.my/
- gtaylor 15y agoWouldn't Google Latitude do this, already?
- untog 15y agoTo an extent, yes. But my app also sends over details like where the person is going to, which AFAIK Latitude doesn't do. The app also lets you search for destinations, gives you a time and fare estimate, split the total between friends, review your cab ride... while the tracking stuff is a central feature, it isn't the only one.
- simpsond 15y agoSSE creates a persistent connection. On disconnect, the client will automatically attempt to reconnect.
- chc 15y agoDoes an open connection with no data flowing really use more battery? I would imagine a 30-second polling interval is still frequent enough to keep the antenna in high-power mode, so it wouldn't make much of a difference. Have you found that not to be the case?
- untog 15y agoTo be honest, I haven't been able to run any kind of reliable test, I was just working on "common knowledge". Testing battery drain is, by it's nature, a kind of time-consuming exercise. Given that it's a relatively small piece of functionality I just haven't gotten around to it yet.