B4A Library Configuration Data

Very often there is a need to save a few configuration data when exit an app. and to reload them on next start. Like the old Windows INI files ...
This library just offers a quick way to do so. The configuration can hold up to 10 entries (10 lines), which can be accessed independently. 10 Entries should be enough for most cases.

cfg.Exist just check if a configuration already exist. Important for a first use after installation, when user must first setup some proper values before use the final app ....

cfg.Write(ITEM,VALUE) where ITEM is a value from 1-10
cfg.Read(ITEM) just returns the value of ITEM (1-10)

B4X:
    If CFG.Exist=True Then
        hBar1.Value=CFG.Read(1)
    Else
        hBar1.Value=150
    End If

The library is written directly in B4A, sources are included.

Have fun

G.
 

Attachments

  • CFG_Library.zip
    2.7 KB · Views: 271
  • CFG_Sources.zip
    5.9 KB · Views: 223

GKCS

Member
Licensed User
Longtime User
Absolutely correct, but for many cases, you neither need the "much more", nor do you need a SQLite based database system to store a few configuration settings ....

"KeyValueStore class uses an SQLite database to store and retrieve all kinds of values."

;)
 
Top