-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[android] Trace Path (a.k.a. Recent Track) #8183
base: master
Are you sure you want to change the base?
[android] Trace Path (a.k.a. Recent Track) #8183
Conversation
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
android/app/src/main/java/app/organicmaps/location/LocationHelper.java
Outdated
Show resolved
Hide resolved
android/app/src/main/java/app/organicmaps/location/LocationHelper.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me play with this PR on my real devices.
Subtitle of record time is not update after user select a duration |
Sorry if i am misunderstanding but do you mean the description below Record time title? Which contains text
|
Update summary of preference with value selected by the user |
The setup failed my expectations. If you turn on/off track recording, the track disappears, despite the fact that the option to show 24 hours is set. Next time I will compare it with my Garmin Edge. Visually it was nice, but I lost proofs ( Screenrecorder-2024-05-15-18-44-27-816.mp4 |
Hi @dmitrygribenchuk thanks for your feedback :) This feature is still underdevelopment. We will surely try to implement the features which are beneficial for the users. )
Thanks for this feedback Can you please provide details of your device to better understand app's behaviour and also kindly provide what was your initial battery percentage if you remember it. |
Hello, I also tested this assembly on Samsung A52 Android 14 and in general it copes with the task of recording a track 👍 I also encountered the fact that after turning off the track recording, most of the track disappears, and the remaining random (!) part begins to blink. From the wishes: the recording interval is now long, the track turns out rough even when walking quickly.
It should be noted that the Debug build is much slower than the release build and probably consumes more battery |
Thanks for the feedback :)
Will look into this issue 👍
For now in background it is 10 sec interval keeping battery consumption as focus, but if it will affect accuracy then surely interval need to be decreased. |
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
Is it possible to make it easier for users to enable/disable recent track feature in one click in Settings? |
we can bring options on main setting screen instead of taking users to another activity for track recording controls. Alternatively, we can create a separate section in main setting and there we can put all related settings. (Like we have general settings section, navigation etc...) |
Feedback by @RicoElectrico from Telegram chat:
|
return null; | ||
} | ||
@RequiresPermission(value = ACCESS_FINE_LOCATION) | ||
public static void startForegroundService(@NonNull Context context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen any notifications, neither after enabling "Record Track" in the settings, nor after restarting the app. Please check for POST_NOTIFICATION permission. It is probably better to do from MwmActivity. See
organicmaps/android/app/src/main/java/app/organicmaps/MwmActivity.java
Lines 1843 to 1854 in a7127cc
public void requestPostNotificationsPermission() | |
{ | |
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || | |
ActivityCompat.checkSelfPermission(this, POST_NOTIFICATIONS) == PERMISSION_GRANTED) | |
{ | |
Logger.i(TAG, "Permissions POST_NOTIFICATIONS is granted"); | |
return; | |
} | |
Logger.i(TAG, "Requesting POST_NOTIFICATIONS permission"); | |
mPostNotificationPermissionRequest.launch(POST_NOTIFICATIONS); | |
} |
UPDATE: It has started to work after enabling notification in system settings:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have transferred the calling of service from preference class to mwmActivity class.
Although without notification permission i don't think it will show any notification. I tried with navigation as well but no notification shows if notification is turned off in settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bug still present. Moreover, I don't see a notification when I start the app with the enabled option. I suspect that the foreground service doesn't start either. Enabling/disabling option in the settings fixes the issue.
6de4a18 (HEAD -> recent-track-recorder)
Author: kavikhalique kavikhalique3@gmail.com
Date: Fri May 17 02:45:21 2024 +0530
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This problem is still their even after calling the requestPostNotification() method from MwmActivity, It do not asks permissions for notifications even if it disabled in setiings although functionality works fine but it do not shows any notification.
Please test this with navigation as well. @rtsisyk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This problem is still their even after calling the requestPostNotification() method from MwmActivity, It do not asks permissions for notifications even if it disabled in setiings although functionality works fine but it do not shows any notification. Please test this with navigation as well. @rtsisyk
POST_NOTIFICATIONS is available on Android 13+ (API 33+). Please see https://developer.android.com/develop/ui/views/notifications/notification-permission. Let's try to call requestPostNotificationsPermission() at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please call requestPostNotificationsPermission() as well as check for location!
Is it possible to check if notifications are disabled by the user and ask to enable them? Would it be helpful? |
Thanks for the feedback 👍 Accuracy seems low in comparison to Garmin. Can you please provide battery drain if by chance you remember it. |
I have tested it in 2 devices and what i found is even if the notifications are disabled and notifications are not showing the app still runs in background as usual : ) For navigation it might not be good but for track recording its not a problem i guess. |
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
Vendor: Samsung Result: no points recorded when app is in the background |
What's the benefit of throwing out all discussion arguments and pushing something questionable? I have several questions:
|
Naming has been discussed in another thread: #6678. Honestly, any decision here is better than no decision. I have tossed my coin already. You don't need to agree with the outcome.
Bike shed? We will change the constant in the code if it doesn't work well.
This feature implies significantly battery consumption. I think that it makes sense to notify the user at least once. |
It is not the first time I have heard this hypothesis. Are there any facts confirming it? What is significantly and insignificantly? |
Few days back i had done a testing for about 13 hours approx. Please have a look into the testing data below
|
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
✅ Add "Trace Path" button to main menu (placeholder icon used) @rtsisyk i have finished all this above mentioned. Please review it. Few small works are pending which i will finish in next few commits probably. |
Before start record path, we need to check location is enabled. |
@kavikhalique comparing the state when an app is not used to the state when the app is used doesn't reflect reality well. Can you please compare the running track recorder with the running navigation feature? Is there a warning about battery usage when users start navigation in Organic Maps and other maps apps? |
Absolutely nothing happens when I press "OK" in the dialog. Please add POST_NOTIFICATION check finally! |
|
But there already we are changing the color of the icon.
Sure will do that 👍 |
It is really hard to say when it is enabled and it is not... Let's fix the notification first and I will re-test again. |
I've moved GPS + Power Save research into a separate ticket #8336 |
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
✅ Toast message on start and stop
|
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
✅ Request user to disable battery optimisation on app in case it is enabled |
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
✅ Check for device power saving mode and request to disable it Some vendors like xiaomi and huawei do not provide intent action for calling power save mode settings, although i have found one solution on stackoverflow related to checking the status of power saving mode in huawei and xiaomi. I have tested in xiaomi device and this solution works well. Required feedback for huawei devices. Way to test -> 1- Enable the power saving mode in your device If this above dialog doesn't appears then please provide feedback here |
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
Signed-off-by: kavi khalique <120750626+kavikhalique@users.noreply.github.com>
Added - 1 - Convert trace path foreground notification to warning notification in case location do not gets updated for 30 seconds and revert it back to normal as location becomes normal. |
A blue dot is always shown in the hamburger menu, even after stopping recording. |
How does a blue dot behave together with a red dot (map updates are available)? Was the behavior already discussed somewhere? |
Here is the video, lockscreen.mp4Please note notification will only be shown on lockscreen when notification will change into warning notification, normal trace path notification will be hidden on lockscreen. |
if map updates are available then only red dot will be shown and blue dot will be hidden. Blue dot is at lowest priority. |
|
[Android] Implements Recent Track Recording in android app of OM