(Optional) To see a list of installed plugins in your Cordova project, open a
command prompt or terminal window, navigate to your Cordova project folder, and
enter:
cordova plugins
The Cordova command line interface returns a JSON array showing installed plugins, for
example:
In
this case, some core Cordova plugins were added, including corelibs, console,
device, device-orientation, dialogs, and inAppBrowser. CoreLibs is a utility
plugin that is automatically added to every Kapsel project by the command line
interface, so you need never add the CoreLibs plugin to a project manually.
Configure the application (type: hybrid) in the cockpit.
Define a variable in the JavaScript code (typically, this is done in the
index.html file of your Cordova application) to describe the
app ID, for example:
var appID = "com.sap.kapsel.mykapselapp";
Kapsel uses an app ID to tell the server which application definition on the
server to use for this application. The app ID that is defined on the server must
match what is entered here.
For Windows projects, acquire the WinJS 4.4 library from the WinJS site
(http://try.buildwinjs.com/) and include it in the index.html
file. Reference the base.js and ui.js
script files, and the ui-light.css stylesheet. There is more
than one way to do this, as detailed on the WinJS Web site.
Define the connection to the server, for example:
var defaultContext = {
"serverHost" : "192.168.254.159",
"https" : "false",
"serverPort" : "8080",
"resourcePath": "Enter URL suffix",
"farmId": "Enter name of company id",
};
This prepopulates the fields in the registration dialog that is shown to users
during the initialization process.
Make a call to the Logon plugin’s init method as shown:
//Make call to Logon's Init method to get things registered and all set up
sap.Logon.init(logonSuccess, logonError, appID, defaultContext);
The init method gathers information about the environment’s
security configuration by asking the Afaria client and Client Hub application, if
available, sets up and configures the DataVault, connects to the server to register
the application connection and authenticate the user. As part of this process, the
appropriate screens are shown to gather user input and manage the entire
process.
Use the Android IDE, Xcode, or Visual Studio to deploy and run the project.
Verify the registration in the cockpit.
Log in to the cockpit.
Click Applications.
Click Registrations.
You can see the registration ID following a successful registration.