Do apps get slower as they get bigger?

Hi I have an app that uses tiny db, bluetooth and plots live data. However it was lagging until I sped up the graphing clock compared to the arduino clock that is sending the data, and that corrected things. Now I’ve added more load on the app by including axis, total value in a list and highest value from that list and it is grinding to a halt. Have I reached the limits of my phone, arduino and or app inventor? By the way I am taking a reading every 400ms on the arduino and every 100ms on the app.

The duration of an eye blink is about 300 ms. What limits speed of execution?

  • the cpu processing the data
  • while graphing live data depends on how you graph. If you use the Canvas, you depend on App Inventor's graphics rendering (which is VERY slow to graphics that are compiled using Java based compilers). Possibly use a javascript graphic solution if you are presentably using Canvas.
  • bluetooth has data transmission limits.
  • how large is the List you traverse for getting data. Long lists take time to process.

Since you are slowing down, there is a reason. Your postulation 'reached the limits of my phone, arduino and or app inventor' seems likely Matt :wink:

  • Get a phone with a faster cpu; and it might improve your ability to process and display data.
  • Optimize your code for execution (by trial and error).
  • Continue to experiment with sampling on both the Arduino and App Inventor and might find a workable solution.

Sooner or later, you will exceed the capabilities of either the hardware or software or your ability to create optimal code.

Regards,
Steve

thank you, I haven’t got a clue about javascript and indeed using javascript inside of app inventor. the simpler option for now is take a reading every 1 second, slowly than I wanted but it would just about do. I’m trying to do this on a phone, https://www.youtube.com/watch?v=LlJCHyD-Jns.

Hi Matt

You are plotting a live graph, that will be the main bottleneck, as pointed out by Steve. How you are calculating the highest and total values appears to have re-introduced lag - if you can show us the data the app has to handle to produce those values we might know a faster method - but I would consider performing those calcs on the Arduino and send the App the results.

Also, since you were able to plot successfully before at 100ms per data set, you could try tweaking that up to 400ms and the Arduino to 600ms. If that worked it would be faster than the human eye could study anyway.

thanks for the advice, for now I can fudge it probably. However do you think a smart phone is powerful enough to plot live data without lag if the code is written in java? I’m only taking readings for a minute at a time.

Java isn’t a speed merchant actually, and the backbone of your App Inventor App is Java. What you could do, as a Java based extension, is write a dedicated plotting procedure. That probably would be faster as it would be dedicated to just that task.

I did have a procedure to plot the graph. I’ve removed the graph and the app is still running slow! Did you watch the video by the way?

I did watch the video briefly, it didn’t really tell me a lot.

So, the App was not running slow when you first changed the process timing. Yet it is now, even though the slowest part of the App has been removed. Something else has changed?

The video should show force being read and plotted live Vs a previous set of data for comparison. So I need lists in app Inventor to do a comparison and that I think has caused the slowing. To tell you the truth I’m a the point of giving up with app Inventor and reading the data via Bluetooth to python on my laptop.

Well, I think a laptop screen is more practical for the task than a tiny phone screen… plus the laptop’s CPU has much more grunt.