The very first step is to install all prerequisites and tools, these are:
npm install -g cordovaor on a Mac:
sudo npm install -g cordova
Navigate to a directory where you store projects on your system. Create a project called "workshop":
cordova create workshop com.yourname.workshop WorkshopNavigate to the project directory:
cd workshopAdd the platforms you want to support. For example, to add support for iOS and Android, type:
cordova platforms add ios cordova platforms add androidMake sure you are in the "workshop" directory, and add basic plugins to your projects:
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console
cordova build iosThe project is built in the workshop/platforms/ios folder. Double-click Workshop.xcodeproj to open the project in XCode, and run it in the emulator or on your device. You can also run the application in the iOS emulator directly from the command line. First install ios-sim:
sudo npm install -g ios-simThen run the application in the iOS emulator:
cordova emulate ios
cordova run androidTo build the project in the workshop/platforms/android folder and run it in the Android emulator, type:
cordova emulate android
cordova create hello com.example.hello "HelloWorld" cd hello cordova platform add android cordova build
Once created, you can use the Eclipse that comes along with the Android SDK to modify it:
Launch the Eclipse application. Select the New Project menu item.
Choose Android Project from Existing Code from the resulting dialog box, and press Next:
Navigate to hello, or whichever directory you created for the project, then to the platforms/android subdirectory.
Make sure both hello and hello-CordovaLib projects are selected to be imported. The hello-CordovaLib project is needed as of Cordova 3.3.0 because Cordova is now used as an Android Library instead of a .jar file.
Once the Eclipse window opens, a red X may appear to indicate unresolved problems. If so, follow these additional steps:
Right-click on the project directory. In the resulting Properties dialog, select Android from the navigation pane. For the project build target, select the highest Android API level you have installed. Click OK. Select Clean from the Project menu.
This should correct all the errors in the project.
You can use the cordova utility to run an app in an emulator, or you can run it within the SDK. Either way, the SDK must first be configured to display at least one device. To do so, use the Android SDK Manager, a Java application that runs separately from Eclipse. There are two ways to open it: Run android on the command line.
From within Eclipse, press this toolbar icon:
Once open, the Android SDK Manager displays various runtime libraries:
To open the emulator as a separate application, select the AVD and press Start. It launches much as it would on the device, with additional controls available for hardware buttons At this point you can use the cordova utility to deploy the application to the emulator from the command line:
$ cordova emulate androidIf instead you work within Eclipse, right-click the project and choose Run As → Android Application. You may be asked to specify an AVD if none are already open.
When exporting as akp you get
conversion to dalvik format failed with error 1Solution Project → deactiviate "Build Automatically" → Export again
R.java has been motified Passiert wenn man corodova buildhappens when you build the project with die corodva CLI and have it opened in eclipse. Solution: Refresh project in eclipse