0
 Followers
4
 Likes

Create the Global variable concept in Mobile Application

Backend
New

Since there is no session variables in mobile application, it is very hard to share the values across the screen become to tough and as a replacement we may use the Local Entity and variables in some places but it may arise some performance issues.

So as a better replacement i think that we may need some global variables like "Session Variables"

Thanks

Vignesh Balasubramanian

Created on 16 May 2018
Comments (5)

Hello Vignesh,

I don't think you have big performance issues as long as you don't store huge amount of data as in a local entity. We do it like this and it works just fine. We don't experience performance issues. Nice benefit of local entity is the data is available in offline situations also.

Regards,

Daniel

Changed the category to Backend


Hi Daniel,

how to use local entity so it can reflected to screen in reactive way? If its value got change, the value displayed in screen updated immediately. Say for example like counter indicator.


Regards,

Lambok

Hi Lambok,

The original idea was on how to pass data from one screen to another.

My answer was that on exit one screen you update the local storage entity and on entering the next screen you fetch the data from local storage.

Your question is different, so if I a am on a screen, who is then changing the local entity data, that you want to reflect? there is only one screen active at a time. 

Maybe I do not fully understand the problem you describe.

Regards,

Daniel

HI,

Use the SHARED PREFERENCES Plugin available on forge that use native features like Shared Preferences & NSUserDefaults to store key values pairs on Android & iOS respectively. 

The One which we have published Shared Preferences Plugin if you would like to check this out. 

Just like we use the Shared-Preferences with native for storing local & permanent session or values across all screen, you can use this.

https://www.outsystems.com/forge/component-overview/5013/android-ios-shared-user-preferences

Cheers

views
434
Followers
0