This plugin provides a native settings page for an app. It was developed to be used in the SAP Fiori Client. The settings screen can be shown by calling
sap.AppPreferences.showPreferencesScreen(successCallback, errorCallback);
The settings are specified by calling
sap.AppPreferences.configurePreferencesScreen(preferencesJSON, successCallback, errorCallback);
where preferencesJSON describes the settings to be shown.
On Android, the settings values can be validated by including JavaScript code in a validation.html file as shown in the example below. On iOS, the values can be validated via the regex field in the JSON.
The values can be accessed and modified programmatically by calling
sap.AppPreferences.getPreferenceValue(key, successCallback, errorCallback);
and
sap.AppPreferences.setPreferenceValue(key, value, successCallback, errorCallback);
For additional details on the apppreferences plugin see C:\SAP\MobileSDK3\KapselSDK\docs\api\sap.AppPreferences.html or Using the AppPreferences Plugin.
The following steps will demonstrate an example of using this plugin.
cordova create C:\Kapsel_Projects\AppPreferencesDemo com.mycompany.apppreferences AppPreferencesDemo
cd C:\Kapsel_Projects\AppPreferencesDemo
cordova platform add android
cordova plugin add kapsel-plugin-apppreferences --searchpath %KAPSEL_HOME%/plugins
cordova create ~/Documents/Kapsel_Projects/AppPreferencesDemo com.mycompany.apppreferences AppPreferencesDemo
cd ~/Documents/Kapsel_Projects/AppPreferencesDemo
cordova platform add ios
cordova plugin add kapsel-plugin-apppreferences --searchpath $KAPSEL_HOME/plugins
cordova run android
or
cordova run ios
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
25 | |
21 | |
12 | |
9 | |
8 | |
8 | |
8 | |
8 | |
8 |