1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-29 16:26:18 +02:00
Commit Graph

64 Commits

Author SHA1 Message Date
Albert
56ec206f5b [Bangle.js] check if globalUartReceiver is set and move its removal to separate method 2023-02-14 10:43:39 +00:00
Albert
2e06d7afa5 [Bangle.js] remove uart.tx intent-listener on dispose 2023-02-14 10:43:39 +00:00
Lukas
25be7cf12d Banglejs: change json key to lon when sending location data to watch 2023-01-30 21:40:30 +01:00
Gordon Williams
521edc4332 Bangle.js: Increase default realtime HRM/step interval to 10 seconds
Disable manual heart rate measurement - the current implementation in Gadgetbridge seems not really compatible with Bangle.js. There's no way to turn the HRM off when the window is closed, and HRM samples from *any* device would appear to be shown - not just the one that HRM info was requested on
2023-01-26 10:31:13 +00:00
Gordon Williams
b16464b3b6 Bangle.js stop 'toast' warning message appearing when starting the app loader. Fix https://github.com/espruino/BangleApps/issues/2496 2023-01-13 14:28:38 +00:00
Gordon Williams
f3fa01dfba Bangle.js: Quick tweak to stop us sending bitmaps for common characters that already had good enough equivalents 2023-01-11 13:45:46 +00:00
Arjan Schrijver
b1d03e9f7a Clean up duplicated unimplemented methods from device support classes
Moved to AbstractDeviceSupport so each device support class can override them if required. This change helps to keep the code base clean by not requiring every (Device)Support class to implement these methods even when they don't need them.
2023-01-05 22:11:32 +01:00
Gordon Williams
6d35ca3ec0 fix gbDevice==null errors again, and avoid spamming log with ACTION_DEVICE_CHANGED messages 2022-12-12 16:10:14 +00:00
LukasEdl
abf19f2b6c [Banglejs] Send phone location data to banglejs, which can be used as gps data (#2992)
Since the PR #2961 aswell as #2976, 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.

In the PR #2976 I also moved the settings to the device settings of the banglejs and i moved the logic to the onLocationChanged method of the GBLocationManager.

Co-authored-by: Lukas <lukas.edi@gmx.net>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2992
Co-authored-by: LukasEdl <lukasedl@noreply.codeberg.org>
Co-committed-by: LukasEdl <lukasedl@noreply.codeberg.org>
2022-12-12 07:48:19 +00:00
Gordon Williams
0dd0b2bead Bangle.js flow control. If the Bangle is busy and unable to accept more data, Gadgetbridge will now pause sending until the Bangle is ready for more.
This works by adding the ability to pause the sending of data from the Bluetooth LE queue. While BtLEQueue is modified, unless setPaused(true) is called it behaves exactly as before so shouldn't cause any issues.
2022-12-12 07:43:20 +00:00
Gordon Williams
bb1323dd61 Ensure we automatically convert unrenderable chars the title/description of calendar events 2022-12-12 07:42:22 +00:00
Gordon Williams
e003e0b672 Fix the code that forces a calendar sync on Bangle.js - previously sending "android.intent.action.PROVIDER_CHANGED" didn't work 2022-12-12 07:42:22 +00:00
Gordon Williams
55cbac5f8f Squashing some build warnings. Fix for potential corruption in bitmaps that weren't exactly n*8 bits long 2022-10-18 11:52:08 +01:00
Gordon Williams
eac7edfea1 Bangle.js - small tweak to fix occasional NullPointerException reported via Play Store 2022-10-14 09:48:55 +01:00
Ganblejs
c31471c9b8 Bangle.js: extending intents functionality (fix). Use startForegroundService only on API level 26 and up. 2022-09-27 17:09:55 +02:00
Andreas Shimokawa
7985f8c703 Bangle.js: some minor code cleanup
Also improves performance when scanning for emoji (if one has been found stop scanning for more)
2022-09-27 15:51:41 +02:00
Gordon Williams
abec54fb1a Bangle.js: Added PATCH HTTP request type, and fix for VolleyError UnsupportedOperationException when supplying custom headers 2022-09-27 11:11:52 +02:00
Ganblejs
82315b3281 Bangle.js: extending intents functionality (continuation)
Add support for (explicit) service intents.
Add support for setting flags for intents.
Add support for setting multiple categories for intents.
Add ability for Gadgetbridge to wake the Android device and leave the
 lock screen to start activities when it is sleeping. A new activity
 'WakeActivity' is used for this. (Must use 'trusted device' in Android)
Add dismiss-button to 'display over other apps' permission pop up.
Bangle.js can send "gadgetbridge" as package info to accomodate the
 different GB build variants/flavours.
Use only getContext() and not getApplicationContext() when executing
 the intents.
2022-09-19 21:52:40 +02:00
Gabriele Monaco
004355f69f Added calendar color and name to CalendarEventSpec
Tested on banglejs
2022-09-08 18:00:27 +02:00
Gordon Williams
87c61948a6 Bangle.js: smooth out battery level readings 2022-09-06 21:13:37 +02:00
Gordon Williams
0f052f5467 Bangle.js: Fix null pointer issue if headers not supplied for HTTP request 2022-08-24 20:26:25 +01:00
Ganblejs
60c7f79366 Bangle.js: Extend intents functionality for Bangle.js
...to allow intents to start activities on the android device.

Add pop-up asking for permission to "Display over other apps"

Add info for intents on Bangle.js

Add message to display on "Display over other apps" permission pop-up

Move permission to display over other apps to main build variant/flavor.

fix getting permission for display over other apps.

Clarify that permission to display over other apps is mainly for Bangle.js.
2022-08-17 00:35:34 +02:00
Gordon Williams
f996973a4d Minor fixes for crashes that Play Store build has encountered 2022-08-12 08:41:16 +02:00
Gordon Williams
c762bafb2e support for specifying HTTP method, headers and body 2022-08-12 08:41:16 +02:00
Gordon Williams
1e4fb7ee87 Bangle.js - make 'text as bitmaps' have transparent background, and allow font size to be specified - fixes https://github.com/espruino/BangleApps/issues/2057 2022-07-25 14:34:34 +01:00
Gabriele Monaco
d9daa16bf8 Added calendar blacklist setting to banglejs 2022-07-21 10:58:15 +02:00
Gabriele Monaco
85758d8369 Forcing calendar sync on set time, improved deletion
Disabled huami-like calendar sync (all together) function is still there
2022-07-21 10:58:15 +02:00
Gabriele Monaco
538264e01b Added different implementation of calendar sync (pebble and huami)
Also implemented a `force_calendar_sync` command for the pebble-like
implementation to cope with out of sync databases (calling the receiver
doesn't work as of now)
2022-07-21 10:58:15 +02:00
glemco
f4e6d953ff Enabling calendar sync for bangle 2022-07-21 10:58:15 +02:00
Gordon Williams
c2d98b5a24 Bangle.js - fix corruption in images with a certain sequence of chars 2022-06-15 11:48:41 +01:00
Gordon Williams
f606e85e1b Bangle.js: fix null pointer issue for debug messages, and ensure '...' special char is just replaced with '...' 2022-06-14 14:31:18 +01:00
Gordon Williams
c11af9e95c Keep data sent to Bangle.js in the log as well 2022-06-14 14:31:12 +01:00
Gordon Williams
e40bd79fbf Bangle.js: Adding built-in app-loader view (available via app management icon). Only available on internet-enabled builds (it's a webview) 2022-06-13 08:35:32 +01:00
Gordon Williams
607441b6b0 Support for color dithered bitmaps, and converting emoji->bitmaps
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java
2022-06-10 12:01:12 +01:00
Gordon Williams
12f2049ac6 Bangle.js: Keep a log of data sent from the watch, and allow it to be saved with 'Fetch Device Debug Logs' from the debug menu 2022-06-10 11:48:09 +01:00
Gordon Williams
774fb4efc3 Bangle.js fix message REPLY option 2022-06-10 11:45:52 +01:00
rarder44
236d9d9e2f Bangle.js - id in http request/response (#2683)
added an optional id to identify the request.
if a request with id occurs, a response with the same id is returned.

Co-authored-by: Rarder44 <lpozzi44@gmail.com>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2683
Co-authored-by: rarder44 <rarder44@noreply.codeberg.org>
Co-committed-by: rarder44 <rarder44@noreply.codeberg.org>
2022-05-30 13:19:19 +02:00
Gordon Williams
f0d204bdc3 Add ability to receive intents to com.banglejs.uart.tx (from apps like tasker) and send them to Bangle.js
Also local intents, paving way for app loader integration
2022-05-19 11:07:04 +01:00
Gordon Williams
b324f40a78 Bangle.js: add support for rendering to a text that can't be displayed into a bitmap and sending the bitmap over
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java
2022-05-18 16:35:07 +01:00
Gordon Williams
ec3b54ef47 Bangle.js: Add option for enabling/disabling internet access, and add ability to send Intents direct from Bangle.js
# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java
2022-05-18 16:31:22 +01:00
gfwilliams
2cb5844020 Bangle.js build flavor (#2621)
This PR adds build flavors to `build.gradle`. The default is called `main`, but we also add `banglejs` which allows the building of an app called `Bangle.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 it `Bangle.js Gadgetbridge` so it's listed under `B...`. 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.

Co-authored-by: Gordon Williams <gw@pur3.co.uk>
Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/2621
Co-authored-by: gfwilliams <gfwilliams@noreply.codeberg.org>
Co-committed-by: gfwilliams <gfwilliams@noreply.codeberg.org>
2022-03-31 11:36:26 +02:00
rarder44
c0ca52d2b8 BangleJS: added repetitions in alarm json (#2579)
Co-authored-by: rarder44 <rarder44@noreply.codeberg.org>
Co-committed-by: rarder44 <rarder44@noreply.codeberg.org>
2022-03-07 10:43:54 +01:00
Richard de Boer
cec28d2442 Bangle.js: handle battery charging status 2022-03-06 00:24:57 +01:00
Richard de Boer
42e0a63429 Bangle.js: fix battery chart
Battery percentages were shown in gadgetbridge, but not stored, so the chart didn't work.

Call AbstractDeviceSupport.handleGBDeviceEvent() instead of rolling our own battery update,
and that does call createStoreTask()
2022-02-02 11:20:43 +01:00
Marc Nause
e32dc8b48e Bangle.js: Prevent exception in case UART RX line is empty
This seems to fix the "no incoming call notification"-issue, see https://github.com/espruino/BangleApps/issues/976
2022-01-29 23:49:51 +01:00
Richard de Boer
c8ceb4e44d Bangle.js: add condition "code" to weather JSON
Fixes #2504: Weather: support for language independent condition code or icon name
2021-12-19 09:56:05 +01:00
Gordon Williams
228008e42c Bangle.js - Minor tweaks to sizes for drawableToBitmap 2021-12-09 16:14:06 +00:00
Gordon Williams
e82662f0bf Bangle.js: if music state is out of range, just return '' (fix #2485) 2021-12-09 16:09:49 +00:00
Gordon Williams
9222c6700e Add functions for pushing bitmaps to Bangle.js, also add configurable MTU. If we receive a bigger data packet then we know we can send a bigger one too 2021-08-04 16:41:06 +01:00
License Bot
1b5402dcb4 update license headers 2021-01-10 23:38:13 +01:00