Best approach to store user app preferences?

9 posts, 0 answers
  1. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 03 Mar Link to this post

    I need to have a view in my app where the user can set some preferences for my app and service. This information should be stored in the Backend Data service and cached in the app.

    I have created  a Form view attached to backend Data, however I'm unclear how to get it to load the user's record.

    How can I achieve this?

    Is this a good approach or are there other recommendations?

  2. Martin
    Admin
    Martin avatar
    103 posts

    Posted 08 Mar Link to this post

    Hi Jean-Marc,

    You may store app preferences in the cloud (the backend data) or in a variable in the local storage of the device.

    If you store the data in the local storage of the device the preferences will be avaible only to that particular device. Therefore if a user installs the app on different devices, then he will have to set these preferences twice as they are stored locally and not in the cloud. Still, this data will be available even if the device is offline (has no internet connection at all).

    You may also store these preferences in the backend data as you have mentioned - then you will have to also store which preferences apply to which user. Here is documentation on how to create or read data from Telerik Platoform backend using the JavaScript SDK or using the RESTful API.

    Whenever approach you choose, you will have to make modifications using the Code tab (not the Views service) as the Views service does not support it. The Views service is mostly aimed at creating as much as possible from the functionality and layout of the app from the start. However, after you get to the point where you need to make a lot of customization, it is best to switch to the Code tab and continue your development and updates there. After you do, you should stop using the Views service for the app in question, since a re-generation of its views will wipe your custom code (if they are outside the CUSTOM_CODE blocks).

    Let me know if you need additional information.

    Regards,
    Martin
    Telerik by Progress
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 08 Mar in reply to Martin Link to this post

    Thanks. Martin.

    What's the recommended approach to carve out certain views from the Views service while retaining others?

    For example I have created a skeleton view for this settings form which I want to completely customize.

    However in parallel I have other views like authentication or backend data driven views which I would still like to manage with the convenient Views service.

    Is that even possible or is it more like all-or-nothing?

    Best,

    Jean-Marc

  4. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 08 Mar in reply to Martin Link to this post

    Thanks. Martin.

    What's the recommended approach to carve out certain views from the Views service while retaining others?

    For example I have created a skeleton view for this settings form which I want to completely customize.

    However in parallel I have other views like authentication or backend data driven views which I would still like to manage with the convenient Views service.

    Is that even possible or is it more like all-or-nothing?

    Best,

    Jean-Marc

  5. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 08 Mar in reply to Martin Link to this post

    Thanks. Martin.

    What's the recommended approach to carve out certain views from the Views service while retaining others?

    For example I have created a skeleton view for this settings form which I want to completely customize.

    However in parallel I have other views like authentication or backend data driven views which I would still like to manage with the convenient Views service.

    Is that even possible or is it more like all-or-nothing?

    Best,

    Jean-Marc

  6. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 08 Mar in reply to Martin Link to this post

    Thanks. Martin.

    What's the recommended approach to carve out certain views from the Views service while retaining others?

    For example I have created a skeleton view for this settings form which I want to completely customize.

    However in parallel I have other views like authentication or backend data driven views which I would still like to manage with the convenient Views service.

    Is that even possible or is it more like all-or-nothing?

    Best,

    Jean-Marc

  7. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 08 Mar in reply to Martin Link to this post

    Thanks.

    Is there a way to carve out this view from the Views service while still using that for others (e.g. authentication view)?

    Best,

    Jean-Marc

  8. Jean-Marc
    Jean-Marc avatar
    17 posts
    Member since:
    May 2016

    Posted 08 Mar in reply to Jean-Marc Link to this post

    Sorry I got an Error 500 every time I posted my replies but obviously they seem to have been posted properly...
  9. Anton Dobrev
    Admin
    Anton Dobrev avatar
    604 posts

    Posted 13 Mar Link to this post

    @Jean-Marc

    My understanding is that you have created a few views in the Views service and now you would like to completely customize one of the views and detach it from the Views service tracking so that you keep your code changes. This is not doable out of the box.

    You may want to stick to the writing your code only in the specified place for custom code changes (to prevent the code from being regenerated or updated). Alternatively, if it is CSS only, you can write it in a separate file and reference it in index.html. If the index file is regenerated, you can always reference the CSS again with a single line of code.

    You can also think of adding a new branch in your app where to write the custom code and keep the Views service in the master branch. More on source control options in Telerik Platform here.

    Let me know if this helps.

    Regards,
    Anton Dobrev
    Telerik by Progress
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top