[android] Restore track recorder #1807

Closed
rtsisyk wants to merge 1 commit from rt-android-track-recorder into master
Owner

This reverts commit 2bfb7ffc0b
and adds support for the background location.

Signed-off-by: Roman Tsisyk roman@tsisyk.com

This reverts commit 2bfb7ffc0b1a060cf72d929ffd5d18779553d1aa and adds support for the background location. Signed-off-by: Roman Tsisyk <roman@tsisyk.com>
vng (Migrated from github.com) reviewed 2022-01-08 11:11:22 +00:00
biodranik (Migrated from github.com) reviewed 2022-01-08 13:05:37 +00:00
biodranik (Migrated from github.com) commented 2022-01-08 13:05:37 +00:00

Ненене, это вычистить. И проверить текущие скрипты.

Ненене, это вычистить. И проверить текущие скрипты.
biodranik (Migrated from github.com) reviewed 2022-01-08 13:05:56 +00:00
rtsisyk reviewed 2022-01-08 18:51:52 +00:00
Author
Owner

Это на мастере, я тут не причем.

Это на мастере, я тут не причем.
vng commented 2022-01-08 19:31:06 +00:00 (Migrated from github.com)

Да, видимо мастер с не сгенерированными строчками.

Да, видимо мастер с **не** сгенерированными строчками.
biodranik commented 2022-01-08 20:06:55 +00:00 (Migrated from github.com)

В этом коммите точно не должно быть никаких изменений в строках, кроме тех, которые про треки.

В этом коммите точно не должно быть никаких изменений в строках, кроме тех, которые про треки.
pastk reviewed 2022-01-09 09:18:31 +00:00
Author
Owner

Added background location support and permission dialogs. The TrackRecorder itself is original without any changes.

Added background location support and permission dialogs. The TrackRecorder itself is original without any changes.
biodranik (Migrated from github.com) requested changes 2022-02-12 18:21:17 +00:00
biodranik (Migrated from github.com) commented 2022-02-12 18:07:49 +00:00

Этот паттерн не выкашиваешь?

Этот паттерн не выкашиваешь?
biodranik (Migrated from github.com) commented 2022-02-12 18:12:56 +00:00

Постоянный запуск аларма для записи выглядит адским костылём, несовместимым с батареей.
Читал вот этот тред?

Давай записывать для начала в пассивном режиме, как обсуждали, только от других апп, от системы и свои активные позиции. Пускай будет от системы раз-два в час, для записи следа достаточно.

If background location access is essential for your app, keep in mind that Android preserves device battery life by setting background location limits on devices that run Android 8.0 (API level 26) and higher. On these versions of Android, if your app is running in the background, it can receive location updates only a few times each hour.

Постоянный запуск аларма для записи выглядит адским костылём, несовместимым с батареей. Читал вот этот [тред](https://github.com/osmandapp/Osmand/issues/5632)? Давай записывать для начала в пассивном режиме, как обсуждали, только от других апп, от системы и свои активные позиции. Пускай будет от системы раз-два в час, для записи следа достаточно. > If background location access is essential for your app, keep in mind that Android preserves device battery life by setting background location limits on devices that run Android 8.0 (API level 26) and higher. On these versions of Android, if your app is running in the background, it can receive location updates only a few times each hour.
biodranik (Migrated from github.com) commented 2022-02-12 18:19:40 +00:00

Значит надо запрашивать пермишн заново по клику на "включить трек рекордер". Сейчас же пермишн именно по клику там и запрашивается?

Значит надо запрашивать пермишн заново по клику на "включить трек рекордер". Сейчас же пермишн именно по клику там и запрашивается?
biodranik (Migrated from github.com) commented 2022-02-12 18:21:10 +00:00

Почему теги удалились здесь и ниже? Эти строки используются на ios, надо наоборот добавить сюда и android, если ты их используешь.

Почему теги удалились здесь и ниже? Эти строки используются на ios, надо наоборот добавить сюда и android, если ты их используешь.
rtsisyk reviewed 2022-02-13 12:13:55 +00:00
Author
Owner

Сейчас по клику в настройках всегда проверяется.

Сейчас по клику в настройках всегда проверяется.
rtsisyk reviewed 2022-02-13 12:15:29 +00:00
Author
Owner

Ну вообщем тогда и называть вещи своими именами. Не восстановить track recorder, а написать заново.

Ну вообщем тогда и называть вещи своими именами. Не восстановить track recorder, а написать заново.
biodranik (Migrated from github.com) reviewed 2022-02-13 13:46:20 +00:00
biodranik (Migrated from github.com) commented 2022-02-13 13:46:20 +00:00

Сколько он сейчас жрёт батареи? Проверь, пожалуйста, на нескольких устройствах.

Сколько он сейчас жрёт батареи? Проверь, пожалуйста, на нескольких устройствах.
rtsisyk reviewed 2022-02-15 06:04:54 +00:00
Author
Owner

То есть если надо и на ios и на android, то тэг добавлять надо? Или без тега и так попадает и туда и туда?

То есть если надо и на ios и на android, то тэг добавлять надо? Или без тега и так попадает и туда и туда?
rtsisyk reviewed 2022-02-15 06:05:25 +00:00
Author
Owner

Сейчас он всё равно почему-то в фоне нормально не пишет :( Ну что же, будем дальше копать.

Сейчас он всё равно почему-то в фоне нормально не пишет :( Ну что же, будем дальше копать.
biodranik (Migrated from github.com) reviewed 2022-02-15 08:51:28 +00:00
biodranik (Migrated from github.com) commented 2022-02-15 08:51:28 +00:00

Видимо потому, что лазейку с Alarm прикрыли, она слишком очевидная и жрущая батарею. Давай сделаем по "пассивной" схеме, как я описал. Тем, кто часто смотрит в карту, будет юзабельно.

Видимо потому, что лазейку с Alarm прикрыли, она слишком очевидная и жрущая батарею. Давай сделаем по "пассивной" схеме, как я описал. Тем, кто часто смотрит в карту, будет юзабельно.
biodranik (Migrated from github.com) reviewed 2022-02-15 08:51:51 +00:00
biodranik (Migrated from github.com) commented 2022-02-15 08:51:51 +00:00

И выдаёт запрос, если нет пермишна? Тогда ок.

И выдаёт запрос, если нет пермишна? Тогда ок.
biodranik (Migrated from github.com) reviewed 2022-02-15 08:52:16 +00:00
biodranik (Migrated from github.com) commented 2022-02-15 08:52:16 +00:00

tags = android,ios

tags = android,ios
pastk reviewed 2022-02-15 10:02:31 +00:00

@rtsisyk либо можно запустить "tools/python/clean_strings_txt.py -s" и само расставит

@rtsisyk либо можно запустить "tools/python/clean_strings_txt.py -s" и само расставит
pastk reviewed 2022-02-15 10:04:30 +00:00

@biodranik кстати там из ios похоже много строк было удалено, например
[version]
[telegram]
[feedback_general]

@biodranik кстати там из ios похоже много строк было удалено, например [version] [telegram] [feedback_general]
biodranik (Migrated from github.com) reviewed 2022-02-15 10:15:40 +00:00
biodranik (Migrated from github.com) commented 2022-02-15 10:15:40 +00:00

Строки вроде используются, просто скрипт их не детектит )

Строки вроде используются, просто скрипт их не детектит )
Author
Owner

We reached a dead end on this road. The initial idea of this patch was that we can restore the original track recorder and make it working in the background by adding BACKGROUND_LOCATION permission.

Unfortunately, this is not a case. The reality is that all top vendors (Samsung, OnePlus, Xiaomi, Huawei) pause your app with or without BACKGROUND_LOCATION permission. For us, it means that the track will be recorded only when user opens the app. AlarmManager, PendingIntent and any other hacks don't help here. The app will be suspended immediately after going into the background in favor of longer battery life. See https://dontkillmyapp.com for detailed explanation of this issue.

Strava and other popular apps can record tracks in the background by using ForegroundService and asking a user to disable "power save mode". The device's battery usually lasts no more than 3-4 hours in this case. This is only one viable way, but it will require different UX and has different implementation complexity.

Please use https://github.com/OpenTracksApp/OpenTracks for now. It is also open-source and privacy-friendly. We will re-consider the full-featured track recorder in the future.

We reached a dead end on this road. The initial idea of this patch was that we can restore the original track recorder and make it working in the background by adding BACKGROUND_LOCATION permission. Unfortunately, this is not a case. The reality is that all top vendors (Samsung, OnePlus, Xiaomi, Huawei) pause your app with or without BACKGROUND_LOCATION permission. For us, it means that the track will be recorded only when user opens the app. AlarmManager, PendingIntent and any other hacks don't help here. The app will be suspended immediately after going into the background in favor of longer battery life. See https://dontkillmyapp.com for detailed explanation of this issue. Strava and other popular apps can record tracks in the background by using ForegroundService and asking a user to disable "power save mode". The device's battery usually lasts no more than 3-4 hours in this case. This is only one viable way, but it will require different UX and has different implementation complexity. Please use https://github.com/OpenTracksApp/OpenTracks for now. It is also open-source and privacy-friendly. We will re-consider the full-featured track recorder in the future.
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
3 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#1807
No description provided.