Willing to help use the battery app. I’m struggling to get it to work. I’ve duplicated the same block you show but am unable to get the call back to see the value in the text box. Your examples run fine when I run them.
First, thank you for responding, as I hope to make use of your sub-routines. If you can have some patience with me that would be great as it has been a long time since I’ve programmed anything. Did assembly language, Fortran, basic, etc… way back.
So I’m just learning the system, and some of my issues are likely newbie-related. At this point, I think I’m going to delete and restart the project and bring your module in fresh. I will show what I have currently … I simply did my best to copy what you showed for capturing the battery charge and showing it in a text block. The text just simply doesn’t show up. However, last night while going to bed I did see it show battery charge one time on my phone but nothing after that…
Your demo showing the four different battery states works fine for me when I run on computer. I’m going to duplicate all four fields on next project.
Hi David.
The batteryLevelChanged event only fires when the level changes.
If you want the level of the battery once the screen opens you should copy the setText blocks into a screen opens event or in the click event.
Also note that it takes a second or 2 to get the battery level.
Ps my apologies, I wasn’t entirely sure how to properly show how it works in the docs so it may be a bit “unclear” so please ket me know what I can improve.
Hi David I’m not sure what is going on.
Could you share a project share link or make it public I’m unable to see the project.
EDIT: it seems that Thunkable is unable to read the messages send back, the web bridge message received block doesn’t work in this specific module but i have no idea why, all other modules and web bridges work.
I’ll open up a support ticket because this is sadly on Thunkable it’s side after debugging the js code works correctly and receives/ sends the message properly back with correct values but the event on Thunkable it’s side never fires.
Hello @pettengilld32a1wqr I got great new for you David.
I just figured out what the issue was with the latest Thunkable update it seems that The receive message event breaks when to many request get made at the same time.
Thanks to this i have been able to push out a fix allowing you to use the module again.
Please take a look at the getBatteryInfo block in the docs
You need to use this block now to get battery info.
Getting ready to remake the project again using your new script. I did try running the prior code on my phone and saw some differences but not clean information yet. Hopefully, when I redo everything I will pick up the changes you made.
As I am curious about this stuff, I did find the project files and saw the html code you did for this. Did you right code that talks to the OS of the device directly or are your scripts hitting existing codes on the devices that are ready to feed that data to whatever hooks come their way? Where the changes you made in the html code or somewhere else?