Creating Apps in SAP Business Application Studio (Cloud Foundry)¶
Setting Up the Editor in SAP Business Application Studio (Cloud Foundry)¶
To create and develop applications using the Mobile Development Kit editor feature, you must first enable the feature on SAP Business Application Studio. It isn’t enabled by default.
Note
This procedure is applicable in the Cloud Foundry environment.
- Open
SAP Business Application Studio
and log in with your credentials. - Choose
Create Dev Space
. - Enter a name for the
Dev Space
. - Select
SAP Mobile Services
application type. -
Choose
Create Dev Space
.Newly created development environment is listed in your
Dev Spaces
. Choose the newly createdDev Space
to launch the editor in SAP Business Application Studio.Note
If the development environment is in
STOPPED
state. It is required to start the development environment to launch the editor.
You can now use the Mobile Development Kit editor feature to create and develop your project.
Creating or Editing App¶
Creating a New Project (Cloud Foundry)¶
Create a new Mobile Development Kit project by using the predefined templates provided with SAP Business Application Studio.
Note
The prerequisite is that you've configured a mobile application on mobile services.
Select the desired template type based on your requirements and the actions supported by each template, as described in the following table:
Template Type | Logout/update | Online/Offline | List Detail Pages | Editable |
---|---|---|---|---|
Empty |
Yes | No | No | No |
Base |
Yes | Yes | No | No |
List Detail |
Yes | Yes | Yes | No |
CRUD |
Yes | Yes | Yes | Yes |
- Log on to SAP Business Application Studio and navigate to your workspace.
- On the welcome screen, choose
Create project from template
. SelectMDK Project
template and chooseStart
. -
In the
Basic Information
tab:Field Description MDK template type
Based on your requirement, select the MDK template type
from the dropdown.Your Project Name
Enter a project name. Your Application Name
By default, the project name is considered as the application name. However, you can also provide a different application name. Choose
Next
. -
In the
Service Configuration
tab:Field Description Service File Name
Enter a service name. OData Source
Select a source from the dropdown. The available source types are: Mobile Services
,Cloud Foundry
,Service Url
andLocal File
.Application Id
Select an application from the dropdown. This is the application that you've created in mobile services. Destination
Select a destination from the dropdown. Cloud Foundry destination
Select a destination from the dropdown. This field appears only when you have selected Cloud Foundry
as theOData Source
type.Enter a path to the OData service
Append a path to your OData service if required. Service Url
Enter the Service Url
. This field appears only when you have selectedService Url
as theOData Source
type.Destination Name
Enter the DestinationName
in metadata.Local dev space XML
Select an XML file from the local files. This field appears only when you have selected Local File
as theOData Source
type.Language URL
sap-language
is the default value. However, you can provide a different value.Enable offline
By default, it's enabled. Select No to disable it. Choose
Next
. -
In the
OData Collections
tab, select the required OData collections.
The newly created project is now available in your workspace.
Project Settings¶
After you have created your new Mobile Development Kit project, a .project.json
file is automatically created under the project folder. This file contains all the information you need to connect to mobile services.
{
"Credential": "cf",
"Onboarding": {
"Schema": "",
"URL": ""
},
"CF": {
"Target": "",
"Organization": "",
"Space": "",
"Deploy": {
"Destination": [
{ "CF": "", "MDK": "" }
]
}
},
"MobileService": {
"AdminAPI": "",
"AppId": "",
"Destination": []
}
}
How to generate .project.json
file if this file is missing in your project:
-
Command
MDK: Deploy
On triggering this command, a prompt will ask you to enter required mobile services information. Then the
.project.json
file will be generated and deploy process will start. For more details, see Deploying to mobile services.Note
If the
.project.json
file is already in your project. It will deploy directly without any prompt. -
Command
MDK: Sync Service
On triggering this command, a prompt will always be showed to ask you to enter required mobile services information. Then the
.project.json
file will be generated. Also the information in.project.json
and local.xml
files will be updated.
Deploying to Mobile Services¶
This topic describes the steps to deploy the generated bundle.js
and bundle.js.map
to mobile service on Cloud Foundry.
-
To trigger the deploy command, perform one of the following sub steps. Select
MDK:Deploy
menu item to trigger the deploy command.- In file explorer panel, right click on node Application.app and select the menu item
MDK:Deploy
. - In command palette, select
MDK:Deploy
.
- In file explorer panel, right click on node Application.app and select the menu item
-
After selecting
MDK:Deploy
.- If the
.project.json
file already exists in your project, it will deploy directly without any prompt. - If the
.project.json
file does not exist in your project, it will prompt you to enter Cloud Foundry information: Cloud Foundry endpoint, organization and space. If you have not logged in to Cloud Foundry, you also need to input username and password to log in first.
- If the
Developing App in SAP Business Application Studio¶
Features supported by Mobile Development Kit editor in SAP Business Application Studio are similar to the features supported by Mobile Development Kit extension for Visual Studio Code. Features supported are:
- Editing Metadata
- Validating Apps
- Creating Apps
- Creating and Bundling Extensions
- Component Application Development
- User Settings
- IntelliSense and Code Navigation Support for Extensions