SAP Mobile Technologies

A Brief Introduction to SAP Mobile Development Kit (MDK) & SAP BTP SDK for iOS

Overview

SAP Mobile Services; a part of SAP Business Technology Platform, is an open, standards-based platform that helps develop, configure, deploy, and manage highly secure comprehensive enterprise applications. SAP Mobile Services features enable users to bring their iOS, Android, Windows, or cross-platform application ideas to life and create intuitive solutions with ensured business value.

A range of development tools that form SAP Mobile Services, such as iOS and Android SDKs, Mobile Development Kit (MDK), SAP Mobile Cards, SAP Fiori Client, and more – offer an array of features that enable developers to create and administrators to manage. The SAP Mobile Services is the foundational layer for SAP Mobile Development Kit (MDK) and BTP SDK for iOS.

Mobile app development is demanding as it involves fast delivery cycles, device platform diversity, and a rich user experience. Lack of expertise and required skills in the team also adds to additional difficulties. To manage all these requirements, it is highly crucial to execute the app development projects on a standard foundation, which includes setting up a governance process for the app development teams in the first place.

SAP Mobile Services involves a strategy that includes reuse services, compliance features, optimal development options for each use case, and more.

The boxes above depict the reusable components that help free the developers from tedious tasks while implementing the strategy-compliant features. The topmost section of the diagram shows the development options that can be selected to implement a business case optimally. These development options help leverage the features and functions provided by SAP Mobile Services in a standardized manner. Therefore, this concept allows mobile app developers to concentrate on essential tasks and are freed from repetitive and tedious tasks.

SAP BTP SDK for iOS:

SAP BTP SDK for iOS is based on the Swift programming language designed by Apple, which focuses on developer efficiency and ease of use when developing apps in the XCode IDE. SAP BTP SDK for iOS supplements the Swift SDK and not replace it. Depending on the requirements of a particular mobile application, the developers can use components of each. SAP BTP SDK for iOS is one of the best business-ready native SDKs for iOS development.

The SAP BTP SDK for iOS includes well-defined layers (SDK frameworks, platform services, and components) that simplify the development of enterprise-ready mobile native iOS apps that take full advantage of iPhone and iPad features. The

SAP and Apple are working together to reinvent business processes and workflows everywhere. Developers can innovate faster by uniting powerful iOS features and seamless integration with SAP systems. The SAP Cloud SDK for iOS helps developers build, extend, and run iOS applications powered by the SAP and enterprise back-end data.

There has never been a better opportunity and more convenient time for developers to build iOS apps that integrate with SAP systems. The significant features are as follows:

  • Seamlessly connect to back-end processes.
  • Leverage native iOS technology.
  • Develop apps using an SDK built on Swift.
  • Ability to tap into a design language developed by SAP for iOS.
  • Take advantage of training and support from the Apple and SAP partnership.

The SDK includes the SAP BTP SDK Assistant for iOS to help developers get started building Cloud apps quickly and smoothly. This allows the developer to integrate the SDK frameworks and components seamlessly with an existing code base.

SAP Mobile Development Kit (MDK):

SAP Mobile Development Kit (MDK) extends SAP Mobile Services and SAP Web IDE/SAP Business Application Studio to provide a complete set of mobile app development and management tools, onboarding, central lifecycle management, and offline support. It offers a metadata-driven approach to creating native supported applications, so no previous experience developing iOS or Android apps is required. SAP MDK enables the development of multi-channel apps from low-code to pro-code. It allows you to build the application once, in an integrated development environment, and run it natively on mobile devices (iOS & Android) and as a web application in the browser.

Application development is web-based, and the Mobile Development Kit framework uses

  • MDK Editor, which is a standard SAP Business Application Studio space,
  • SAP Mobile Services, which provides enterprise services such as onboarding, offline, authentication, and lifecycle management,
  • MDK Mobile Client is a native application that runs on the device.
  • Apps are developed in the editor visually and deployed to SAP Mobile Services & SAP BTP.

FEATURES

SAP Mobile Development Kit (MDK):

With MDK, the entire app interface is created with a WYSIWYG (What You See Is What You Get) editor, and the layout is taken automatically from the framework. It means that the creation of screens for the app is done using templates already provided by the MDK, and it reduces the efforts of the developer to develop the screen from scratch.

  • It makes use of various drag-and-drop UI elements and wizards. The development editor consists of a page editor to create or manage pages, while the action editor performs multiple tasks, such as controlling the message, navigating data, scanning barcodes, and more.
  • Various rules can be created for additional functionalities, and there is a graphical editor that creates the JavaScript rules. However, you can also create a JavaScript file directly and code it. So, you wouldn’t need to write the functionalities for each landscape (iOS or Android) separately in the respective languages. Instead, it would be automatically handled by the MDK Client at runtime to generate the native code accordingly.
  • The client loads the metadata of the mobile services app at the start and interprets it at runtime. The benefit here is that the application only has to be developed once and can run on iOS and Android. You achieve a native “look and feel”; overall, a “low code” approach is used.
  • These features make MDK a viable option for a developer who wants to develop an SAP mobile solution but doesn’t know the native coding approach via XCode or Visual Studio but are more comfortable with the SAP Business Application Studio approach.
  • The updates can be easily pushed to the mobile client app and updated using the mobile services.

SAP BTP SDK for iOS:

  • With the SDK approach for developing native apps, the app’s interface is created with Apple XCode, which is apple’s integrated development environment for macOS exclusively.
  • The SDK provides different frameworks which the developer can integrate into the XCode project to use different SAP BTP & Mobile services.
  • Apps can be developed with Fiori controls based on the Fiori guidelines for iOS with the help of SAP Fiori Mentor. Native controls can also be used alongside the Fiori controls, giving the developer wide choice.
  • The development is done entirely in the native programing language Swift.
  • With this approach, the iOS native developer is provided with multiple frameworks by SAP SDK that helps the developer in implementing SAP Functionalities such as consumption of OData service from as SAP S/4HANA system through BTP or authentication screens using the BTP’s Identity service.
  • The apps should be built each time to a new version for updates and released to the customers.

Solution

To start with the development of any mobile solutions using the MDK approach or the BTP SDK for iOS approach, first an SAP Mobile Services subscription needs to be created for the BTP sub-account. The SAP Mobile Services dashboard is used to create a native application that is to be used by the MDK for configuration and deployment. This native application acts a metadata of settings for all the mobile services which are provided by SAP such as authentication, application versioning, etc.

In the screenshot above, you could see that a Native application named SAP MDK Demo has been created and it contains different mobile services features such as offline access, app update, mobile connectivity. Each of these features can be configured directly from the dashboard.

The Mobile Connectivity feature of the SAP Mobile Services helps in creating a mobile application which consumes data of an SAP System through the cloud connector of the subaccount or any other 3rd party data sources.

You could also configure the authentication method for the application. For e.g., you could configure the application to authenticate against a SAP System instead of authenticating using the BTP identity service. SAP Mobile Services dashboard could also be used to read the logs that are uploaded from the app to debug any issues.

SAP Mobile Development Kit (MDK):

SAP Business Application Studio (BAS) subscription should also be created to access the MDK Development environment. In the BAS Dev Spaces page create an Dev Space for the SAP Mobile Application.

The MDK development environment looks very similar to the Fiori environment which is used to create SAPUI5/Fiori webapps. Here the developer could create an MDK project using the SAP provided templates or could import an existing MDK project to the workspace or clone it from a git repository. When creating an app using the template, we have the choice to choose a List Detail or CRUD template-based app to be created during project creation itself. A blank MDK project could also be created and app could be developed from scratch.

The native application created in the SAP Mobile Services is also referred in the creation wizard to include the mobile services features like OData service connection through the destination of the Native App Configuration, authentication, users onboarding, etc.

The wizard creates an MDK project and creates the necessary files as well such as actions, pages and rules for the chosen template. It also adds the necessary logics for enabling the application as Offline based app automatically.

Upon creation of an MDK project, the developer has the option of customizing the generated pages for additional content or even create new pages for the application using the MDK layout editor. In the Layout editor we can add new controls to the page by dragging and dropping the control onto the page. Then each controls properties and data bindings could also be configured accordingly in the layout editor itself. The layout editor provides an easy way to design app screens.

Then the project could be deployed to SAP Mobile Services from the Business Application Studio using the commands console. Upon deployment QR Code is created for the destination of the application in mobile services. The app user on the other side could just install the SAP Mobile Client app from Android Playstore or the iOS App Store. The client app would scan the QR code to load the metadata generated in the MDK Development environment and the configurations of sap mobile services features.

The Mobile Client would generate the interface for the MDK app in the runtime using the metadata and would automatically enable the configured features. Once the onboarding is done, there is no need to scan the QR code again as all the details are stored already and the generated interface opens directly.

The below screenshots are some of the app screens that are created using the MDK for SAP BTP and generated on the mobile client app. The looks and feel are very similar to a native android app without even needing to develop in the native programming language which is the very big advantage of this method.

SAP also provides an option to build our own custom Mobile Client application with custom branding logo, app name and pre-configured application destination. So, the end user doesn’t need to scan the QR code for the application, instead it directly onboards the user to configured mobile services native application. Developer could build the custom client directly using the mobile service’s cloud build feature. The other option is to download the MDK to use the standard client app code to make the necessary changes themselves and build it using cloud build feature.

SAP BTP SDK for iOS:

The SAP BTP SDK for iOS provides native Swift frameworks for enterprise iOS app development. It includes well-defined layers (SDK frameworks, components, and platform services) that simplify development of enterprise-ready mobile native iOS apps. The SDK Could be downloaded from SAP Software Downloads. Upon downloading and installation, the SAP BTP SDK Assistant for iOS will also be downloaded.

The Assistant is a macOS app that rapidly generates object-oriented Swift proxy classes for OData services, eliminating exposure to low-level APIs. The Assistant also generates Mobile Services configuration and creates a ready to run XCode project for iPhone or iPad. The main benefit of the Assistant is that it generates your complete model and data service layer in your app based on the metadata document of your OData service. This leaves you far more time focusing on the user experience and business needs of your app instead of building the application from scratch.

In the XCode project the developer can edit the generated screens or create additional screens using the framework provided by the BTP SDK for iOS. Hence the developer has the choice to create an iOS app purely using Swift language UI elements or use the Fiori UI elements which is provided with the SAPFiori framework to design the user experience with reusable design components.

The SAP Fiori framework has access to over 60 different UI controls following Apple’s and SAP’s Human Interface Guidelines. SAP OData framework can be used to consume an OData service through data access layer, and SAP Offline OData to enable offline synchronization connecting to SAP Mobile Services. SAP provides multiple frameworks as such to handle such common functionalities thus reducing redundant code and reducing development time.

During development, you build and run an app many times to test new features and eliminate bugs. Each time you build, XCode analyzes your app’s source files to determine which ones it must recompile. Depending on the state of your project, XCode performs either a complete rebuild of everything, or an incremental build of only the changed items.

When you run an app after a successful build, XCode launches the app on the selected device. Mac apps run on the same device as your XCode installation. iOS, iPad OS, tv OS, and watchOS apps run either on a connected device or in a simulated environment on your Mac. An Apple developer account is required to distribute the generated app to the registered users.

Architecture Diagram

Mobile Development Kit (MDK)

In the MDK architecture, the developer develops the MDK application using the SAP Business Application Studio (BAS) as the development environment through the layout editor. The Business Application Studio and the MDK application uses SAP Mobile Services to access the data from an on-premise system using cloud connector or an 3rd party data source. The application from the BAS is deployed to the SAP Mobile Services and stored in the cloud foundry.

A working application during the synchronization of offline data would push the data to SAP Mobile Services endpoint which in turn pushes the data to the corresponding backend system configured for it in the Mobile Destinations feature. Once the data is pushed, the new data is again fetched by the Mobile Services from the backend system and then forward it to the mobile application. Thus, the Mobile Services destination acts as a proxy endpoint without directly exposing the backend system considering data security.

When an End User uses a mobile client to scan the QR Code of the application, it loads the configuration and generates the interface for the app. When accessed via desktop as an online app, it can be accessed using the deployed app URL which uses the MDK Web Runtime plugin to display the application.

SAP BTP SDK For iOS

In this architecture, the application is developed using the BTP SDK for iOS which acts as additional stack above the Apple XCode project to help in integrating the app with SAP BTP and Mobile Services such as offline, data source, identity service or connectivity to SAP System or 3rd party data source.

In this architecture as well, the offline data synchronization happens the same way where the data is first pushed to mobile services then to backend system. Data is also fetched the same way first to mobile services from backend system then to mobile app.

In additional, the SAP Fiori Mentor app helps in designing and developing different components of the native application using the native programming language Swift. It provides the guidelines and sample code structure for every available Fiori control in the Swift language for the developer to refer to.

Conclusion:

On an ending note, even if you’re new to developing for the SAP Cloud Platform, the SDK makes it simple to connect to back-end services, take advantage of the iOS technology, and incorporate design best practices. The SDK is built on Apple’s powerful open-source programming language, Swift. It implies you can seamlessly call into the SDK and leverage its frameworks, UI elements, and APIs. With the SAP SDK, developers can easily take advantage of a company’s aggregated data in the SAP Cloud Platform and enterprise systems. The cutting-edge iOS features and seamless integration with SAP systems help the developers innovate faster, better, and smarter than ever before.

</p>
<h3 style="text-align: center;">Vishal Raghav</h3>
<h3>

Vishal Raghav

SAP UI5/Fiori Consultant

Vishal is an experienced consultant with a demonstrated history of working as a front end developer. Vishal is skilled in SAP UI5 & Standard Fiori apps development with expertise in SAP Fiori launchpad configuration, JavaScript, QUnit,OPA5, HTML, XML and trained in Java Spring Framework.

Accelerate your Business Transformation with TSP