Mastering the challenge of mobile applications with the MDK
When facing the challenge of providing mobile applications for your users, there are a number of challenges that have to be met. If you have to provide the app for Android and iOS, you will need developers who know Java and Swift, and you have duplicated effort because an app would have to be developed for each platform. Here SAP offers an alternative, the Mobile Development Kit (MDK).
The starting point is an oData – or more recently a REST service. On the NEO platform development work is done in the Web IDE, while on Cloud Foundry the Business Application Studio is used. Because the Web IDE does not have debugging capability, you can additionally use Visual Studio Code with the MDK plugin which would then provide an option for debugging.
If you have the oData service ready, you can generate an app in just a few minutes. For example, the editors provide the functionality to generate the project from a template, including CRUD. Here an overview of the whole entity set is generated on the main page.
In addition, a tabular view of the individual entities (list), a detail page and editing page as well as a page for new creations is created for each entity set.
The MDK also offers the option of an offline app. The app includes these functionalities automatically, i.e. it handles the generation of the offline database and thus you don’t have to worry about the specific oData calls. This is all directly generated and here too is only described via metadata.
The MDK is under continuous development by SAP, e.g. version 3 appeared in March 2019, the current version is 5.0.1 and will be released on 11/16/2020. This version will include many new features. Here is a short selection. A new Layout Master Detail Page has been added which provides a split screen. You can select an object on the left side and display the detailed data on the right. A password input field is also available. In addition, it is now possible to focus on just one field. There is also now, as you are aware of from many apps, a pulldown event that allows you e.g. to update the page when you pull the page down. As of Release 5.0 it is now also possible to connect a REST service.
Finally, here are some quick instructions on how to get to your first app. First, on the SCPMS an MDK entry must be created.
There the connection to the oData service is saved under “Mobile connectivity”. In the example I use the public Northwind Service from oData.org
In the Business Application Studio you can then e.g. create a new MDK CRUD template project.
In the next step we then enter the previously created service destination.
Here you also decide whether offline functionality should be available.
Finally, a selection is made of the desired entity sets and the app is fully generated. This is then deployed by right clicking on Application.app and the menu item MDK:Deploy, then selecting Mobile Services.
Normally, you would then generate a client for Android or iOS, but the “Mobile Svcs” app from SAP is available in the stores and will suffice for our demo. After starting, you must scan the QR-Code from SCMPS under the APIs tab, which you would skip with your own client. And you can already see the result on your smartphone. Here are a few screenshots.