ant, java, node.js, phonegap, and my adobe account are all setup properly. The getting started guide says I should be able to type:
cordova create hello com.example.hello "HelloWorld"
to create a phonegap project. This does not work but following these instructions and doing:
phonegap build android
does eventually get me a .apk file. But the getting started guide tells me to open eclipse and navigate to the directory of my project and then set the subdirectory as /android. but /android does not get created when you do phonegap build android
so I have nothing to work with.
How do I get phonegap to create the android directory? I am trying to finish the getting started guide instead of taking shortcuts.
The same is true here: Cordova is the open source version of the framework, while PhoneGap is the Adobe-branded version. In the end, there is little difference between the two efforts. There are some slight differences in the command-line interfaces, but the functionality is the same.
Apache Cordova Is Retired: Alternatives for Cross Platform Mobile Development in 2022. Future trends of cross-platform mobile development are already starting to emerge, and it appears that Apache Cordova won't be included in the list of frameworks that power hybrid web apps for mobile devices.
Cordova-Android requires the Android SDK, which can be installed on either macOS, Linux, or Windows. For the base system requirements, see the Android Studio's System Requirements.
It does seem like you are using PhoneGap 3.0 and for this version, eclipse is not required (only if you want to use it for coding - compared to PhoneGap 1.0-2.x where eclipse was used to compiled the app, for the latest version it is no longer a requirement).
To begin, you should use the phonegap
command instead of the cordova
command: phonegap create hello com.example.hello "HelloWorld"
Then navigate to /HelloWorld/
folder
You should see atleast these two key folders /www
and /platforms
. Inside /www
is where you place your HTML files and codes, and /platforms/android
gets generated when you compile the app with the following command: phonegap build android
.
Note: Avoid making any direct changes to files inside /platforms
except for config and manifest files. The other files are dynamically generated when you run the build
command. All coding should take place within /www
.
One more thing, use the 3.0.0 Getting Started guide.
---- February 2014 Update ----
With the release of Cordova 3.3.0, it seems the PhoneGap team is trying to address the naming confusion. The documentations have been updated to recommend people using the cordova
command instead. Do not use the command anymore.phonegap
Here is a fresh installation guide for a guaranteed trouble free set up:
Install Cordova (forget the name PhoneGap from now on). For PC:
C:> npm install -g cordova
From command prompt, navigate to the folder you want to create your project using:
cordova create hello com.example.hello HelloWorld cd HelloWorld
Define the OS you want to suppport, we'll go with Android for this example:
cordova platform add android
Install plugins (If needed). For example we want the following:
cordova plugin add org.apache.cordova.device cordova plugin add org.apache.cordova.camera cordova plugin add org.apache.cordova.media-capture cordova plugin add org.apache.cordova.media
cordova build androidor to directly install the app to your connected device:
cordova run android
Here is a link to the PhoneGapCordova 3.3.0 Documentation
http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface
First of all, you should be using phonegap
instead of cordova
to create the project folder structure.
phonegap create hello com.example.hello "HelloWorld"
And secondly, please note that build
command uses two way to build for any specific platform. One using the phonegap build API (online)
using the below command
phonegap build android
and second one locally using below command,
phonegap local build android
So you should try to use the second command for creating the android specific folder and use it with eclipse. You can look for more details over here http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface
When you run the build local
command, android folder is created inside the platforms folder, and you should always modify the code(html, js, css) on the www folder present outside the platforms folder.
The changes will get reflected once you again run the build
command. This helps you maintain single code base for multiple platform ( which is the basis aim of using Phonegap)
Note: you need to have latest android sdk tools (vs18) to run on Android SDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With