You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guillaume Raffin edited this page Oct 14, 2019
·
14 revisions
The modules
Night-Config is divided into several gradle modules: the core modules, plus one module per configuration language.
If you only work in memory, you only need the core module. However, if you want to read and write config files, you also need the module(s) corresponding to your config language: json, toml, hocon, yaml. Note that those modules automatically include the core.
Configure your build tool
Simply add the module(s) you need, for instance toml, as a dependency from Maven Central.
Older versions of Android don't provide the packages java.util.function and java.nio.file, which
NightConfig heavily uses. If you encounter issues with the NightConfig on android, you can use the
special version that I've made for you: in your dependencies' declaration, simply append _android
at the end of the NightConfig modules.
When using core_android or any of the *_android NightConfig module, most of the features should work just as usual. Here are the known limitations:
Limitation
Why
Notes
The Supplier and Consumer classes aren't those from the JDK but from com.electronwill.nightconfig.core.utils
Android below api 24 doesn't provide the standard Supplier and Consumer
You can still use lambdas
There is no asynchronous FileConfig. All the FileConfigs are synchronous, even if sync() is not called on the FileConfigBuilder.
Android below api 26 doesn't provide the class AsynchronousFileChannel
Autoreloaded configurations are checked every 5 seconds by NightConfig. When the file size and/or last-modified datetime changes, the configuration is reloaded.
Android below api 26 doesn't provide the package java.nio.file