I'm a new user of PhoneGap. My platform is Windows 7 64 bit. I've followed the instructions on the Cordova site and have Node & PhoneGap installed. I already have Eclipse and the ADT installed from my previous work with developing Android apps with Java.
Following the steps at http://cordova.apache.org/docs/en/2.5.0/guide_getting-started_android_index.md.html I'm half way through step 4. I've successfully created the my skeletal hello world PhoneGap app. How exactly do I make an Eclipse project out of it however? The generated files do not seen to include the standard Eclipse .project file. It is not clear from the instructions which exact "new project" menu option to choose.
Thanks if anyone can help.
After creating cordova project through command line, I'm assuming you have added platform using cordova platform add android
Then to load project into eclipse, do this
Eclipse> file > import >Android >Existing acdroid code ..... > Root
directory (Browse button...... Browse to this folder
[yourcordovaproject-platforms-android] select this android folder)>
Check both your project name & cordovaLib > Finish
I figured it out. I had jumped ahead to the "create Android app." step without having run the "cordova platform add android" step first. I ran the add android step, and that did generate the Eclipse project files I needed.
Related
I am new to Phonegap and have succesfully created my first app and compiled first on-line then set up phonegap, android SDK etc locally so I can build and run the app in the emulator using 'phonegap run android' at the command prompt (windows).
For an IDE I installed Eclipse and imported the project. I can now run the project from within Eclipse.
However I am really struggling with the Eclipse build. It's taken days already to solve all the problems and get to this stage but I've reached the point where I can't make progress although it would seem so simple.
The build project option is disabled. It turns on if I add something under 'Builders' under 'Configure Build Path...' but I have no idea what I should be doing here.
I can go back to the CMD prompt and build, refresh in Eclipse and run the modified version but this can't be the right way to do it?
I just need to tell Eclipse to 'phonegap build'. But how?
When you create a project using PhoneGap it creates a Gradle based build which can be opened in Android Studio or IntelliJ IDEA. I recommend using Android Studio for PhoneGap projects.
I know how to create .apk application with eclipse, but right now I have written it with netbeans and I don't know how to do it.
https://blogs.oracle.com/geertjan/entry/procedure_for_android_development_on
here is said to click right mouse button on my project and choose "Export Signed Android Package" but I don't have such option.
Try phonegap cloud build service, it is very good option, you have to remember to generate your app's config.xml before building online. You can build apk,ipa,oct, etc as you wish.I think you have to install some plugins for build using netbeans.Check for plugin as shown:
Tools-->plugins-->Available plugins
Nativly this is not possible with netbeans. However you can build your project simply my command-line:
phonegap run android
However this depends on your platform and your phonegap version, read on: http://docs.phonegap.com/en/3.2.0/guide_cli_index.md.html#The%20Command-Line%20Interface
I can't seem to figure out how to open up my android phonegap project in eclipse. I need todo this because I need to customize some android settings and files specifally to install facebook connect on phonegap 3.0.0. The app runs fine on my emulator, but the problem is that I can't find the local android files to open in eclipse. With ios its easy, you go into platforms/ios/projectname.xcodeproj and it opens your ios build in xcode. With android, it's nothing like this. I'm using this tutorial btw: https://github.com/phonegap/phonegap-facebook-plugin/tree/3.0
The Android Platform Guide has instructions on how you can use an IDE (eclipse) with Cordova 3.0.0 and the command line:
Use the command line to set up the new project:
$ cordova create hello com.example.hello "HelloWorld"
$ cd hello
$ cordova platform add android
$ cordova build
After that, open up Eclipse, select "New Project", hit "Android Project from Existing Code", and navigate to the hello/platforms/android folder that was created. This should load the project into your Eclipse workspace and you should be able to edit the Android files just like in the pre-3.0.0 days.
I've dabbled with Phonegap using Eclipse and the ADT plugins in the past and I'm now trying to get my head around doing this in the new Android Studio IDE.
Since Phonegap v3 seems to rely on some kind of NodeJS commandline installation thingy, of which I know absolutely nothing about, I've downloaded Phonegap v2.9 instead. Also since Android Studio is so new and the documentation seems to only cover importing existing Eclipse projects or projects built using Phonegap's commandline, I'm instead trying to follow old Eclipse documentation.
To get to the point, I've created a project in Android Studio and verified that it runs. I've then created /assets/www and copied cordova.js and a basic index.html file in. I've copied cordova-2.9.0.jar in to /libs and right clicked to 'add as library'. Finally, I've amended MainActivity.java and AndroidManifest.xml accordingly.
The problem though is that when the build gets to 'import org.apache.cordova.*;' in my MainActivity.java file, it's erroring out with 'Gradle: package org.apache.cordova does not exist'.
Could somebody please point me in the direction of some documentation on creating a Phonegap ap using Android Studio (rather than importing in from Eclipse or from something created via Phonegap commandline), or even just describe how I'm supposed to edit the build.gradle file so that Gradle can find Cordova?
Much appreciated.
Ric is really easy to work with Phonegap and ANDROID Studio.
Here is what i am doing:
Creating Phonegap project: phonegap create testproject com.testproject.name Name;
Enter Project directory: cd testproject;
Add Android platform: phonegap build android;
You have your phonegap project ready. Now open Android Studio. Select Import project and follow instructions. If you don't have any plugins added in your project it's preaty pushing NEXT till you get to the end.
That's all. If you need more information tell me will be happy to help you.
If you prefer snapshot you can find a very easy to follow tutorial here:
Phonegap and Android studio
I have tried using Cordova 2.4 & 2.7 to no avail. The project seems to build fine when using the create method in console, except it does not create the whole program structure. The www folder is missing (or assets?).
When I open the project in Eclipse, I can see the assets folder on the left sidebar pane, but there is no children (it is empty).
The default app builds and runs fine (it just says "Hello World, App").
I should note that I tried this in cygwin also, and it came up with an error.
An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...
I am using Windows 7 x64 with Eclipse 4.2.2, Cordova 2.7 (also tried 2.4). I have the ADT plugin installed on Eclipse, and here is a screenshot of my SDK manager.
I have the entries in my PATH variable set that I followed in the Getting Started tutorial.
If anyone has some input or ideas in how to resolve this, it would be greatly appreciated!
Hey If you are creating a project then you have to create a assets/www folder etc,You have to make changes in other files too.
Follow the link below you have all the information you need
http://www.adobe.com/devnet/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html
Be sure to change the cordova version etc,as per your requirement.