Comments (8)
Yesss, I definitley thought of that! When I get stuff organised, there will definitley be a way for other apps to get info from freebuddy π
I managed to retrieve the charge from the huawei app using a logcat read
oh that's fun too!
from freebuddy.
Hey just a small update: I was able to use a Tasker logcat profile to get the battery levels from the widget. Not quite as straightforward as receiving a broadcast intent, but I thought you'd find it interesting nonetheless :)
I use a profile which has a logcat event, where component is set to flutter
. Then the filter is BatteryData
.
My task then consists of the following actions:
Task: Freebuddy Battery Reader
<test logcat message>
A2: Simple Match/Regex [
Type: Simple
Text: %lc_text
Match Pattern: BatteryData(levelLeft: #levelLeft, levelRight: #levelRight, levelCase: #levelCase, chargingLeft: $chargingLeft, chargingRight: $chargingRight, chargingCase: $chargingCase) ]
A5: If [ %mt_match_found eq true ]
A6: Variable Set [
Name: %4iCase_battery
To: %levelCase
Structure Output (JSON, etc): On ]
A7: Flash [
Text: Case Charge: %levelCase%, Buds: %levelLeft%, %levelRight%
Continue Task Immediately: On
Dismiss On Click: On ]
A8: Else
A9: [X] Flash [
Text: %mt_match_found
Continue Task Immediately: On
Dismiss On Click: On ]
A10: End If
The most important one is the regex matching, which maps the data from the logcat to corresponding variables.
I've only just set it up, so I may find out it isn't as reliable as I think, but for now it seems to work quite well. Even better than my previous one with the Huawei app, since now I don't even have to open an app :D
from freebuddy.
It is fun, but just like the entire original app, it's rather slow and clunky haha
from freebuddy.
With recent widget updates, I started to check their battery in background and saving it up in shared preferences so that widget can source it
Looks like best way to leave this info open to other apps is through content provider ??: https://developer.android.com/guide/topics/providers/content-provider-basics
(tho this looks complicated af so would prefer it simpler if possible π )
from freebuddy.
oh... https://pub.dev/packages/android_content_provider
will just have to look this up a bit π
from freebuddy.
ahhh I gotta say I have almost 0 experience in Android Development, so I have to admit I can't say anything about the complexity and stuff π
What I was thinking of regarding the feature would be to simply have the app send out an intend with for example the battery percentagedata, which it could do whenever the percentage updates for example (or whenever it's easiest to code it in). Tasker (or other apps too) should be able to receive those and the user can just do with it what they want from there.
But as said I have 0 experience and if I just suggested something that's even more complicated let me know π€
from freebuddy.
Another thing that i could use to share stuff is broadcasts: https://developer.android.com/guide/components/broadcasts
I don't want to send intent from freebuddy because that would require user to select where to send the intent and I want to keep freebuddy simple
Could you click through Tasker or smth and see which option is easier (to listen to Broadcasts or fetch from content providers ?)
from freebuddy.
If I'm not confusing terms, I think receiving a broadcast in tasker is easy to do:
under receiving intents in the docs it says tasker sets up an intent filter and receives intents from the broadcast receiver:
The intent filter is also mentioned on the broadcasts page you linked (See here at point 3).
Let me know if I'm mistaken here though, I'm happy to help out furtherπ
from freebuddy.
Related Issues (16)
- No Win APP? HOT 7
- Toich-and-hold stuck to "noise cancellation" when disabling "awareness" from settings. HOT 1
- Many simontanious headphones
- "Find lost" by last location when connected (for both buds)
- Android 12 support HOT 5
- Generic bluetooth heaphones
- Huawei Freebuds 4i freezing sound in the pocket HOT 1
- App not connecting to Huawei Freebuds 4i HOT 5
- Huawei Freebuds 5i support HOT 16
- Multi-headphones compatibility HOT 2
- Sometimes crashes on miui 13 when headphones connected π€· HOT 9
- Can't detect headphones whose name has been changed HOT 8
- Equaliser add functionality HOT 1
- Home widget with battery π HOT 3
- Publish to F-Droid HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freebuddy.