osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.67k stars 1.02k forks source link

Trip/Track recording: automatcally start new segment on power status change #12097

Open blacklion opened 3 years ago

blacklion commented 3 years ago

🚀 feature request

Description

It is very useful to have different segments of track record (GPX) when travel on vehicle & do multiple radial detours by feet.

Now you must remember to click "Start new segment" each time you leave vehicle and return to it.

Device with OsmAnd is powered vy external source (USB charger) in vehicle and lives on its own battery when user is out of vehicle.

It will be very nice to have option in Track Recorder plugin to automatically start new segment when device power status (Charging / On battery) is changing (in both directions). It could produce artificial segments sometimes, but it is better than forgotten segment boundaries, IMHO.

Describe the solution you'd like

Monitor ACTION_POWER_CONNECTED / ACTION_POWER_DISCONNECTED notifications and optionally start new track segment on each of it.

blacklion commented 3 years ago

BTW, "Nightly" build has new Recording control interface, which hide "Start new segment" behind additional click, so this feature becomes more useful than on "Release" (Play Market) version.

vshcherb commented 3 years ago

Unfortunately we don't see much demand for this option yet to make it mainstream. Probably you would be interested to have a 3rd party plugin and control new segment / new track from separate application.

blacklion commented 3 years ago

Unfortunately we don't see much demand for this option yet to make it mainstream.

What is the problem to add feature where there is pull-request?

I understand, that you can be not interesting to invest developer's time to implement this from scratch, as there are a lot of more urgent issues, it is understandable.

blacklion commented 3 years ago

Probably you would be interested to have a 3rd party plugin and control new segment / new track from separate application.

As far as I understand (after reading #2173 and #5525) it is impossible to make full-featured 3rd party plugin for OsmAnd+ (I have subscription and want to use it in the future, I don't want to build my own custom build). Am I right?

Code in Osmand/plugins doen't look like plugins :)

vshcherb commented 3 years ago

No you are not right. https://github.com/osmandapp/osmand-api-demo/tree/master/OsmAnd-api-sample (https://github.com/osmandapp/osmand-api-demo/tree/master/). Also OsmAnd Telegram is fully done via plugin API.

Target app conects via AIDL protocol and controls OsmAnd.

blacklion commented 3 years ago

I can not see "Start new segment" command. Also, additional app is again about «not forget to start», and additional window in carousel :-(

Could you say, what is wring with my PR? :)

vshcherb commented 3 years ago

Could you say, what is wring with my PR? :)

Cause we don't want to complicate application with such functionality. It serves 1 purpose probably for 1 user, but needs to be properly documented, explained etc...

blacklion commented 3 years ago
* Additional app will start automatically if it's installed as plugin if you start OsmAnd.

As I know next to nothing about Android development, I don't understand, what is difference in installation procedure :-) Is here any documentation which describe how to "application" becomes "plug-in"? OsmAnd-api-sample looks as normal application to me, but, again, I'm not a Android developer by any means.

* We can add AIDL command to start new segment

Yes, please!

Solution which will start automatically is perfectly Ok for me! My goal is to minimize manual labor (better say to minimize ritual actions which need additional attention).

Thank you!

Could you say, what is wring with my PR? :)

Cause we don't want to complicate application with such functionality. It serves 1 purpose probably for 1 user, but needs to be properly documented, explained etc...

Fair enough.

vshcherb commented 3 years ago

@blacklion please contact me https://t.me/ruosmand, to discuss next steps