Missing java build path option in eclipse - java

I'm developing a mobile app using phonegap.
When i tried to add third party java libs to android platform by right clicking on project in eclipse , there's no 'java build path' option for adding the java libs .
I believe Eclipse do not recognize phonegap project as a java project , so the option is not visible.
I wonder why most of the online tutorial show such option available in phonegap + eclipse project ? Did i miss something ?
or is there any alternative solution?

Phonegap should have this option, like any other project in Eclipse
If its grayed out then there may be an error within your project.

Can you provide any more detailed errors? Have you tried changing the build path target? Maybe double check to make sure its referring to your JRE as well?

I just realised that those online tutorial doing it in eclipse + android environment and I'm doing it in Eclipse + multi-platform JavaScript environment.
I thought eclipse is smart enough to detect the android code within the phonegap project .

Related

does eclipse come with inbuilt package javax.sound.sampled.*?

I'm currently using Eclipse Kepler for JAVA application development.
I want to create an application that can play sound.
Most of solution available on stackoverflow are using javax.sound.sampled* package. But i did not find it in my eclipse.
Is this package INBUILT ? or is there any way to install this package? Do newer versions of eclipse have this package?
Just update your Eclipse.
Steps:
-Go to Help Option in the Menu Bar
-Click on "Check for updates"
-After it is successfully updated, you will get sound package.
It worked for me.

Trying to setup phonegap "Hello World!" project

Guys i am following this tutorial
but unfortunately, i am not able to configure it, I have stuck at this section:
"Open a Project in the SDK" .
After importing the project in Eclipse it shows 64 errors, most of them are related to packages like:
Description Resource Path Location Type
The import org.apache.cordova.ConfigXmlParser cannot be resolved WhitelistPlugin.java /MainActivity/src/org/apache/cordova/whitelist line 23 Java Problem
Edit:
Ok, I have followed this link:
http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide
and skipped "Open a New Project is SDK".
and directly execute these commands in "cmd":
cordova build
cordova build android
cordova emulate android
It shows in cmd:
INSTALL SUCCESS
Unlocking Screen
Launching Application
LAUNCH SUCCESS
but in simulator there is no application launched.
Please guide me.
Thanks.
First the doc your're following is for an old version, you should have a look at the newest version : http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide
Secondly, do you really want to open the project in eclipse? That's really not something needed unless you need to do some native dev in your app.
You probably can ignore the "Open a Project in the SDK" section and just use the CLI to build and run your app.
If you really want to use eclipse, I think you have this errors because you only imported your app but not the cordova libs. When you use the "Android project from existing code" wizard, make sure you select the platforms/android directory and then select all the projects, especially the CordovaLib project.
And last but not least, you probably don't need phonegap and should use cordova instead. I don't know why phonegap is still refering to eclipse. Cordova now recommends using Android studio instead and maybe importing in eclipse doesn't work anymore with latest versions of cordova/phonegap? check cordova docs here : http://cordova.apache.org/docs/en/edge/guide/platforms/android/index.html
Ok,
I found the work around from this link
I installed the "Blue Stak App Player" and after running this command:
cordova run android
It successfully installed and worked in "Blue Stack".
Thanx.

Can we use Android studio for AOSP development?

Can we use Android studio for AOSP(Android Open Source Project) development, is there a way to do it. I didnt find one. anybody got any idea on this please ?
You can use Android Studio as a IDE for AOSP, since it's just a modified version of InteliJ's IDE.
from AOSP root:
make idegen && development/tools/idegen/idegen.sh
Then just "Open Project" in Android Studio and select the android.ipr it generated.
To import AOSP source in Android Studio or Eclipse, follow the full instructions here :
https://android.googlesource.com/platform/development/+/master/tools/idegen/README
What Pedlar suggested above is one way of doing it. I ran into lot of Jar dependency issues when I tried it with IDEA community edition (Android Studio is a fork of IDEA IDE). The IDE keeps prompting you about duplicate jars etc. The generated project includes framework Java sources as well as App sources. I tried to build an App project which resulted in broken AOSP build. IMHO, IDEA is a great IDE for Java development. But didn't work well with AOSP.
What worked for me is using eclipse to browse/edit/debug framework sources, but build the code from a terminal window. To avoid AOSP build breaks, please create a shadow dir of AOSP (i.e. lndir of AOSP) and use shadow dir for eclipse project.
This is explained at Using eclipse to browse/edit AOSP link in step by step.
If you are working on AOSP, you might want to check Debugging Android framework services.

Android Project with ActionBarSherlock doesn't get built

I implemented the current version of ActionBarSherlock to my Android Project.
Everything works fine and I don't get any errors.
But when I try to debug or export my project I don't get an .apk-file out of my project. Just a .jar-file with the name of my project.
I've read about some problems the SDK had with building projects that contain external libraries but this was at SDK version 14 and so I hope, this bug is fixed...
So there might be another cause for this problem.
Does anybody know a possible solution?
You cannot get *.jar file as the result of building Android project. This seems very strange to me. There must be something wrong with your project settings (if you changed them), or the project you build is of the wrong type (i.e. it is Java Application instead of Android Application).
You didn't mention which IDE do you use, but I assume you use Eclipse.
Make sure you have installed Android SDK and Eclipse ADT correctly (just in case).
Next thing to try is to create a new Android Application project from existing sources (there should be such option during the process of creation).

Eclipse IDE for C/C++ Linux Developers CANNOT run my java application

I installed Eclipse IDE for C/C++ Linux Developers to write some cpp codes. As I understood it, no matter which version of Eclipse I use, it always can be used to writing some java source codes.
I did this:
File->New>Java Project->...
Wrote a simple "hello world". I have confidence that my hello world is correct.
When I wrote my code, Everything went well.
But when I right clicked my new project, I found there was no "Run as","Debug as"
Press Ctrl+F11. It said "the selection cannot be launched, and there are no recent launches"
Run->Run Configurations. I double clicked Java Application. It said "No tab group defined for launch configuration type org.eclipse.jdt.launching.localJavaApplication"
What should I do?
How can I run my java applications?
Quite contrary to what you assume, eclipse isn't a Java IDE with some other addons. Eclipse is just a platform. As the package comparison shows, the C/C++ package doesn't come with the Java development tools.
Make sure you have correct eclipse version is downloaded? There will be separate eclipse version available for Eclipse for java.
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigor
Hope this help.
If you have the JDT installed, then make sure you are in the Java perspective. Either:
Window->Open Perspective->Java (default)
Use the perspective switching tab, usually the top-right of your code editor
You can install the JDT, if you don't have it by using:
Help->Install New Software...
Try to install follow this link http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/indigor if it's work. i think your eclipsec/c++ may be have a problems while install java. You can reinstall or using eclipse for java.

Categories

Resources