Thursday, June 9, 2011

To the Left, to the Left

This week has been the equivalent of jumping into a very large pool full of code-I-do-not-understand, if such a thing were possible.

But never fear, I'm learning how to swim (though there were several near-drowning experiences earlier in the week).

We've begun to build our Android code from scratch, in a haphazard sort of way. None of the undergrads in my research team have any experience coding Android applications, so we've all been assigning pseudo-tasks to each other, then wandering off and familiarizing ourselves with all things Android, some related to our tasks, some not. At least, that's what I've been doing.

I've been attempting to figure out how to work with the GPS in Android phones. I made a small application that has a preset course, tells the user their current GPS coordinates every few seconds, and tells them the next destination they should go to once they reach a waypoint in the course. Well, theoretically. After a few days, all I've managed to do is
  1. Create a program that doesn't crash once asked to do something (anything).
  2. Make it print out text... without crashing... a wild success! (I'm a noob, I know)
  3. Recognize and alert the user as to their current location
At least I accomplished that last task, so I've basically achieved what needs to be done for now (/self-confidence booster). Along with the above, I've also written an algorithm that takes the bearings of the user and the path of shortest distance to the next waypoint, and decides whether to turn left or right to adjust direction. It sounds rather simple (it probably is) but, sadly, it took me quite a bit of scribbling and staring to come up with the algorithm (which is about 4 lines long... eh). But for the record, if it works, I believe it'll be better than the turn algorithm used in the previous version of this project, which I'm not sure even works correctly anyway.

Again, success.


Now, I'm working to implement all of what I've learned (the few shreds of knowledge) into our official Android code. Should be interesting.

Until we meet again!

No comments:

Post a Comment