Howto deploy and configure a KAPSEL app with SAP Afaria
This guide describes how create a KAPSEL app for Android, which retrieves data through SMP3 from an OData service. The app will be deployed and configured through SAP Afaria SP03, so the user only has to enter his backend credentials.
Configure SMP Application
First you have to configure an SMP Application in SMP’s Admin cockpit. In case you need more info then the brief steps mentioned here, go to infocenter.
- In SMP Admin Cockpit, create a new application
- Define the Application ID
- Configure backend endpoint to point towards an OData service
(Note: for you to be able to redo this work without having to setup an OData service yourself, you are going to use OData.org’s Northwind service. Although it does not have authentication enabled, you can still use this url for your authentication, all username/passwords will be accepted. This will obviously different in a real world scenario).
- Configure http authentication to authenticate against the same Service
Now your SMP3 server is ready to accept requests, authenticate and route them to the OData service.
Prepare the KAPSEL app
Next thing you’ll have to do is prepare the KAPSEL application.
You are going to use the KAPSEL Logon plugin, which will allow automatic configuration using Afaria and ease up the onboarding of your application to SMP3.
The basic steps that you have to execute from the commandline are mentioned here. If you want to learn more about the Logon Plugin, see the Getting Started Guide.
- Create a Cordova project
- Add android platform
- Add KAPSEL Logon Plugin
- Exchange index.html in www folder with sample_index.html (see attachment to this doc)
- Prepare the KAPSEL project
- Then import the project into Eclipse with ADT installed
Package and sign the application
As you want to deploy the application through Afaria, we nee to prepare an APK-file. Therefore you need to compile and sign your application.
- Export the project as Android Application
- Create a new keystore to store the signing key you are about to generate
- Create the key by giving all the details required
- Save the signed APK somewhere, so you can pick it up from the Afaria Console
So your KAPSEL application is all setup to work against the already configured SMP3 server. Now you are going to configure the Afaria server to deploy the app and send the connection settings along with it to your device.
Note: As a prerequisite to deploy applications through Afaria, you have to enroll your device. More info on how to do this, can be found here http://www.youtube.com/watch?v=AkuuTIxqsSQ.
- Open the Afaria Admin in your favorite browser and create a new Android Enterprise Application Policy
- Give it a name
- Upload the APK you just created
- Add some description, if you want to
- In the configuration section, you are hitting a critical point. So you upload a config file holding content like this (obviously adjusted with your environment’s details):
Note: It has to be a configuration text file, typing text into the box won’t work. Some of the settings mentioned in this settings string are not applicable to all environments. Please refer to the MAF documentation to get all the available settings.
- Now link the policy to the Android Group and you should see the app in your Afaria client after refreshing on the device
Install the app using the Afaria client
- On the device open the Afaria client and connect it.
- You’ll see the Application listed on the Enterprise App Screen
- Click on the app to see the details and hit the install button to download and start the installation.
- When the app has been installed, open it.
Run the app
- When opening the app, the LogonManager pops up. Note that it is only asking for the backend username and password. All the other settings (servername etc) have been pulled using the config file deployed together with the app.
- Enter username and password
- Specify an application passcode
- Enter the app
- You can test if the connection to the backend through SMP works, by fetching the Service Document or the Collection
This Howto Guide showed the steps necessary to configure, build, deploy and run a KAPSEL application with the help of SAP Afaria with just a couple of steps.