If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.

Customizing Hybrid Mobile Apps

Last modified: August 20, 2024

Introduction

The Mendix Developer App and generated hybrid mobile apps contain their own index.html file. This index file cannot be edited to add CSS files, for example. However, you can alter the index file indirectly through a file called components.json. There, you can add CSS and JavaScript files. These are the initial contents of components.json:

Standard components.json

{
    "files": {
        "css": ["styles/web/css/main.css"],
        "js": ["mxclientsystem/mxui/mxui.js"]
    },
    "cachebust": "{{cachebust}}"
}

If you want to include more resources, you can add your own components.json file in the root of your theme. Copy the version above and add your own files. This is an example that dynamically adds a JavaScript file to index.html:

Custom components.json

{
    "files": {
        "css": ["styles/web/css/main.css"],
        "js": [
		"mxclientsystem/mxui/mxui.js",
		"myOwnCode.js"
	]
    },
    "cachebust": "{{cachebust}}"
}