Saving To Local Storage From Rest API Response in Mobile App

Saving To Local Storage From Rest API Response in Mobile App

  

Hi ,

I am looking at training material and practicing Outsystems for mobile app development. I am doing a POC with sample UI and consuming Rest services. I have already implemented  list to show countries from service. But now i want to show list from local storage instead directly from response. I want to store the response countrylist object into local storage and fetch the list object from storage using aggrigates and display in List UI. 

can any one help me to understand the process to implement the same. Please find attached flow diagram which i have implemented to display directly from service. How can i modify it to display from Local storage. 



Hi Rakesh,

Mobile training materials include information on data sync that can give some clues.

The best solution for your case depends on why do you want to store the data in the device:

  • Are you trying to make the app available while offline?
  • Are you trying to increment performance?

Also, you need to understand the type of data you are using:

  • Is it reference data that does not change much?
  • Is it transactional data that must be shown always with the latest updates?

After answering this questions it's possible to dig further and find the possible scenarios.


Cheers,

Tiago.


Tiago Gafeira wrote: 


Hi Tiago,

As i said, I am doing a POC as a practice for my certification. Saving response data in local storage is a common practice in mobile application to increase the performance and to not to hit the service multiple times and to support offline.  

Regards

Rakesh.K

Hi Rakesh,

Mobile training materials include information on data sync that can give some clues.

The best solution for your case depends on why do you want to store the data in the device:

  • Are you trying to make the app available while offline?
  • Are you trying to increment performance?

Also, you need to understand the type of data you are using:

  • Is it reference data that does not change much?
  • Is it transactional data that must be shown always with the latest updates?

After answering this questions it's possible to dig further and find the possible scenarios.


Cheers,

Tiago.




Tiago Gafeira wrote:


Hi Tiago,

Data sync is something i can take a look after i successful implementation of Local storage. Most applications do not use data sync. So i want to understand first how to achieve saving response object into local storage, like coredata in IOS. 


Regards

Rakesh.K 

Hi Rakesh,

Mobile training materials include information on data sync that can give some clues.

The best solution for your case depends on why do you want to store the data in the device:

  • Are you trying to make the app available while offline?
  • Are you trying to increment performance?

Also, you need to understand the type of data you are using:

  • Is it reference data that does not change much?
  • Is it transactional data that must be shown always with the latest updates?

After answering this questions it's possible to dig further and find the possible scenarios.


Cheers,

Tiago.




Most straightforward scenario may be found at https://www.outsystems.com/learn/lesson/782/local-storage/.

Tiago Gafeira wrote:


I feel the explanation in this lesson is not clear enough for newbie.  If u have any sample app which has the simple response saving to Local storage could be helpful. 

Most straightforward scenario may be found at https://www.outsystems.com/learn/lesson/782/local-storage/.



Hi Rakesh, 

Unfortunately I don't have anything that can be shared. For training purposes you should really try to complete the exercises from the online training course, as it targets a simple scenario.

More complex scenarios should be target case-by-case as a perfect solution for one case may be inappropriate for another. If you're willing to describe your use case better, I'll try to help.

What type of data are we talking about? Reference data or Transaction data? Who can change the data, all users or just a specific one? How do you plan to solve local-server inconsistencies?


Cheers,

Tiago.