Anatomy of a MobileFirst project
The file structure of a MobileFirst project helps you organize the code that is required for the apps.
When we develop mobile apps with MPF, all development assets including source code, libraries, and resources are placed in a MobileFirst project folder.
<project-name> Root project folder adapters Source code for all adapters belonging to the project apps Source code for all applications belonging to the project bin Artifacts resulting from building adapters, apps, and server-side configuration and libraries components Source code for all shell components belonging to the project www Source code of the Dojo JavaScript framework, if installed as part of MobileFirst Studio server conf MobileFirst Server configuration files, such as worklight.properties and authenticationConfig.xml java Java code that must be compiled and packaged into jar files deployable to the MobileFirst Server lib Pre-compiled libraries that must be deployed to the MobileFirst Server services Description, at development stage, of back-end services discovered for consumption by the applications in the project
Initialization options
The initOptions.js file is included in the project template. It is used to initialize the MobileFirst JavaScript framework. It contains a number of tailoring options, which we can use to change the behaviour of the JavaScript framework. These options are commented out in the supplied file. To use them, uncomment and modify the appropriate lines.
The initOptions.js file calls WL.Client.init, passing an options object that includes any values we have overridden.
Content of the www folder
If we installed the Dojo JavaScript framework, the www folder contains a minified version of Dojo Mobile libraries. This minified version contains all the Dojo mobile components. If we need to add more Dojo components or Dojo features to the application, see the topic Create Dojo-enabled MobileFirst projects.
Parent topic: Develop hybrid and web applications