![]() |
Can't stop Coordinates from updating Hi Everyone, I'm kind of relearning java as I go along here, so please excuse any unconventional coding practices, but feel free to point them out to me, I haven’t used java in many years :? I wanted to play around with GPS on my blackberry 8830 from Verizon. So I bought at BT GPS puck and everything is good there. I'm trying to modify the GPSDemo project that came with the JDE. I stripped out the stuff that I didn't need, server connection, waypoints, etc... All I want to accomplish is for the program to show the current position as I move and the speed. This is working already and was left over from the original app. I also want to be able to mark a point, then move a bit and mark a second point and get the distance between the 2 points. This is where I'm having trouble. The program is returning the GPS info just fine and every time it sends some data I'm storing it in Location object called currentLocation. When I click on a menu option, it should set the first point and when I click again, it should set the second point. Instead, after I set the first point, it keeps changing when new GPS info comes in and when I set point 2, it does the same thing. Both points are constantly synchronized to the currentLocation. Code: //global veriables to store GPS data |
Made the same mistake when I started. The Location API is giving you a reference to an internal object. You need to make a new one to store the values: loc1 = new QualifiedCoordinates(currentLocation.getQualifiedC oordinates().getLatitude(), ...); Tedious but it works. If someone has a better way I would like to see it as well. |
Thanks hrbuckley, I figured it had to be something like that. I'll give it a try, but I suspect it's going to work. |
| All times are GMT -5. The time now is 02:42 AM. |
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.