Fork us on GitHub

TIP: Global Settings

"Hidden" feature in Codename One Settings you might have missed
TIP: Global Settings

TIP: Global Settings

A somewhat hidden feature of Codename One Settings is the ability to define global settings. Global settings are useful when you have multiple projects and would like to use common defaults. E.g. we have standard certificate definitions for iOS/Android that allow us to just send a device build on a new project without configuring anything.

For iOS this can only work for debug builds and won’t allow features such as push etc. It requires some work…​
The global settings toggle button
Figure 1. The global settings toggle button

A good use for this is in the Android settings where you can define one certificate for use with all your apps. For iOS you can define the same certificate for all applications as they don’t change between apps. However, you would need a different provisioning profile so for distribution you will need to re-run the wizard and generate only the provisioning.

There is a trick for iOS where you can create a "generic" provisioning profile to the * package/identifier. This can be done via the web UI on apples developer site here: https://developer.apple.com/account/ios/profile/

You can generate an "AllApps" provisioning profile and save it to your disk, then point the debug provisioning to that. Once this is defined, new projects will build on iOS without a single change.

Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.