Set Up Initial Configuration for an MDK App
- How to configure MDK apps in the Mobile Services cockpit
- How to configure destination for MDK Mobile and applications
Prerequisites
- Tutorial: Access SAP Mobile Services
- Step 1
The Mobile Development Kit (MDK) enables developers and technical business users to build multi-channel applications. It allows you to build your application once, in an integrated development environment, and run it natively on mobile devices (Android & iOS) and as a web application (online) in the browser.
You can find more details in the Mobile Development Kit developer page.
- Step 2
Make sure that you have completed required prerequisites mentioned in this tutorial.
-
Navigate to SAP Mobile Services cockpit.
-
On the home screen, select Create new app or navigate to Mobile Applications → Native/MDK → New.
-
In the Basic Info step, provide the required information and click Next.
Field Value ID
com.sap.mdk.demo Name
SAP MDK Demo App If you are configuring this app in a trial account, make sure to select License Type as lite.
Other fields are optional. For more information about these fields, see Creating Applications in the SAP documentation.
-
In the XSUAA Settings step, continue with the default settings and click Next to navigate to further steps.
-
In the Assign Features step, choose Mobile Development Kit Application from the dropdown, select Mobile Sample OData ESPM to add a sample backend to your MDK app and then click Finish.
If you see a Confirm Finish window, click OK.
Once you have created your application, you see a list of default features have been automatically assigned to the app.
You can find more information on available features in SAP Mobile Services in help documentation.
-
- Step 3
Click Mobile Connectivity.
Copy the URL from existing destination and click the Create icon to add a new destination.
In Basic Info step, provide the required information and click Next.
Field Value Destination Name
SampleServiceV2 URL
paste the URL from above step For this tutorial, there is no Custom Headers, Annotations required. Click Next to navigate to further steps.
In Destination Configuration step, select SSO Mechanism as Forward Authentication, click Next.
For this tutorial, there is no configuration needed for the SSO mechanism. Click Finish.
Log in to complete tutorial - Step 4
MDK Web application accesses the data sources via BTP destination. You will now create a new destination in BTP cockpit that will point to the same backend as your Mobile destination.
The destination that you are going to create in this tutorial is very specific as this connects to the backend via Mobile Services and will use OAuth2JWTBearer authentication type. For other kinds of backend or services, you may skip the following steps and directly setup your BTP destination with the relevant authentication type that is required by the backend.
-
Click
com.sap.mdk.demo
to navigate to Mobile Services application details. -
Open the
APIs
tab, click copy to clipboard icon to copy the highlighted URL and paste it in a text file. This URL will be used in configuring the BTP destination. -
In your SAP BTP space cockpit page, navigate to the Services → Instances, select Authorization and Trust Management service from the list, click
com-sap-mdk-demo-xsuaa
instance, choose trip dot icon → View to open the configuration details. -
Switch to Form tab, copy values for
clientid
,clientsecret
,url
parameters and paste these values in the text file. These parameters will be used in configuring the BTP destination. -
Download the zip file from here and unzip it on your machine.
-
Navigate to Connectivity → Destinations to create a BTP destination, click Import Destination to import the extracted file and provide the required information and click Save.
Field Value URL
Paste the URL from step 4.2 Client ID
Paste the value from step 4.4 Client Secret
Paste the value from step 4.4 Token Service URL
Replace the Token URL placeholder with the URL from step 4.4 , make sure the Token URL is appended by /oauth/token
Use Default JDK truststore
Select the checkbox if not selected before When checking the connection, if all your configurations are correct, you will see a success message saying
Connection to "SampleServiceV2" established. Response returned: "400: Bad Request"
. In this particular case, it is safe to ignore the"400: Bad Request"
part of this message.
Log in to complete tutorial -