[Banglejs] Send phone location data to banglejs, which can be used as gps data #2976
No reviewers
Labels
No Label
device mi band 7
activity post processing
activity/health
Android 12
Android 13
android integrations
architecture
Bangle.js
bug
changes requested
charts
details not provided
developer documentation
device amazfit band 5
device amazfit bip
device amazfit cor
device Casio
device fossil
device garmin
device gtr 2e
device gts 2 mini
device h30
device hplus
device huami
device Huawei
device liveview
device mi band
device mi band 2
device mi band 3
device mi band 4
device mi band 5
device mi band 6
device no.1 f1
device pace
device pebble
device pebble 2
device pinetime infinitime
device request
device sony
device support
device watch 9
device xiaomi
discussion
documentation
duplicate
enhancement
feature request
Gadgetbridge
good first issue
help wanted
i am developing my own app can you help
icebox
intent api
internationalisation
invalid
needs work
network companion app
new device
no feedback
not a bug
notifications
one of the 1000 issues about disconnection
pairing/connecting
potentially fixed / confirm and close
question
research
security
seems abandoned
Solved, waiting for F-Droid release
suggest to close
task
user interface / UX
wear os
weather
wontfix
Zepp OS
No Milestone
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Freeyourgadget/Gadgetbridge#2976
Loading…
Reference in New Issue
No description provided.
Delete Branch "LukasEdl:banglejs-gps-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Since the PR #2961 broke, i pushed the changes to this pr.
Original text:
With this PR, the gadgetbridge app sends the current locationd data, obtained from the gps or network provider, to a connected banglejs device as an "gps" event.
The bangle device can use this data instead of the internal gps data. Therefor saving battery energy, since the gps chip is one of the biggest energy consumers.
Furthermore it enables the banglejs device to use the location data, based on the network with which the phone is currently connected. This would be usefull if there is no gps signal.
Updates:
I added a network provider so that it is possible to use the network location. I also overload the start method of GBLocationManager so that it is now possible to select which provider should be used to get the data (currently GPS or Network) and to set a interval to determine how often the update should be run.
For the banglejs device i added a switch to enable the sending of gps data. I also added a setting, to set the interval on how often the gps data is being updated. This allows to throttle the updates of the gps data and therefore saving energy of the smartphone batterie.
To further save energy, the app now requestes the current status of the gps from the banglejs and only sends data, if the gps of the banglejs is turned on.
This looks great! Thanks for your work on it!
So basically this means there's no difference to what happens with the Phone's GPS at all normally now, unless a Bangle.js is connected with firmware that supports in and the GPS update checkbox is checked?
Only things I can see:
ea09abff92/app/src/main/res/xml/devicesettings_banglejs.xml
as it's very Bangle-related - but maybe that's just personal preference. @vanous?ea09abff92/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java (L216)
Sorry, i am out of town for a few weeks, so i cannot look into this at all. There was a suggestion by @joserebelo here to utilize the existing GBLocationManager, did you look into it?
I moved the settings to the device settings of the banglejs, i didn't see them at the time of implementation.
@vanous, i moved the logic to the onLocationChanged method of the GBLocationManager.
@LukasEdl Thanks! From my point of view this would be great to merge
@LukasEdl
what do you mea by "PR #2961 broke". Any further details would be great.
We had a huge migration of codeberg, that could be the problem.
The branch was out of date and i tried to update it by pressing the "update branch through merge" (it's a translation since the button text is in german for me "Branch durch Mergen aktualisieren"). When i pressed it a message nothing happend and after a refresh of the page, a message that called something like "The PR is broken, due to the removal of information about the source branch" (Rough translation from german, but i don't have an example for that).
I then updated the branch on my fork and then created this PR.
Well i did it again and broke the pr, by merging the master to my branch, so that i can update it.
For the record thats the message i got (translated it says "The pull request is borken, due to fork information being deleted")
I gonna close this pr and create a new pr and link it here.
I'm wondering if this would be resolved by rebasing your branch on the main repo master, and then force pushing it?
In case you didn't see it before here're step-by-step-y instructions on how to update forks to be eligible for merges :)
No i didn't saw that, i gonna take a look on it when i have to upadate my branch again
Pull request closed