paoservis / osmtracker-android

Automatically exported from code.google.com/p/osmtracker-android
GNU General Public License v3.0
0 stars 0 forks source link

minimize usage of the internal phone storage #133

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. record multiple tracks
2. check 'Settings>Applications>Manage applications>All>OSMTracker
3. Data can get really large

What is the expected output? What do you see instead?
If a SD card is present all data should be saved to SD card and only a minimum 
to the phones internal storage.

optional OSMTracker could show/state the current memory consumption.

I've made ~50 tracks during 2 weeks wich accumulated ~9MB. Based on the 
settings page I've assumed that this was 9MB of my limited internal phone 
storage.

What version of the product are you using (See "About" screen)?
v0.5.3

Make/model of your device, and Android version?
HTC Desire

Please provide any additional information below.

Original issue reported on code.google.com by sebastia...@gmail.com on 31 May 2011 at 12:33

GoogleCodeExporter commented 9 years ago
Hi,

Tracks are stored in a SQLLite database on the phone for a number of reasons 
including efficient storage of track and way points and reduces the possibility 
of losing tracks if the application crashes for some reason.

The track listing allows you to export your tracks to gpx file format on your 
SD card. You can reduce usage of internal storage while preserving your tracks 
by exporting the track to a file and then deleting the track in the Database.

Use the following process:
1. In the track manager list, long press on a track
2. A pop up menu appears. Choose the option 'Export as GPX' or an equivalent 
option if you are using a non-English language
3. The application will write the data for that track to a file on your SD card 
and display a progress dialog until it is complete
4. Once the file export is complete, you can delete the track from the list 
using the 'Delete' option in the long press menu.

By default, gpx files are written to a location under /osmtracker on your SD 
card. You can edit the location in the OSMTracker settings.

Note that once you have delete a track from the list you will no longer be able 
to interact with that track from within OSMTracker. You can access the GPX file 
on your SD card and, for example, copy it to your laptop/desktop so you can 
upload them to OpenStreetMap.org or use them as underlays for map generation 
using the OpenStreetMap tools.

- Paul.

Original comment by oshea.p...@gmail.com on 6 Jun 2011 at 2:10

GoogleCodeExporter commented 9 years ago
Hi,

frankly I would suggest that an application should not store ANY data on the 
internal phone storage simply because that storage is volatile and likely to be 
lost when flashing a new rom, even an official one. Most back-up tools need 
super-user access to back up internal data, so thats a difficult option.

I myself have lost recorded tracks even though I did all backups available on 
the standard Samsung Galaxy device. 

OSMTracker is a great app, and it would be good if one could (optionally) 
choose the storage of the data (and the app, btw).

Thanks,

- Udo.

Original comment by uamarw...@googlemail.com on 23 Feb 2012 at 5:59

GoogleCodeExporter commented 9 years ago
Hi, 
Whenever I track my internal memory gets smaller up to 50MB in one day, Now I 
only have less than 140MB left. And that only because I already deleted a lot 
of apps and all tracks in osmtracker. according to "manage application" no app 
uses more than 13MB so I have no idea where out goes, but out has to be either 
osmtracker or osmand. Since my phone is not rooted I can't check it.Is it 
possible, that osmtracker is the reason?
Greetings
Dimitri

Original comment by dimitri....@googlemail.com on 21 Feb 2013 at 1:31

GoogleCodeExporter commented 9 years ago
OSMTracker stores its data in 2 places:
- The phone internal memory for the database (that's what "Manage applications" 
shows you)
- The SD card (or internal storage if you don't have a SD card) for exported 
tracks and media (audio recording, map tiles). They should be in a folder name 
"osmtracker" or similar.

That's the only places where OSMTracker puts data.

Original comment by nicolas@guillaumin.me on 21 Feb 2013 at 5:24

GoogleCodeExporter commented 9 years ago
After my first comment I didn't tracked for some days.This morning I had 141MB 
free, then I tracked 3h with osmtrscker and the memory went down to 123MB. I 
stored the track on the sd card and transferred it to osm, then I deleted it. 
But the free internal memory stayed at 123. So it looks like deleting tracks 
doesn't free the memory. What can I do? I urgently need a way to clear that 
database.
Greetings
Dimitri

Original comment by dimitri....@googlemail.com on 25 Feb 2013 at 5:08

GoogleCodeExporter commented 9 years ago
Are we talking about phone storage space here, or memory (RAM) ? How do you get 
those numbers (141 / 123) ?

Original comment by nicolas@guillaumin.me on 25 Feb 2013 at 6:48

GoogleCodeExporter commented 9 years ago
We are taking phone memory. The numbers I got from"manage applications" as you 
mentioned in #4

Original comment by dimitri....@googlemail.com on 25 Feb 2013 at 10:42

GoogleCodeExporter commented 9 years ago
Hm unfortunately I think it will depend on the Android version what's shown in 
this screen. I guess a screenshot might be useful.

If we're talking about RAM, then I wouldn't surprise for the app to use 20MB as 
you suggested while it's running, however killing it (with a task manager) 
should free up this memory.

If we're talking about phone storage (whether internal, or external on SD card) 
then I wouldn't expect a track to take 20MB (excluding any audio recording or 
pictures). Trackpoints are only entries in a database so it shouldn't take that 
much space (although it's difficult to give hard numbers without a thorough 
investigation).

Unfortunately there's not much that I can do: I'm not using any extra storage 
space or anything like that, I just use the default Android API to interact 
with the database ("store me this line in this database table") so there's 
nothing we can save here.

Original comment by nicolas@guillaumin.me on 25 Feb 2013 at 11:23

GoogleCodeExporter commented 9 years ago
The problem is not how you save the data, it is how you delete it. And once 
more we are talking internal our phone memory, not ram or sd-card. I'm not able 
to install, any app because android thinks that 12_MB us not enough. So I can't 
update osmtracker even if you find the error.
If you still don't negligee it and if you have a rooted phone then just try 
this:
1) check the size of the folder where sql stores the data
2) track a few hours with osmtracker
3) check the size again
4) export the file as gpx
5) upload it to osm
6) check the size again
If the sizes in 1 and 6 differ significantly you know, that you don't free the 
memory if out doesn't it might be a problem in 5) as far as I know you first 
export the file before sending it. Where do you export out to? Do you delete it 
later? The exported gpx is 2.5MB which is much less than the 18MB so I suppose 
it is sql
Greetings
Dimitri

Original comment by dimitri....@googlemail.com on 25 Feb 2013 at 12:57

GoogleCodeExporter commented 9 years ago
Now that's interesting, what is the SQL filesize difference between 1 and 3 ?

When you export the track the only thing that happens is that it creates a .gpx 
file on your SD card. The database is still there and untouched, nothing is 
automatically deleted. If you want to free up space you have to explicitly 
delete the track in the app, that's the only way to delete from the database.

Note that deleting might not be enough, triggering a VACUUM SQLite command 
might be required but that would have to be added in the OSMTracker code.

As a workaround deleting the SQLite file might help (but you'll lose all your 
tracks).

Original comment by nicolas@guillaumin.me on 25 Feb 2013 at 10:19

GoogleCodeExporter commented 9 years ago
The difference in sql file size between step 1 and 3 would be the amount of 
space it takes sql to stripe the track. If you read my postings again you see 
that I tolled you a few times already that I deleted the tracks, actually I 
have no track left. But at least you found out what to do add the vacuum 
command. How can I delete the sql file as you recommend without having rooted 
the phone. And if I root it what file do I need to delete exactly?
Dimitri

Original comment by dimitri....@googlemail.com on 26 Feb 2013 at 1:44

GoogleCodeExporter commented 9 years ago
Sorry I understood that you had rooted your phone that's why I was asking for 
the file size difference.

If you root it then I guess you could run the VACUUM command on the SQLite file 
instead of deleting it. I'm not sure of the exact location off hands but it 
should be in something like 
/data/data/me.guillaumin.android.osmtracker/databases/osmtracker.db or 
something.

Note that deleting/re-installing and re-installing the app. would have the same 
effect as deleting the file (you'll lose all the data anyway) so that might be 
simpler than rooting, especially since you've already deleted all the tracks.

Original comment by nicolas@guillaumin.me on 26 Feb 2013 at 5:36

GoogleCodeExporter commented 9 years ago
Hm http://sqlite.org/lang_vacuum.html says: "This means that when VACUUMing a 
database, as much as twice the size of the original database file is required 
in free disk space."

So maybe that's not a good idea to use VACUUM where there's already a shortage 
of space...

Original comment by nicolas@guillaumin.me on 26 Feb 2013 at 5:50

GoogleCodeExporter commented 9 years ago
Uninstalling osmtracker brought me 2MB. This wasn't the solution. Of my phone 
would be rooted I had solved the problem for a long time. I'll tour out as soon 
as I return home porn friday
Dimitri

Original comment by dimitri....@googlemail.com on 26 Feb 2013 at 6:04

GoogleCodeExporter commented 9 years ago
If uninstalling the app. only remove 2MB it means that your storage space 
issues are coming from elsewhere and are unrelated to OSMTracker.
When the app. is uninstalled everything is deleted including the database 
(except the manual exports you might have done on the SD Card of course).

Original comment by nicolas@guillaumin.me on 26 Feb 2013 at 6:22

GoogleCodeExporter commented 9 years ago
I'll go back home in 2 days, then I'll root my phone, then I can tell you 
hopefully what takes up all that memory. 
Until then
Dimitri

Original comment by dimitri....@googlemail.com on 26 Feb 2013 at 11:53

GoogleCodeExporter commented 9 years ago
Hi,
it´s done, I rooted the phone and found 1.4GB in /data/gps/SensorAiding in 
17199 files. The newest File is from feb 28, so after I uninstalled osmtracker. 
But the last big Files (4MB and 10MB are from Feb 25, so the day I last used 
osmtracker. Does that makes any sense to you?

Greetings
Dimitri

Original comment by dimitri....@googlemail.com on 3 Mar 2013 at 11:01

GoogleCodeExporter commented 9 years ago
I suspect this data is used by the phone store cell tower / wifi network 
locations to help the GPS get a fix as soon as possible.

In any case it's managed by the OS and OSMTracker doesn't have access to it, I 
think this can be disabled in the GPS settings of the phone.

Original comment by nicolas@guillaumin.me on 3 Mar 2013 at 11:23