If you’re trying to store data that can be used anywhere in your app then the best approach is probably to use a stored variable. These variables can be saved on your phone for future use and are accessible from any screen.
Create your variable
In this example, a variable called
counter is initialised. When the app opens it is always assigned a value of 0, so you may want to modify or remove this bit if you want persistent storage.
Update your variable
This is probably the easiest way to update your variable…
Another way to update your variable
…however you could also do something like this: