Heart Rate Measurement (again)

ahh ok. removed because there is a paid extension in it!

This should work

Screen1.aia (338.9 KB)

OK Sorry but I was gone off-grid for 3 months. After returning I bought a phone with Android 11, removed the SIMS or any other method of connecting to the internet. I then made the changes to my app and use the phone as a dedicated phone for my app only.

Thank you for the suggestion ChrisWard

Let me explain what I did in order to understand why it suddenly stopped working?

Since my app is truly huge It is not feasible to simply rewrite it so...

  1. I used "Copy All Blocks to Backpack"
  2. Delete (633) blocks)
  3. I deleted the previous BLE and inserted the new BLE
  4. I used "Paste All Blocks from Backpack"
    This is where I noticed a problem. The paste block count is much lower count than the Copy count.

An attempt to simply remove the BLE and install the new BLE caused a ridiculous number of errors.

Thank You

Try this approach on an .aia export of the old Project?



1 Like

Thank You ABG. I will attempt the delete as soon as I can (holidays busy things)

I have never looked inside an .aia. I take it your meaning delete the old BLE and then add the new BLE to the file?

P.S. It has been 3 years since I wrote the original and I am a bit novice again.

The post I linked to does indeed use a surgical approach to the exported .aia file.

I have not done this myself for an extension update. (I try to avoid them if possible.)

I personally use 7zip for other .aia repairs to Designer and Blocks.

EEEK! I do not have "com.google.appinventor.components.BluetoothLE [ble_2]
com.google.appinventor.components.BluetoothLE [ble_2]"

What I have is the following:

YES 7zip is better because it is totally free and works the same

Did I mention the granular blocks backup technique of doing draggable blocks images of all blocks, using one of the browser extensions in the Blocks Editor FAQ?

Those come in handy when you lose blocks that depended on deleted extensions.

Presumably, you might be able to drag those block images back into the app after deleting an old extension.

For an entirely different replacement technique, there is the idea of pulling in the newer extension alongside the older one, and switching all the blocks that use the old extension to the new one.
Maybe the installation code is smart enough to clean out old versions?
(I have not tried any of these.)

It's good to have lots of Project->Save As backups and .aia exports before trying any of these ideas. I have had too many projects crumble in my hands.

OMG!! What changed?

Yes that is where I began. this help request post That was the first thing I tried. I simply added the new BLE and was going to build as you describe. As soon as I would import the new added BLE extension it reported "was updated". When I would attempt to use my app it simply would fail to run. I was in disbelief and repeated the procedure 3 or 4 times. With that failing, I attempted the backpack method mentioned above and upon that failing I started this post.

Upon your suggestion of today I decided I should at least try as you suggested and this time the app works!!! Something changed and it wasn't me :thinking:

I am going to test this extensively and if it takes the hammering I will credit you for the solution.

Yes I have more than 30 backups, each with a Notepad explanation of changes per save.
I also have to make Notepad maps of all the modules on each screen. The app is very large. When the new BLE failed I, understandably, freaked :rofl:

Thank You

The backpack is a fragile backup .

A well named collection of.png draggable block images can live anywhere.

What changed?

Recent BLE changes dealt with Android permission restrictions.

Maybe your devices' apps attained permissions along the way.

hmm The BLE I have has been on my PC since last July edu.mit.appinventor.ble-20230223-beta. IE: I am still using the same BLE today as I did during July when I could not get it to work.

I was thinking that Google released a couple minor updates for OS 13 during the last 5 months and maybe that is what changed.

I did not (until now) think to check if there was yet another release since then. Version 20230728 appears to be the latest and I DLed it. I will also test that, especially since it is not marked "beta".

On the topic of things that can rot, Android periodically drops permissions for infrequently used apps.

:astonished: omg

I have changed the code in the pursuit of looking for any possible mistakes.
I also improved some button handling events, etc

I installed the app on my 2 phones: Android 13 and android 11

On the android 13 phone the heart rate reports very accurately up to 99. Upon hitting 100 it reports 10 !
On the android 11 phone it reports the HR accurately all the way to my maximum heart rate and for 20 minutes workout (using a watch belt and phone type belt).

I realize the BLE for heartrate extension belongs to E.W.Patton and think he should know about this but want to ask you if you think I should submit this as a bug?

I would look for truncation of the heart rate when it hits the Label, something that might be device dependent if you asked for a fixed width in the Designer.

If that's not it, by all means post the exported aia here for us to examine.

I did think of that and yes its fixed to 45% which is capable of displaying 000 3 digits
Again, it works fine on my android 11 phone
Also I have an earlier version of the app that worked perfectly when that phone was android 11 and it works perfectly even now with 13. The only change has been the BLE. I never changed the size of the readout label during upgrade.

I am a bit shy to post a bug :face_with_open_eyes_and_hand_over_mouth:

A few minutes later: what it there is leading spaces? I did a trim on it but same result BUT I have two displays and the other one works fine so no bug except me somehow

UPDATE: got it working thanks to you. Somehow in android 13 the font size on screen has changed. I tested this app on many phones and it works perfectly until I updated to the new BLE!!! very strange

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.