Creating Apps¶
The Mobile Development Kit extension for Visual Studio Code allows you to create new Mobile Development Kit metadata app definitions (action, CIM, global variable, i18n, page, rule, service, or style) by using the command palette or the context menu on the Visual Studio Code editor.
Creating a New Mobile Development Kit Metadata Project From Template¶
- In the Visual Studio Code editor workspace, open an Mobile Development Kit application folder and click
View>Command Palette. - From the command palette, choose
MDK: Create Project with Wizard. - If you are not logged in to Cloud Foundry, Cloud Foundry Sign In page will appear. You can use the following methods to sign in:
- Credentials - Enter your username and password. Click
Sign in. Select Cloud Foundry Organization and Space. If the login attempt fails, you will not be able to use Mobile Services Data Sources. - SSO Passcode - Click the link to open a new browser page, choose to generate a temporary authentication code, copy the SSO Passcode and paste it back in the Cloud Foundry Sign In page.
- Credentials - Enter your username and password. Click
-
In the
Basic Informationtab:Field Description MDK Template TypeBased on your requirement, select the MDK Template Typefrom the drop-down.Your Project NameEnter a project name. Your Application NameBy default, the project name is considered as the application name. However, you can also provide a different application name. Target MDK Client VersionBy default, the project uses MDK 23.4+or later clients. However, you can select a previous version from the drop-down.Choose a target folderBy default, the target folder uses project root path. However, you can choose a different folder path. Choose
Next. 1. In theService Configurationtab:Field Description Data SourceSelect a source from the drop-down. The available source types are: Mobile Services,BTP Destination,Service URLandLocal File.Mobile Services LandscapeSelect your Mobile Services Landscapefrom the drop-down. This field appears only when you have selectedMobile Servicesas theData Sourcetype. There are three options available for landscape:standard,preview, andneo. The first two options are for the Cloud Foundry environment. If you haveMobile Services Previewedition available in yourCloud Foundryaccount, choosepreview. Chooseneofor the Neo environment.Enable Auto-Deployment to Mobile Services After Project CreationIf enabled, the project will be automatically deployed to Mobile Services upon creation. Application IdSelect an application from the drop-down. This is the application that you've created in mobile services. DestinationUse the checkboxes to select one or more destinations. Service URLEnter the Service URL. This field appears only when you have selectedService URLas theData Sourcetype.Choose XML odata metadata file from your local dev spaceSelect an XML file from the local files. This field appears only when you have selected Local Fileas theData Sourcetype.Destination NameEnter the DestinationNamein metadata.Choose
Next. -
In the Data Collections tab, configure the following fields for each selected destination and then select the required OData collections:
Field Description Enter a path to serviceAppend a path to your OData service if required. Select the Service TypeSelect the service type from the drop-down. The default value is OData.Enable Offline?By default, it's enabled. Select Noto disable it.Select all data collectionsSelect Yesto include all OData Entity Sets, orNoto choose specific ones.Select Data CollectionsSelect one or more OData Entity Sets from the list. All Entity Sets from the service .xmlfile are listed here.If you select multiple destinations, the Data Collections tab is displayed for each selected destination.
Results¶
A new empty Mobile Development Kit application is created based on an embedded empty application template. If the target folder is within the current workspace, the newly created Application.app file is opened automatically. If not, then the current workspace is switched to the new application folder.
The Mobile Development Kit Extension supports creating app definitions via the context menu of workspace explorer and the command palette.
| Command Name | Description | Context Menu | Command Palette |
|---|---|---|---|
MDK: New Application |
Create a new Mobile Development Kit Application | Yes | |
MDK: New Page |
Create a new Page | Yes | |
MDK: New Action |
Create a new Action | Yes | |
MDK: New Service |
Create a new Service | Yes | |
MDK: New Rule |
Create a new Rule | Yes | |
MDK: New Global Variable |
Create a new Global Variable | Yes | |
MDK: New Style |
Create a new Style file | Yes | |
MDK: New i18n |
Create a new i18n file | Yes | |
MDK: New CIM |
Create a new CIM file | Yes | |
MDK: Register Extension Control |
Create a new Extension control file | Yes |