B4i Library [class] iStateManager - Similar to B4A StateManager

Discussion in 'iOS Libraries' started by Erel, Feb 17, 2015.

Similar threads

B4A Tutorial [B4X] MQTT Chat Room
B4J Library [B4X] [class] UndoManager
B4i Library [class] SearchView
B4A Library [B4X] [class] MJPEG decoder
B4i Library [class] CustomListView
  1. Erel

    Erel Administrator Staff Member Licensed User

    This module is a port of B4A StateManager: http://www.b4x.com/android/forum/threads/9777/#content

    It has two features:
    1. Saving and restoring the state of UI elements.
    2. Getting and setting general settings. Note that KeyValueStore class is more powerful as it supports complex objects and it persists the data automatically.

    Go over the B4A tutorial to learn about the state management.

    You need to call StateManager.RestoreState in Application_Start and call StateManager.SaveState in Application_Background.

    For the state restoration to work the order of views must be consistent (when loading and saving the state).
    Note that currently views inside ScrollView are not saved. This is related to a bug in iCore library which is fixed for the next update.

    Testing

    To test it run the program, play with the UI and press on the home button.
    Kill the process from the IDE and restart the app (go to B4i-Bridge for this). The state should be restored.
     

    Attached Files:

    John Decowski likes this.
  2. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    Thank you.
    Erel when i open example source in b4i,get message to older version b4i.b4i version is 1.8.
    Is there newer version forb4i that not email to me?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Ignore this message. V1.8 is the latest version for now.
     
  4. Yvon Steinthal

    Yvon Steinthal Active Member Licensed User

    Is this saved throughout an update?
    I am trying to save general settings for my app without using the "apple settings app"...
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    All files are kept during updates.
     
    Yvon Steinthal likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice