Offline improvements: Generation of data synchronization actions and new samples!

Dear all,

With OutSystems 10 you can build great offline-ready mobile apps. The ability to model data in the Local Storage gives you great flexibility to implement all your offline data needs for your apps, but with this flexibility comes the need to do Data Synchronization between Database and Local Storage. 

To help you we provide samples for the common patterns for you to implement and adapt to your application specific use cases. But this involved building the patterns from scratch, making you lose productivity...

The good news is that we've listened to your feedback, and Development Environment 10.0.201.0 features automatic generation of data synchronization actions for the most frequent patterns:

  • Read-only
  • Read/write last write wins

Just right click the Local Storage entity, and choose what pattern of data synchronization you need:


This will create a client and a server action that implements the synchronization pattern. For those that already seen the Offline Data Synchronization Patterns documentation it is like someone implemented the pattern for you out of the documentation! 

For the most complex pattern, (read-write last write wins), here's the client action:

...and the server action:


You can use these actions as-is, or you can customize them, to adapt and optimize them to your application specific scenario.

... and by the way, stars appear when you click in these new accelerators!   


We also reviewed the documentation of the Offline Data Synchronization Patterns and we've included an extra sample with a one-to-many relationship in local storage.


On top of this, the pattern samples are now fully functional so you can change data freely in the Database and Local Storage and understand how data synchronization handles those changes. 

Looks good?

Upgrade now to Development Environment 10.0.201.0, try this new stuff and give us your feedback!

Thanks!

  Good stuff.

Good stuff Ricardo, and very useful!

Has Outsystems created something that triggers the offline sync as soon as the app is installed on the device?



Hi Cristina,

Thanks for the feedback!

Offline sync only happens when the app is running on the device, so the only way to trigger it after the app is installed is to actually start the app.

Thanks!

Ricardo Ferreira wrote:

Hi Cristina,

Thanks for the feedback!

Offline sync only happens when the app is running on the device, so the only way to trigger it after the app is installed is to actually start the app.

Thanks!

Thank you Ricardo, i appologise if thw question is quite silly, but if i manage to trigger the offline sync once, and everything is downloaded, can i load it from cache after that point on? 

I have a request from my employer to make my mobile app fully available offline, as in from the moment it opens all content should be available offline. 

To be honest i don't know how to make that happen so i was thinking i could reach a compromise, and download it when the phone is online and then load it from cache. 

Do you have any documentation on the cache side of things?


Many thanks,

Cristina


Hi Cristina,

You can find very complete documentation about offline capabilities here:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Offline

The use case you described is possible to implement: all you have to do is to create Local Storage Entities to store all the data you need, trigger the offline data sync in the first run of the app to fill all those entities, and then use the Local Storage Entities as data source for your application UI and logic. Next runs of the application won't need connection to the network, since you have all data stored in the Local Storage Entities.

From your description you need a read-only cache, and this pattern can be automatically generated and is fully documented.


Did you took the time to do the mobile training course? I feel this could be the best reference for you in this moment.

https://www.outsystems.com/learn/lesson/1806/local-storage/?LearningPathId=1


Thanks!

Hi Ricardo, 

thank you for the quick reply, i have done the tutorials and implemented the read-only cache, using local storage databases as well. I think i might call an event in the wrong place, will have another look.

Can i just ask you a quick question? Can i use the local storage databases and use the offline functionality without using the login workflow? 

Thank you,

Cristina

Cristina Dragomir wrote:

Can i just ask you a quick question? Can i use the local storage databases and use the offline functionality without using the login workflow? 

Yes, accessing local storage entities does not require a user logged in, so you can bypass the login workflow if that makes sense for your app.

Thanks!


Thank you Ricardo!

Ricardo Ferreira wrote:

Cristina Dragomir wrote:

Can i just ask you a quick question? Can i use the local storage databases and use the offline functionality without using the login workflow? 

Yes, accessing local storage entities does not require a user logged in, so you can bypass the login workflow if that makes sense for your app.

Thanks!



How do I bypass the login workflow? Haha

Hi Yeo,

The only way to bypass the login workflow is to give anonymous access to all screens of your app.
To do this you will have check the Anonymous role for all your screens, as depicted below:


Note that this will open your app to all users, no login will be required for them to access data and functionality. Do this only if it makes sense for the use cases of your app.

Thanks!

Ricardo Ferreira wrote:

Hi Yeo,

The only way to bypass the login workflow is to give anonymous access to all screens of your app.
To do this you will have check the Anonymous role for all your screens, as depicted below:


Note that this will open your app to all users, no login will be required for them to access data and functionality. Do this only if it makes sense for the use cases of your app.

Thanks!


Awesome! Thanks!