cgeo: Offline map opens slower if activity history is long

Describe your problem!

Today I had a day off and went caching spontaneously driving from cache to cache. After a while I noticed, that when “mapping a cache” it took some seconds for the map to show up. It got worse and worse over the day.

Back home I tried again and realized, that I could use the back key of my device quite a lot of time iterating over several map activites until finally reaching the state “press again to exit”.

Once I did this opening the cache map was fast again.

How to reproduce?

I tried again to open list, home, map, cache, back to list, and so on and could (kind of) reproduce, that opening the map for a cache or even the “normal” map got slower to start again.

Actual result after these steps?

If you have such long activity history, open the details of a cache and then long-click the compass rose to open the map for the cache. The activity itself opens fast but it takes 2-3 seconds until map and objects are loaded.

Expected result after these steps?

There is no crash involved, everything worked fine throughout the day (else the activity stack would have been shorter 😉 ), but I guess we should limit the activity history somehow and/or find out if several open maps block/slow down something and whether this is avoidable.

Additionally: IMHO it makes no sense to keep a real long activity history. Do we have set a limit for that?

Reproducible

Yes

c:geo Version

2022.02.26-NB

System information

Android 12, Samsung S20

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (18 by maintainers)

Commits related to this issue

Most upvoted comments

IMHO the second (or my third variant) is the way to go, as there was quite some feedback at the beginning that the bottom navigation together with direct exit was not intuitive enough. But let’s try our voting system once again:

What shall happen then:

  1. Toast is shown “Press again to exit c:geo” and another time back key will leave the app directly from map

-> Vote with “party” (🎉)

  1. As the activity history is empty the user will fall back to the dashboard (signalling, that he reached the end of the history) and he would need another two times back to exit the app

-> Vote with “rocket” (🚀)

Or my personal idea / my favorite:

  1. As the activity history is empty the user will fall back to the dashboard. However, no “Press again to exit” is shown so another time back key will exit c:geo directly. (Similar to pre-bottomnav behavior)

-> Vote with “heart” (❤️)

Maybe it would indeed be worth a try to reset the activity stack once the user actively uses the bottom navigation. Use cases like mapping a list and returning to the list would then still work. We could test the usability in our nightlies. Not sure if there are other relevant use cases across different bottom nav activities, but I guess the bottom nav itself would be the “replacement” of the back action in such cases anyway.

So the functionality would be:

  • The activity history starts once the user taps on a bottom navigation element and builds up from there (e.g. Lists - Map of list or Search - result list - map of list) with the ability to use the back key to navigate back through those
  • Once the user uses the bottom nav to start another “main” activity the above mentioned history shall be removed and starts with the new activity as basis

Not sure though if the last activity in stack could/should always be the dashboard, e.g. the following example:

  • User is on lists
  • User selects “Map” from bottom nav
  • User presses back key

What shall happen then:

  1. Toast is shown “Press again to exit c:geo” and another time back key will leave the app directly from map
  2. As the activity history is empty the user will fall back to the dashboard (signalling, that he reached the end of the history) and he would need another two times back to exit the app