Hello everyone!
Hope evryone is doing wel.
I have a bit of a problem.
I’ve created a random qoute system that uses google sheet to get the qoutes
and then displays a random qoute in the button.
It works as supposed on the web-preview but when I download it it doesn’t work on my chromebook or android phone.
here are my blocks:
If you’re getting a white screen or crash message, I suspect that you need to see if the stored variable is NULL before you try to get its length. That’s probably crashing your app.
hi
I think i may have found the problem, you can’t do length of a variable that is not a list, so you might want to set it to an empty list and then while setting it to something, i would add to list, instead of setting the variable to the value.
It works in the web preview because while you are developing and testing you have updated the stored variable and it reported something other than null.
When you moved to your mobile or Chromebook, There is no stored variable saved for your app and therefore the app failed.
Just as @catsarisky advised, manage your use of stored variable by testing for null prior to assigning it anything or using it for anything and your app should work as expected.
I didn’t quite understand what you meant, but you could always remove the wait 5? And i to have a question for you, is there a specific reason why you do function quote twice?
Just so you don’t have to see the qoute for 10 seconds.
I have a button that displays the qoute.
But When i open the app IT waits 2 seconds before change to nothing.
And Then another second before picking a random qoute.
Sonetimes IT Just hangs at a empty button.
When I live tested it, it comes almost immediately, and one last question, do you want the user to wait 10 seconds or can you just speed up that process by removing one of the wait 5.
To prove my point, I opened network in web development tools, all the packets that are being requested are coming in a matter of milliseconds, only your logo took about 246 ms, that is
I was just looking at your code and wondering, do you have to set a stored variable to the quotes or can you just call directly from google sheets? Unless you have planned for offline use.
then, unless you are constantly updating, you could set your quotes in that variable, as i had set it to empty list in the top most part of the code. And if you actually want random quotes i would suggest web api. And unless you are planning to do something with the button, i would use a label if i were you.