The image below represents the block coding whereby I display the saved data onto the listview. However, this is where I have problems as I am unable to display anything as there is always an error message popping up.
Do let me know how I can rectify these issues and how I could improve on my block coding
Can you upload here a part of your .ino code that sends the data from your BT device?
If you are sending println() then there are better ways of receiving the data.
Look here for answers: FAQ Section: Bluetooth < version 4 (BlueTooth Client) and Arduino
Also, the timer value of your clock may be too long or too short.
Then: GOOD PROGRAMMING PRACTICE:
First, try to display your data in a label or text block, next, if everything is ok, try to find out how ListViews work, then, if you have mastered that, try to combine the two.
If you do not do that, programming will always be like stirring and poking in mud, hoping you will find gold or diamonds. Sometimes you can be lucky.
Some more remarks.
You look at the visibility of two labels, which apparently must not both be visible. Can it happen that they are both invisible?
And you do exactly the same, in the then-part for each.
So it would be better to read the data, not depending on the visibility of a label.
Then, you must save the data in the Clock.Timer block, otherwise it will be overwritten the next time the timer goes of and data is recieved.
Now. you will only save data when you press the button. If that is what you want, fine. But save the text, not the html content.
Also be aware, that the way you store it, it will contain only the last value you stored and not a list.
Your display block when pressing the display button, is unfortunately, nonsense.
Do some App Inventor tutorials first!!
As I said above, take things step by step and ask your questions step by step. You will get there!
Thank you so much for your kind advice, ill work on it =) And yea I was able to do it with the label component. As per your suggestions I'll look up more into the ListView block
Hi, I have amended my block coding to the best of my abilities. I was able to save the data into a label and then from there call it out to display onto the listview component. Now, I am unsure of how to arrange the data in my Listview component. I would like the data to be arranged either all horizontally; in a single row according to its "Day". Or arranged in a vertical manner. For eg. DayNo. -> PushupNo -> PullupNo.
Before you make any decisions, try to make some really simple improvements that will make your code much more readable. For example, the cntdownbtn.Click and the cntupdtn.Click contain exactly the same code, except for the first 2 blue blocks. put these green set visible true/false blocks into a procedure, and call this procedure from both .Click blocks. Really simple, but it could save a lot of blocks if you try that for the other buttons too. I would show you, if you upload an .aia of your code.
yeap, i was planning to do the procedures part later on once I have completed the block coding. It's just my personal preference to see the entire code so that I know whats going on. =) However, thanks for your advice, will do the procedure part later on.
I have attached the .aia file as well =). There are 2 other screens namely 'ExerciseData' and 'storagetest' those were just my trial screens, you can ignore it, the main one is in Screen 1.
Instead of all those labels that show "pull up selected" and so on, you could just have one label to which you set the text you need.
Alas, I have no further time today, but maybe you have some ideas now.
And, the question again: what does the Arduino send as data? Does every message end with a println(); ? In that case you can do better with the receiving of the BT data, if not, if you can change the code in the Arduino, you should make it so that every message ends with a println();