Android Question [B4XPages] Global Variables

aeric

Expert
Licensed User
Longtime User
In Default B4A, I used to declare my global variables in Main and then later I used Starter to declare global variables such as UserID, SQL and KeyValueStore variables.

How about B4XPages? Do we store these variable in B4XMainPage?
 
B4XPage is a class so if it is necessary to access the variable make it Public and then access it like f.e. Page1.VariableName. If you want to obfuscate it though (f.e. a string) then you should use the Process_Globals of Main or Starter because the strings in a Class are not obfuscated.
 
Upvote 0
Yes, I would like to know any "best" practice so when we develop for B4i and B4J will follow the same convention. So I think the correct way is to put those variables in Main class.
 
Upvote 0

Similar Threads

Replies
8
Views
17K
Replies
2
Views
13K
Replies
22
Views
42K
  • Locked
  • Article Article
Replies
4
Views
23K
Back
Top