having issue with eclipse library - java

I am new to Droid development using Eclipse. I am trying to use PinnedSectionListView found here: https://github.com/beworker/pinned-section-listview
What I need to understand is how do I import that into my project? Do I need to load the project and create a .jar? I thought to use libraries like the one here it needed to be a .jar lib. I am a bit confused on how to use github libs like that. Also, not a big deal, I am fluent in c/c++/c#/objective c, but I am new to java. Code I can handle, eclipse ide, jar files, etc. not so much.
Any steps would be helpful, or a pointer to an example. Thanks for any help.

You have to download the library folder! Then import it in your Eclipse from the File menu! After you have done this, you have to right click your project and reference the imported library as a library project in your original project!
http://www.androidbegin.com/tutorial/implementing-actionbarsherlock-in-android/
This is a link for another library but the steps are the same.

Download and unpack the zip file
In Eclipse's Package Explorer, right click and select "Import..."
In the Import dialog, select "Existing Android Code into Workspace"
Select the dir of the unpacked file, and click "Finish", the library is now part of your workspace, which leaves the last thing to do:
Right click on your primary project and select "Properties", in the Properties dialog, select "Android" in the left panel, then click on "Add" button on the right side of the panel, select the library, click "Ok". Now you are ready to use its classes and resources.

Related

How can I import / use StdDraw in java eclipse?

I have found 3 questions similar to mine and none of them helped me at all (some of them even had some down votes, the answers I mean).
I wanted do an old homework for learning purposes and it's saying that we can use StdDraw function of java. (What we are supposed to do by the way is drawing the pythagoras-tree!)
But I haven't found a way to import that in java, either it was outdated or it was explained very complicated. : /
"StdDraw" is not part of the Sun/Oracle Java distribution (and never was), which is why you're unable to import it. I'm guessing that you're referring to a Java class that was developed at Princeton University for educational purposes as part of their stdlib.jar library:
http://introcs.cs.princeton.edu/java/stdlib/
Download that jar to your computer. Assuming that you've already created a project in Eclipse:
Right click "Project" and select "Properties"
Select "Java Build Path"
Select "Libraries" tab
Click "Add external JARs..." and select the jar you just downloaded
You should now be able to import StdDraw into your app.
1) Right click on (default package)
2) Build path, configure build path
3) libraries tab
4) Click on Class path
5) Add External JARS.
This worked for me. Other people might say to click on "Add external class folder" if this doesn't work click "add external jars".

Eclipse & Spigot - Trouble attaching source

I've been trying to find a way to attach source into eclipse. I built the spigot.jarand decompiled it into a zip file using JD. Here is the file if you want to take a look at the zip. Now what I'm having trouble doing is attaching the source to a project in eclipse. Yes, I of course have it in my build tools,
but I want to inspect some class' to see if I am using sockets/packets correctly. Here is the picture that eclipse gave me. I've already attached the source to that zip, but it wont work.
Any ideas?
You need to add the built jar file the buildpath of your project. In eclipse just right-click your project, click on "Properties", select "Java Build Path", select the tab Libraries and click on the button "Add External Jar" on the right side. Then choose the Bukkit/Spigot jar file you want to work with and build against on export.
If you need a detailed video tutorial on it:
https://www.youtube.com/watch?v=7dyopdta7ZI

How to import one Eclipse project as a library into another?

I would like to use one of my eclipse projects in another one. Is there a 'smooth' way to do that, without having to export one as a jar file and importing it into another? Especially since I work on both project simultaneously, I would like the latest changes from the imported project to be automatically built and imported into the other one. Is that possible?
It is possible. Right click on your project -> Build Path -> Configure Build Path. Switch to the Projects tab and add one. It will work as a library.
P.S. You might also want to check this: Creating a java library with Eclipse
Answer to this question explains how to import your own library in eclipse.
Quoting from the answer.
Just have "Project" reference your "Library", on windows the process
is (using menu / tab names)
Go to: Project -> Properties -> Java Build Path -> Projects
Client Add...
Select your "Library" project from the list
Click Ok
Click the other Ok Now your done and you can use import for classes in your "Library"

Android dependancies configuration

I am going through the Android app tutorial here:
http://developer.android.com/training/basics/actionbar/styling.html
As part of what I am doing I added in the appcompat library as part of adding in the themes. Not sure how I got to this point but when I try to run the app I get the error :
"The container 'Android Dependencies' references non existing library 'D:\eclipse-bundle\sdk\extras\android\support\v7\appcompat\bin\android-support-v7-appcompat.jar'"
The library DOES exist, just not at this location. It is located at:
D:\eclipse-bundle\sdk\extras\android\support\v7\appcompat\libs\android-support-v7-appcompat.jar
There does not appear to be any way to edit this property. How do you fix this problem? what is causing it?
Thanks in advance for any help.
Make sure you follow this step to add .jar files.
In the new library project, expand the libs/ folder, right-click
each .jar file and select Build Path > Add to Build Path. For
example, when creating the the v7 appcompat project, add both the
android-support-v4.jar and android-support-v7-appcompat.jar files to
the build path.
I had the same issue so I CMD+Q'd Eclipse and re-opened it.... magically worked. I guess "turning it off an on again" works sometimes :D
You can select your project on eclipse, then right-click...
A menu should appear, you can click on "properties".
A flying screen should appear, you can click on "Java Build Path"
Another flying screen should appear, you can click on the tab "Libraries"
This tab actually hold references to what is in the "libs" folder, and you can delete your old lib and insert your new lib (with the correct path) there.
Would not recommend any of it, actually... Please just import the "support lib project" into your eclipse workspace and make your project reference the imported project as a "lib project".
That is way more handy, and will actually give you a better flexibility for doing more stuff with compatibility lib.
And also, since it is on your workspace, you are the one that compiles it. No future lib reference problems \o/

Can I import a source folder from Eclipse into Flash Builder?

I have the source folder from a friend's Android app and I am going to do all of the design for the app. If I could import the folder that he gave me from Eclipse, it would be easier to create a nice UI for the app.
Is this possible? If not, can I load the XML files into Flash Builder to make the UI?
EDIT: To clarify, I have a project file that I can open in Eclipse. I want to edit the appearance of the project using Flash Builder without interfering with the application's functionality.
I'm not entirely understanding if the first part is asking to import it back into Eclipse, if this is the case, then yes you can.
You can go about this by opening up Eclipse, then go to File > Import... > General > Existing Projects into Workspace. Once in there, you need to navigate to the source folder's location and click on the folder containing all of your project (bin, res, assets, gen, etc.) and then you should see a project appear in the window below the browse buttons. Make sure to check (click) the project you want to import and hit finish.
It should appear in your workspace now in Eclipse.
You can then just treat it as a normal project.

Categories