0

i'm trying my first android app and it should track my route with gps coorinates. The app also has a five textboxes, each with about 30 chars user can type in. Coordinates should be saved all 30/60 seconds, is this enough? Or is it possible to save it with 10 seconds and what's the right way to save it? Thought about reading xml from url, but I think it could be more data in future. What could be a good way to store it on sd as XML or normal file locally, which I can parse from client-pc to retrieve coordinates?

Thanks for your time. Best Regards

3
  • Consider the speed of the host, and the accuracy required when reconstructing the path. If you're walking, a sample every 30 seconds might be fine, but if you're in a car, you might want to sample faster. Also, I'd suggest XML, and I'd recommend looking up the GPX format, that would give you portability as well, because other programs will understand it and allow import/export. Commented Nov 25, 2012 at 19:57
  • ok that seems best solution for me. thanks to others for suggestions. Regards Commented Nov 25, 2012 at 20:13
  • In that case I'll make an answer out of it! Commented Nov 25, 2012 at 20:34

3 Answers 3

2

You should only save a position if it's far enough away from the previous position. That way you'll have way less data without losing any information (in other words - it doesn't help to save the same position every 10 seconds).

In my sports tracker app, I save the data in a database table (latitude, longitude, timestamp ... basically all you get in the Location object).

Sign up to request clarification or add additional context in comments.

Comments

1

XML would work but the performance would dramatically decrease as the amount of data in your file increases. I had a similar project a year ago and I used a SQLite database.

The period you want to use depends on your needs, getting a location every 10 secs might be a lot, you might want to adapt the period to the speed or the area (city or highway). You can also rely on 3g (network instead of GPS) to get accurate, quicker and cheaper (in terms of battery) location fixes in dense areas (cities)

2 Comments

thanks for your answer, I thought about using sql db too, but I'm able to connect to database from client win 7 pc directly? If not I've to make some export button on android app which creates xml file on sd and then parsing with desktop app.I'm right?
You can't access the file directly on your phone from a pc, you could just copy your .db file to your sd or have it emailed and open it using a desktop client.
0

Consider the speed of the host, and the accuracy required when reconstructing the path. If you're walking, a sample every 30 seconds might be fine, but if you're in a car, you might want to sample faster. Also, I'd suggest XML, and I'd recommend looking up the GPX format, that would give you portability as well, because other programs will understand it and allow import/export.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.