Include library from github - android

How to include this library https://github.com/jdamcd/android-crop to my existing android project?
Tried to import it via "Existing Projects into Workspace" and "File System" but I was unable to use the classes of the library.

That project is designed to be built by Gradle (and, by extension, Android Studio). The directory structure of the lib/ project is not set up in the legacy project structure used by Eclipse or Ant.
You would have to create your own Android library project, then:
Copy over the manifest into your library project
Copy over the res/ directory into your library project
Copy over the java/ directory into your library project as the src/ directory in your project
Then, in principle, you should be able to add your own edition of the library project to your app.

Related

Using features of an android library

I have downloaded a library to use in my android application and I added it to my eclipse workspace as a project. After I marked it as a library in the project's properties, I added the library to my app project, but still, I can't access the features of the libraries. Is there something to do before you can start using a library after adding it to a project?
is it a jar? Can you see .jar in lib folder ? you can try this:
your prokects- properties - java build path - Add External JARs - select the jar - (keep it in lib folder)

transform library project in jar (android)

I need to import into my Eclipse project an external library that is given under the project "Library." this: https://github.com/chrisbanes/ActionBar-PullToRefresh
how do I turn the "Library" folder in a file. jar that I can put in my libs folder?
how do I turn the "Library" folder in a file. jar that I can put in my libs folder?
First, that is an Android library project. It depends upon Android resources. It cannot be a JAR.
Second, that is an Android library project set up for use with Gradle and Android Studio. It is not set up for Eclipse users, and the author of the library did not provide Eclipse instructions.
Third, as it says IN REALLY BIG BOLD LETTERS, the project is discontinued.
You will be better served using SwipeRefreshLayout (from the Android Support libraries), or possibly the PullToRefresh-ListView open source project.
You are welcome to reorganize the code from that Gradle project (the "Library" folder you referred to) into an Eclipse project, moving the Java source under src/ and the resources under res/ and try to get it working. However, you will have to use it as an Android library project, not a JAR.

Including Library Projects in Project Android

Is there a way to include a library project in a project without it being a separate project? The ideal situation is to be able to make code changes to the library project and push it to the git repo with the main referencing project.
You can add libraries to your build path.
You can export the library project as a jar file and then you can add that jar file in your libs folder and configure your build path to add it to your project.

NoClassDefFoundError when project imported to Eclipse?

I am working on an app which uses Commonslang.jar libraries. I was trying to setup it on a new system with newly installed Eclipse.The project is not showing any error But when I run the project it force closes with NoClassDefFoundError at each point where I use Commonslang lib.
I dont know how to fix this problem.Please help?
I think there are "lib" folder in your project directory so just change it "libs" instead of "lib" and clean project and check it..
> Note: No need to build path for any third party library
You need to create libs folder in your project and copy that jar file there. Then in eclipse, right-click on that jar file (which is in libs folder) select Build Path and then select Add to Build Path.
Remember: if you are using a jar file in your Android Library Project, and associating that library project with your regular UI
project, it won't be enough. You must need to include that jar file
(as described above) in both of your projects (Android Library and UI
project) to make it work.
Have you added the jar to the Java Build Path?
Go to the Properties for the Project and select Java Build Path -> Libraries tab then add the external jar there.

Android add jar to custom library

I have made an android project in eclipse. This project has a library project:
the library project (marked with "is library") has included a jar file.
this library project does a lot of stuff with the use of the jar file.
in code everything is fine.
The problem is that the reference to the jar file doesn't exist anymore when it is compiled and installed to my phone.
When i add the jarfile also to my base project. Then the program works.
However, i don't believe that this is the right solution.
So what does i do wrong?
You should add a libs folder to your project
Then, add the jar to the folder and right click on the .jar file and go to Build Path, and select Add To Path or Build To Path. This way the library will be a part of your project. This should help.
The library jar you used in your Android Library Project must be manually added to the dependent application project's build path, not the Android library project build path itself, check out API here

Categories

Resources