Build a fitness app with Ullis Foreground extension?

41 steps at 0.73 stride will always = 29.93 meters
at 0.4572 = 18.7452 meters
at 0.762 = 31.242 meters

How do you convert steps to meters using your code? What you see is probably a rounding type of error.

perhaps change the values circled

These are the values in the Foreground Pedometer example. Your app might have similar values and you can make the values more 'precise' using 2 or 3 places in each puzzle piece.

I just put the 2 in 1 that I had and the 3 in 2 and tried it, it actually gives a consistent step output
Thanks so much for the precise, clear explanation as I could understand it.
I combined the pedometer with a timer that shows the walking time from below along with Uli's extensions, I keep the application alive counting steps and time until I close it.
Thank you all

1 Like


I walked outside for 40 minutes and got these readings.
Aren't the steps and measures too few?
When I walked only on a straight road without hills, inside a football field with a steady step?
I have no problem with walking, on the contrary, my stride is quite fast.
Are these measurements accurate?
I calculated that it would produce double the results in 40 minutes of continuous and relatively brisk walking.

Now I remembered that for a while I had forgotten to activate the keep-alive.

It is probably because of the fact that he measured so few steps and meters
I will check it again tomorrow without forgetting to activate the keep-alive.



Is it possible for the Ulli stay alive extension to remain active after pressing the back button?
I'm looking for this because while after opening another screen of the app and going back to the first one where I have the extension, with the back button the screen closes and the button shows disabled after I reopen the app, while after going back from the other screen of the app it's still on, but with the closing the 1st screen where i have the extension the button is disabled with the back button.

You can avoid this by using virtual screens, see tip 1

Taifun

1 Like

I have tried these ways in 3 applications and I always keep them in mind.
In this one because I didn't want to mess around with a lot of code again, I chose real screens.
I was able to go to the other screens and back to the original without the keepalive turning off.
It only turns off by closing the screen with the back button.


Today I tried it normally from the beginning I had keep alive activated and it counted those in the picture.
I asked the chatGPT how much he should measure in this time and he replied that he should take 2.55 km and that what he took here is wrong!
If so what should I fix?

Yes.

I use a TinyDB to 'save data' and a ListView to show a record of previous walking sessions like this.

What you do in YOUR app would be something similar. What have you tried?

Dear @palaiologouiason , the purpose of building an app that runs in the foreground is to run it in the foreground, isn't it Evan? So why would you want to disable the KAS using the Back button? Once the app is running you do want it to keep tracking steps?

You may want to initially start the KAS immediately upon opening the app using code like this (sorry I didn't test it; you are building your app based on a teaching example that shows how to initialize and dismiss the KAS function. You don't need the Start button if you do something like this

turnOnKASatStart

Try the example, you might want to turn on KAS immediately so you don't forget and miss counting some steps. :wink: Let us know if it works please.

perhaps you do not have your stride set properly

chatGPT has a stride different than you. Amazing. :smile:


I have done it like this.
But in the list it excludes me twice from the counts, once without the names.
What should I do so that it only shows the names and next to the numbers?
It would be better if there was a date to record these steps and meters..
If I have the phone in a trouser pocket or in a purse tied around my waist, does it make a difference in the measurements?
Next time I'll take ChatGPT as company... if he walks faster than me, will I tell him to wait for me at the end of the route? :smile:

Yes it works and now I can be forgetful :rofl:

With this tip I also solved another issue I wanted for a reminder that I have along with other real screens .
Now I can go to the other applications I have on the other screens, go back to the first screen where I have the reminder, close the application and it remains active.
I think, I should think about it, but I'm still too new to quickly think of simple solutions.

As I go with the pedometer tests, I will become an Olympic athlete.
ChatGTP again left me far behind and he did 3.58 kilometers in the same time with an average walking speed of 5 kilometers per hour.

Here the stage where I go for the tests

No matter what step distance I set it to it takes me out on the same steps exactly the same distance in total meters every time.
In 41 steps in all, it takes me 29.20 meters
What did I do wrong;


You probably like to use the SelectionIndex instead?
What happens, if you choose another value from the Spinner? Does your calNumb.Text change?

Taifun

Are you setting the spinner before or after you use the StartCountingSteps button. The spinner does set the correct stride . Are you counting walking steps?
Are you changing the stride while the pedometer is counting? Once you set stride, you shouldn't change it until you zero the count.

Using a stride of 0.762 41 steps yields 31.24 meters.





I have no idea what to change, but I have patience :smile:

have you checked this?

You don't have to change any of the spinner code. The code works fine. SelectionIndex doesn't make any difference. See my post earlier today. What you do need to do is be careful when you set the spinner.

Also, you can set the stride in the Screen1.Initialize block manual and/or save the spinner value to a TinyDB and read the value on app start.