Skip to Content

Set Up Initial Configuration for an MDK App

Configure initial setup for MDK Mobile and Web applications.
You will learn
  • How to configure MDK apps in the Mobile Services cockpit
  • How to configure destination for MDK Mobile and applications
jitendrakansalJitendra KansalOctober 16, 2022
Created by
jitendrakansal
October 4, 2022
Contributors
jitendrakansal

Prerequisites

  • 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.

    MDK

    What are some of the benefits of Mobile Development Kit apps?

    Log in to complete tutorial
  • Step 2

    Make sure that you have completed required prerequisites mentioned in this tutorial.

    1. Navigate to SAP Mobile Services cockpit.

    2. On the home screen, select Create new app or navigate to Mobile Applications Native/MDK New.

      MDK
    3. In the Basic Info step, provide the required information and click Next.

      Field Value
      ID com.sap.mdk.demo
      Name SAP MDK Demo App
      MDK

      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.

    4. In the XSUAA Settings step, continue with the default settings and click Next to navigate to further steps.

      MDK
    5. 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.

      MDK

      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.

      MDK

      You can find more information on available features in SAP Mobile Services in help documentation.

    Which tool do you use to create configuration for your MDK mobile app?

    Log in to complete tutorial
  • Step 3
    1. Click Mobile Connectivity.

      MDK
    2. Copy the URL from existing destination and click the Create icon to add a new destination.

      MDK
    3. In Basic Info step, provide the required information and click Next.

      Field Value
      Destination Name SampleServiceV2
      URL paste the URL from above step
      MDK
    4. For this tutorial, there is no Custom Headers, Annotations required. Click Next to navigate to further steps.

    5. In Destination Configuration step, select SSO Mechanism as Forward Authentication, click Next.

      MDK
    6. For this tutorial, there is no configuration needed for the SSO mechanism. Click Finish.

      MDK
    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.

    1. Click com.sap.mdk.demo to navigate to Mobile Services application details.

      MDK
    2. 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.

      MDK
    3. 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.

      MDK
    4. 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.

      MDK
    5. Download the zip file from here and unzip it on your machine.

      MDK
    6. 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
      MDK

      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
Back to top