dmbreaker / osmtracker-android

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

Rotating device while a GPX export is running causes export dialog to disappear #98

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Export a (long) track
2. Rotate your phone during the export progress
3. The export dialog doesn't reappear

What is the expected output? What do you see instead?
Dialog export should reappear once the phone is rotated, continuing to update 
the progress status.

It doesn't seem to affect the export that completes successfully and generates 
a valid GPX file.

Original issue reported on code.google.com by nicolas@guillaumin.me on 7 Dec 2010 at 10:27

GoogleCodeExporter commented 9 years ago
There is one side effect of this issue.

Once the export dialog disappears, it is possible for the user to attempt to 
export the track again. If the original export is still running, the export 
threads will attempt to write same file. Most likely, one or other will hit an 
IO exception. This could crash the app.

I've only seen the reorientation issue once.

- Paul.

Original comment by oshea.p...@gmail.com on 30 Dec 2010 at 12:56

GoogleCodeExporter commented 9 years ago
As this cannot be solved by just changing some lines of code (i think - correct 
me if i'm wrong), we should think of rewriting the complete export behavior.

My thoughts are the following:

 * Creating a new Activity for export handling (which then can then handle the dialog):
  * In the first step this won't have any advantages as we currently only support gpx export. We could possibly add some export settings to this like "export to path" (with the path from preferences as default value).
  * In a second step we could provide the user to choose the export target such as "upload to osm" (see issue #43) or "export to kml".

I'm not sure if this will affect usability, as one will need at least two 
clicks to export instead of currently one.

best regards
Matthias

Original comment by matthias...@gmail.com on 30 Dec 2010 at 4:39

GoogleCodeExporter commented 9 years ago
I agree, Adding a new activity for "output related" tasks is probably a good 
idea since it'll help to export to other formats or upload to OSM as you 
suggested.

Original comment by nicolas@guillaumin.me on 3 Jan 2011 at 3:41

GoogleCodeExporter commented 9 years ago
Ok, then I'll give this a try when issue #96 is implemented.

Since this will nearly be a rewrite of the export task, i think i'll also 
implement some parts of issue #97 to increase performance.

best regards
Matthias

Original comment by matthias...@gmail.com on 4 Jan 2011 at 1:10

GoogleCodeExporter commented 9 years ago
In think the main "evil" is that the export takes place in an Activity. Android 
will destroy and re-create Activities when the screen is rotated, thus killing 
the export in progress, because Activities are simply not intended for this 
kind o processing.

The clean way would be to export data in a foreground service, which Android 
will leave in peace (unless resources get very low). The progress bar would 
then go into a Notification (which Android demands with every foreground 
service).

Original comment by mich...@vonglasow.com on 23 Jan 2013 at 10:48

GoogleCodeExporter commented 9 years ago
Agreed that would be the best way to fix it, however that's a fair amount of 
work :)

Original comment by nicolas@guillaumin.me on 25 Jan 2013 at 4:07