Create the Global variable concept in Mobile Application
2086
Views
6
Comments
Implemented
Backend
Platform Server Release Oct.2019 CP2

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

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

2021-04-09 11-42-43
assif_tiger
Champion

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

2019-04-07 18-26-39
Vitor Teixeira
Changed the status to
Implemented
on 02 Oct 2019

Hi Vignesh,


Thank you for sharing your idea and use cases. With the recent October 02nd release, Mobile Apps benefit from the new Client Variables capability.

Below you will find a short description of this capability, from our "Reactive Web: The Next Generation of Web Apps" forum post. So you can see that, besides having this capability for Mobile Apps, Reactive Web Apps also benefit from the same exact experience.


Client Variables

Create Client Variables in Mobile and Reactive Apps. Yes, that’s right. This will be useful to store interface state like a filter or to cache user information that you don’t want to fetch from the server all the time.


Thank you again for contributing with your ideas.

Cheers!