This project enables developers to create Cordova (HTML5/Javascript) hybrid native apps with Codename One.
##License
##Prerequisites
- JDK 8 or Higher
- ANT
- Netbeans with Codename One Plugin Installed
- Download latest cn1-cordova-tools.zip, and extract locally.
From the terminal or command prompt:
$ cd cn1-cordova-tools
$ ant create -Did=com.example.hello -Dname=HelloWorld
This will create a new Codename One netbeans project at cn1-cordova-tools/HelloWorld with the "packageName" set to com.example.hello
and the app's name "HelloWorld".
Open this project up in Netbeans to start working on it. You'll find the app's www files (e.g. index.html etc...) inside the src/html directory of the project.
This project will include two subdirectories worth noting, that aren't part of a normal Codename One project:
- "plugins" - Contains Codename One library projects for plugins associated with this app.
- "cordova-tools" - Contains an ANT build script with targets to help manage the cordova-related aspects of the project. E.g. install plugins, and refresh the project with new plugin cn1libs are added. Read the CLI Usage Instructions
By default the project is generated inside the cn1-cordova-tools directory. You can change this to a different directory using the -Ddest=</path/to/dest
command-line flag. E.g.
$ ant create -Did=com.example.hello -Dname=HelloWorld -Ddest=/Users/shannah/NetbeansProjects
From the terminal or command prompt:
$ cd cn1-cordova-tools
$ ant create -Dsource=</path/to/cordova/app>
This will create Netbeans Project inside the cn1-cordova-tools directory with settings (package id and name) matching the app specified in the -Dsource
argument. The contents of the app's www
directory will be copied to the project's src/html
directory.
This project will include two subdirectories worth noting, that aren't part of a normal Codename One project:
- "plugins" - Contains Codename One library projects for plugins associated with this app.
- "cordova-tools" - Contains an ANT build script with targets to help manage the cordova-related aspects of the project. E.g. install plugins, and refresh the project with new plugin cn1libs are added. Read the CLI Usage Instructions
NOTE: You can also specify the -Ddest
parameter to specify an alternate output directory for your project.
Read the full cn1-cordova-tools ANT task CLI Usage instructions
See the Plugin Development Wiki Page