I iCAB Well-Known Member Licensed User Longtime User May 19, 2018 #1 Hi All After the app is moved to the background,it seems that I am facing this issue now a lot more than before. Or at least I am noticing the issue a lot more. Many of the global variables are destroyed, which is causing major app crashes. Is there a way around this without having to store all variables to a file? Thanks iCAB
Hi All After the app is moved to the background,it seems that I am facing this issue now a lot more than before. Or at least I am noticing the issue a lot more. Many of the global variables are destroyed, which is causing major app crashes. Is there a way around this without having to store all variables to a file? Thanks iCAB
LucaMs Expert Licensed User Longtime User May 19, 2018 #2 Storing variables on file is a very good idea, instead Put global variables in the service Starter is another one. Upvote 0
Storing variables on file is a very good idea, instead Put global variables in the service Starter is another one.
I iCAB Well-Known Member Licensed User Longtime User May 20, 2018 #3 LucaMs said: Storing variables on file is a very good idea, instead Click to expand... What is the proper way of handling this? Do we have to store all global variables in all modules in files?, it doesn't make sense at all Upvote 0
LucaMs said: Storing variables on file is a very good idea, instead Click to expand... What is the proper way of handling this? Do we have to store all global variables in all modules in files?, it doesn't make sense at all
DonManfred Expert Licensed User Longtime User May 20, 2018 #4 https://www.b4x.com/android/forum/threads/starter-service-consistent-single-entry-point.57599/ Upvote 0
I iCAB Well-Known Member Licensed User Longtime User May 21, 2018 #5 DonManfred said: https://www.b4x.com/android/forum/threads/starter-service-consistent-single-entry-point.57599/ Click to expand... Hi Don I already have the above in place to a certain extent Code: Copy Sub Service_Start (StartingIntent As Intent) GC.GC_Init 'This initialized main classes End Sub Whoever, i believe that it might be extremely dangerous to wipe everything all the time, as there could be some session specific variables (like encryption keys etc.. ). Upvote 0
DonManfred said: https://www.b4x.com/android/forum/threads/starter-service-consistent-single-entry-point.57599/ Click to expand... Hi Don I already have the above in place to a certain extent Code: Copy Sub Service_Start (StartingIntent As Intent) GC.GC_Init 'This initialized main classes End Sub Whoever, i believe that it might be extremely dangerous to wipe everything all the time, as there could be some session specific variables (like encryption keys etc.. ).
Semen Matusovskiy Well-Known Member Licensed User May 21, 2018 #6 Do you talk about Process_Globals or Globals variables ? In my app Process_Globals are present almost in all activities and Services. The app starts/stops activities and services many times. Never noticed that variables are changed due to these acrtions. Upvote 0
Do you talk about Process_Globals or Globals variables ? In my app Process_Globals are present almost in all activities and Services. The app starts/stops activities and services many times. Never noticed that variables are changed due to these acrtions.
Erel B4X founder Staff member Licensed User Longtime User May 21, 2018 #7 Process_Globals variables remain valid until the process is killed. Their life cycle is not tied to any specific module. Any information that should be kept after the process is killed should be stored in the file system. KVS2 is a very good option for this. Upvote 0
Process_Globals variables remain valid until the process is killed. Their life cycle is not tied to any specific module. Any information that should be kept after the process is killed should be stored in the file system. KVS2 is a very good option for this.
coslad Well-Known Member Licensed User Longtime User May 21, 2018 #8 Variable is a variable and it doesn't have sense to store a variable into a file . Why don't you use code module to define global variable ? Upvote 0
Variable is a variable and it doesn't have sense to store a variable into a file . Why don't you use code module to define global variable ?