Bangle.js build flavor #2621
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Freeyourgadget/Gadgetbridge#2621
Loading…
Reference in New Issue
No description provided.
Delete Branch "gfwilliams/Gadgetbridge:banglejs_flavor"
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?
This PR adds build flavors to
build.gradle
. The default is calledmain
, but we also addbanglejs
which allows the building of an app calledBangle.js Gadgetbridge
.This will have internet connectivity, allowing Bangle.js watches to request data directly from the internet - and it's named so as hopefully not to be confused with the normal offline Gadgetbridge, while still giving credit.
Eventually the plan is to put this on the Google Play store, and to have additions in it which are good for Bangle.js users but would otherwise negatively impact normal Gadgetbridge users (a build flavor is used so we can keep the same codebase and not fork).
About naming - I'd mentioned
Gadgetbridge for Bangle
to @ashimokawa but thinking about how it would appear in the app store and Android apps list, it probably makes sense to call itBangle.js Gadgetbridge
so it's listed underB...
. Happy to change or use something else if you have strong opinions though.Note: adding build flavors seems to add the flavor name to existing builds. As a result, all other builds will now have
main
in the name. Unfortunately I didn't see another way around this, but hopefully it won't break anything.Just two notes:
Gadgetbridge
on the Android device regardless of what I do. Another developer tells me it works fine for them though and as far as I can see I've done everything right here.Someone does seem to have already used that I'm afraid (https://m.apkpure.com/banglebridge/de.bangle_bridge.bangle_bridge / https://banglejs.com/apps/?id=banglebridge) although I don't think their app is in the app store...
hi @gfwilliams , thank you for the work and effort on the watch and now also on Java code :) !
Look here for the overwrite of the name:
https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/app/src/nopebble/res/values/strings.xml
This could maybe work? https://proandroiddev.com/android-set-a-default-build-type-flavor-a1cdcd1c15fa
You need to think if you want this to be installable with regular Gadgetbridge in parallel. If yes, you will need to disable the Pebble provider by renaming it, like the "nopebble" build type does.
👍
Yes, agreed.
I like the "Bangle.js Gadgetbridge" name. It keeps both project names intact and gives them full visibility and credits, leaves no confusion, points the users to correct search results and so on. Of course, in Android launcher, the name will be somewhat trimmed "Bangle.js Gadget..." i presume, so it should be tried. I mean... i probably like "Gadgetbridge for Bangle.js" more, but i know that this will create confusion in Android launcher because only "Gadgetbridge" part of the name will be visible and only the icon will actually differentiate the apps. I do not know if it makes sense to even add the "Network(ed)" into the name, for clarity of the users, but this does look a bit odd. So maybe it will be important to add to the description that ...this version has networking enabled to provide connectivity... The reason i say this to make sure we do not make the users think that Gadgetbridge has networking enabled by default... Maybe i am too worried too early :)
I have to try it to see what this means.
Hi @vanous, thanks!
Is that not what I do with
app/src/banglejs/res/values/strings.xml
? I checked by writing some garbage in there and the file is definitely parsed as part of the build, so I don't know why it's not having an effect for me :(Good point about the Pebble provider and default build. I'll get those added.
I hadn't considered the name clipping in launcher, thanks! I think that definitely makes using
Gadgetbridge something
more of a problem. On one phone I'm using here evenGadgetbridge
becomesGadgetbri...
. So I think for nowBangle.js Gadgetbridge
seems sensible and I'll make sure networking is mentioned clearly in the docs.I finally got the App Loader working inside Gadgetbridge too (not in this PR yet) so it should make a really big improvement to the usability of Bangle.js.
Ok, just added those tweaks.
However: I just tried building and uploading the Nightly/Nopebble releases from normal Gadgetbridge (without my changes) and I see the same thing - the app icon changes, but all apps are called 'Gadgetbridge' - strings.xml seems to be ignored.
Is it just me? I've tried on two separate PCs now each with fresh android-studio installs and I see the same thing!
I think i know what you mean. Do you mean the main activity (see below):
Look:
F-droid (i did not update icon in F-droid for the nightly):
Install (name and icon):
App name:
App name:
Main activity name:
You need to provide another string for the main activity. I do not do this particular one for the Nightly.
Launcher icons:
App info:
Thanks! Actually that's not what I see - in the launcher, task manager, and permissions list, it just shows 'Gadgetbridge' for me for all apps (including Nightly).
Glad it's just me though, so this code should work fine for you. I'll dig deeper at my end - while I used different PCs I did rsync the folder, so maybe there's something else kicking around that is causing a problem.
Ok, so I found the problem with the app name - and it's not specifically related to my build system or this PR. It's translations.
It seems the order of priority for
strings.xml
is:app/src/main/res/values-LANG/strings.xml
app/src/BUILD_TARGET/res/values/strings.xml
app/src/main/res/values/strings.xml
So I guess if you're in the USA you're fine, because there's no specific strings.xml language for you.
However outside of the USA, Nightly, Nopebble and now Bangle.js builds are all still just called 'Gadgetbridge' because pretty much every
app/src/main/res/values-LANG/strings.xml
has anapp_name=Gadgetbridge
line in it.So I don't know what your thoughts are here. We could:
app_name=Gadgetbridge
from every translation file where there was no language-specific translation, so then the name of the other builds will appear correctly (apart from ml/ja/ko/fa where there do seem to be language-specific versions).app/src/BUILD_TARGET/res/values-LANG/strings.xml
files for every language that just overrideapp_name
with the right namePersonally I feel like the first option might be more sensible?
First option seems ok, but let me add... i am in EU but my locale is not CZ as per my country, but rather US :)
Or perhaps this has to do with the phone lang? I need to try this, interesting...
... It felt like
translatable:false
might be an option, but that doesn't seem to work (it might just be a lint thing?). I'm happy to do a PR with all theapp_name=Gadgetbridge
lines removed...Sorry - missed you last post @vanous.
Pretty sure it's phone language. Some translations don't have app_name defined (ar/lv/ta/hi) so if you happened to have one of them you'd be fine. The vast majority do though.
Confirmed here as well - when using non EN language on the phone, the app_name is
Gadgetbridge
. Two (other) options:app_name_build_variant
and set theapp_name
via code from this variant - thus allowing the name to be localizedOk, great! Glad to hear it's not just me :)
So personally I'd say this was all good to merge if you're ok with it @ashimokawa?
App name issue:
I assume some people must use the translations?
You all know much more about Gadgetbridge/Android than me so I don't really know what the best route is, but I have a branch here with 'app_name' removed from translations (where it is not translated) and I can do a PR with that if needed.
@gfwilliams
I think it is best to have multiple app names and all should be translatable.
Anyway I think I can merge this for now.
@gfwilliams
Would you mind if I squash this into one commit?
Great!
No, not at all! Would you like me to squash subsequent PRs as well?
Definitely. I'm not quite sure I understand how we'd handle that, but I'll start a new issue for it so as not to drag this one too off-topic.
@gfwilliams
No you do not need to pre-squash PRs, I have a button for that ;)
Great - thanks for the merge! I'll work on getting some of my other tweaks into PRs