organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
9.79k stars 939 forks source link

[android] Warn users about slow SD cards that may make impression that OM is "slow" #6637

Open biodranik opened 11 months ago

biodranik commented 11 months ago

We see complaints from many reviews that OM is "slow" on Android devices with SD cards. Unfortunately, storing maps on SD is almost always slower than storing maps in the internal device memory. Not only SD cards may be slow themselves, but also recent Android 11 and above changes have significantly slowed down reading SD card contents.

The idea is to detect when users are using an SD card (or even better - a slower SD card), and show an appropriate warning message at the right time (not an annoying one), something like this:

You are storing maps on an SD card. If Organic Maps works slower than you expect, try to store maps in the internal memory, or try to use a newer/faster SD card.

CC @oleg-pah

oleg-rswll commented 11 months ago

Criteria

biodranik commented 11 months ago

@oleg-pah always showing that message for any SD-card, without considering how slow is it, may be overkill. 80-90% of Android users will see the dialog then.

oleg-rswll commented 11 months ago

@biodranik Is the 80-90% statistic about using SD cards or about using SD cards for Organic Maps? The requirement is about determining if Organic Maps is using an SD card. Of course the ideal solution would be even more narrow, in addition to those, determine if the SD card is actually slow. But there are potentially challenges with that across different hardware, and measuring speed is notoriously unreliable.

biodranik commented 11 months ago

We need to approach this issue in the right way and show dialog only when it is really necessary. Otherwise, it will be an unnecessary noise that distracts users.

arjundevasi commented 10 months ago

for android: the message should be displayed when the user starts the downloading of map. maybe in 'DownloadResourcesLegacyActivity -> prepareFilesDownload()' method and also and also when user clicks download in MwmActivity ?

oleg-rswll commented 10 months ago

for android: the message should be displayed when the user starts the downloading of map. maybe in 'DownloadResourcesLegacyActivity -> prepareFilesDownload()' method and also and also when user clicks download in MwmActivity ?

@arjundevasi this is a great point, will update.

NetLamp-Y commented 10 months ago

@biodranik Is the 80-90% statistic about using SD cards or about using SD cards for Organic Maps? The requirement is about determining if Organic Maps is using an SD card. Of course the ideal solution would be even more narrow, in addition to those, determine if the SD card is actually slow. But there are potentially challenges with that across different hardware, and measuring speed is notoriously unreliable.

Would it make sense to check how long a common task takes (like displaying / loading a portion of the map, rather than trying to check SD card speed by itself), and to only show the dialog when that time is above a specific threshold? This way, it would only show if the app actually behaves noticeably slowly, and we would not have to check if the card itself is slow. This approach should also work across all hardware.

biodranik commented 10 months ago

That is the idea. Now we need to find a way to detect that the app works slowly. But the suggestion should be valid: if the internal memory is also slow for any reason, then moving maps won't improve the situation.

arjundevasi commented 10 months ago

one way to find is to manually find "read/write" speed. we can create a new file and then "read/write" that file to calculate time taken .

NetLamp-Y commented 10 months ago

Having thought about this issue, I think the main idea here (showing a dialog to inform users) is the wrong one. Reasons:

I would suggest the following instead:

Doing it this way would solve two of the three issues mentioned with the dialog, and it would put far less pressure on the accuracy of performance measurement. That being said, having a system to measure app / storage performance would still be good, if only so contributors can check if their changes improve or worsen performance. I don't know if this exists already.

oleg-rswll commented 10 months ago

A performance settings can be a good idea, maybe we can have a separate issue for that.

Unnecessary messages definitely don't provide a good experience. Context-appropriate messages are typically quite useful. If a person is doing something that can cause slowness (for example downloading maps to a slow SD card), it's better to let them know early and avoid this problem, rather than experience slowness and then try to resolve it.

biodranik commented 10 months ago

More context: we are not interested in write speed (it can be slow, but users are mostly ok with longer downloads, and in many cases, the card write speed will be faster than the user's internet download speed). We are interested in read speed. OM is fast on faster memory storage. But it is slow on some slow SD cards. We don't even know the uninstall rate caused by this.

Some more details:

oleg-rswll commented 10 months ago

On first startup, if SD card storage has more space, do a speed test of data read to determine if it's fast enough. If it is, use SD card for storage, if not, select internal storage.

biodranik commented 10 months ago

Do you propose to postpone the first application startup/initialization in favor of testing the speed of the SD card? The slower startup will worsen the first user impression.

oleg-rswll commented 10 months ago

The test shouldn't take more that 1-2 seconds. If a quick and effective test can't be developed, then instead have the download select internal memory by default, while the test of the card happens. If then the test finds the card is fast enough, the map can be moved from internal memory to SD card.

biodranik commented 10 months ago

No delays on the startup, please. It is one of the most important metrics for good products: https://developer.android.com/topic/performance/vitals/launch-time

oleg-rswll commented 10 months ago

As mentioned in last post, there is a way to do a speed test and add zero time to startup.

Would be helpful to know the current first start time.

biodranik commented 10 months ago

This issue is not as important to slow down the startup for everyone even for a half a second. Every app and website fights for the fastest startup to attract users.

The only acceptable approach is to do it in parallel, without slowing down the app startup.