hibrid0 Active Member Licensed User Longtime User Sep 22, 2015 #1 Hi people, I want to know whats the better practice to share values in our apps. I'm making my app and have arround 12-15 activities, I need to read the same variables names in every activity and write the same variables. I'm bored because if I need to make a change I need to change in every activity. Suggestions please, I'm a newbie!
Hi people, I want to know whats the better practice to share values in our apps. I'm making my app and have arround 12-15 activities, I need to read the same variables names in every activity and write the same variables. I'm bored because if I need to make a change I need to change in every activity. Suggestions please, I'm a newbie!
JonPM Well-Known Member Licensed User Longtime User Sep 22, 2015 #2 Do you need the data to persist between app launches? If that's the case you should write the variables to a Map object and save a file. See: https://www.b4x.com/android/forum/threads/text-files.6690/#content Otherwise you can create a Code modules and store variables in Process Globals (access via MyCodeMod.MyVariable). Upvote 0
Do you need the data to persist between app launches? If that's the case you should write the variables to a Map object and save a file. See: https://www.b4x.com/android/forum/threads/text-files.6690/#content Otherwise you can create a Code modules and store variables in Process Globals (access via MyCodeMod.MyVariable).
DonManfred Expert Licensed User Longtime User Sep 22, 2015 #3 Another alternative is to use the Starter Service for such Vaiables you want to use "AppWide". Upvote 0
hibrid0 Active Member Licensed User Longtime User Sep 23, 2015 #4 DonManfred said: Another alternative is to use the Starter Service for such Vaiables you want to use "AppWide". Click to expand... Hey thanks a lot, I remember I was read about that, but don't remember the name. Thanks a lot, in my I'm having the problems describe Erel on the post you linked. Thanks a lot again. Upvote 0
DonManfred said: Another alternative is to use the Starter Service for such Vaiables you want to use "AppWide". Click to expand... Hey thanks a lot, I remember I was read about that, but don't remember the name. Thanks a lot, in my I'm having the problems describe Erel on the post you linked. Thanks a lot again.