Class Appfigurate
- java.lang.Object
-
- nz.co.electricbolt.appfiguratelibrary.Appfigurate
-
public class Appfigurate extends java.lang.Object
Appfigurate library static methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Appfigurate.ConfigurationUpdated
Used in conjunction withaddConfigurationUpdatedListener
andremoveConfigurationUpdatedListener
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addConfigurationUpdatedListener(Appfigurate.ConfigurationUpdated target)
Registers a delegate method that will be called back when Appfigurate has updated the configuration of the app.static void
removeConfigurationUpdatedListener(Appfigurate.ConfigurationUpdated target)
Unregisters the delegate method that will be called back when Appfigurate has updated the configuration of the application.static void
restoreConfiguration()
Restores the configuration from temporary storage back into SharedPreferences.static void
saveConfiguration()
Saves the configuration persisted in SharedPreferences into temporary storage.static void
setLogging(boolean logging)
When true, Appfigurate library debugging messages will be output to the console.static java.lang.String
version()
The version of the Appfigurate library in the format "major.minor.patch".
-
-
-
Method Detail
-
version
@NonNull public static java.lang.String version()
The version of the Appfigurate library in the format "major.minor.patch".- Returns:
- Version number. e.g. "5.1.2"
-
addConfigurationUpdatedListener
public static void addConfigurationUpdatedListener(@NonNull Appfigurate.ConfigurationUpdated target)
Registers a delegate method that will be called back when Appfigurate has updated the configuration of the app. The delegate method will be called back on the main looper.- Parameters:
target
- delegate method to be registered.
-
removeConfigurationUpdatedListener
public static void removeConfigurationUpdatedListener(@NonNull Appfigurate.ConfigurationUpdated target)
Unregisters the delegate method that will be called back when Appfigurate has updated the configuration of the application. You must call this method before the target is deallocated.- Parameters:
target
- delegate method to unregister.
-
setLogging
public static void setLogging(boolean logging)
When true, Appfigurate library debugging messages will be output to the console. The default is false. It is best practice to distribute applications via Google Play with logging set to false. See `APLLogging` meta-data in the AndroidManifest.xml file.- Parameters:
logging
- true if debugging messages should be output to the console.
-
saveConfiguration
public static void saveConfiguration()
Saves the configuration persisted in SharedPreferences into temporary storage. Some apps have functionality to erase SharedPreferences to reset apps back to 'factory defaults', which has the side effect of removing any Appfigurate configuration persisted in the SharedPreferences. SeerestoreConfiguration
for more details and usage example.
-
restoreConfiguration
public static void restoreConfiguration()
Restores the configuration from temporary storage back into SharedPreferences. SeesaveConfiguration
for more details and usage example.
-
-