Extracting information from a webservice

Linus Torvalds torvalds at linux-foundation.org
Thu Jan 17 14:20:16 PST 2013


On Thu, Jan 17, 2013 at 1:33 PM, Aurélien PRALONG
<aurelien.pralong at gmail.com> wrote:
>
> I didn't see that Pierre did so many work on the web-service, so I did a
> stub WS in java to start adding new features to the companion (such as
> history and registering from the mobile app directly). I obtained quite the
> same API, except from these points :
> I used only one URI for dive parts:
>    - GET /api/dive/{ID} to retrieve someone dives
>    - PUT /api/dive/{ID} to add a dive (data is inside the HTTP content)
>    - GET /api/user/{email} to get user ID from email
>    - PUT /api/user/ to create a user (data is inside the HTTP content)

Hmm.

So at least judging by how I use my phone while diving, I can very
honestly say "I avoid using it". I've used it to write notes for the
dive site name, and to manually get the GPS information, but there
have also been many dives where I simply haven't bothered, because
it's been too inconvenient to go dig out my phone from my drybag.

Which leads me to believe that at least *one* usage model for the
companion app would be the "totally hands-off" one.

For that kind of model, I think the best interface would be to just
log the GPS location by date every fifteen minutes. Nothing else. No
name, no nothing. Just GPS location and local time/date.

If subsurface could then just look up the GPS information by that date
(which it has from the dive computer), that would be very convenient.
You could start the subsurface companion app in the morning as you
prepare to go diving, and just leave it running the whole day. No need
to ever even input any dive data at all.

So I think it would be lovely to have "anonoymous" data too, ie dives
without any name information (because the user never gave one).

Because if you forgot to enter the name into the companion app, it's
usually possible to try to figure that out later. But if you don't
have the GPS information, and you were on a boat somewhere, that can
be hard to get after-the-fact. So the whole "continuously save gps
data even if you have no user interaction" sounds like a good thing.
And "every 15 minutes" (or even every 30 minutes - maybe make it
configurable) should save battery life while still giving enough
granularity that any real dive will be happily saved.

Of course, if you're like Dirk, and take your phone with you
underwater in your drysuit, it's going to have a hard time getting a
GPS lock. So it's not foolproof.

                    Linus


More information about the subsurface mailing list