To make it clear, I'm aware on how to import a library from github to my eclipse workspace and that isn't the problem.
I'm trying to import https://github.com/MartinvanZ/Inscription. If one were to look at the library, you'd see that the actual library isn't in the root but in a seperate folder.
Example:
Git Library
library(folder)
sample(folder)
random files (licence, readme, etc)
I just want to import the library folder as a android project and then modify it and when I push it to the repo, it just gets pushed to the library folder.
How do I do this? If not possible, what can I do similar to what I want?
I believe the problem here is that the library in question does not contain the files required to be imported directly as an Eclipse project. Specifically, it is missing .project and .classpath files. To get this project into Eclipse, you'll have to create a new project. Select File -> New -> Android Project and the pick the option that says "Create project from existing source."
This should create the required .project and .classpath files, without harming the .git directory.
Related
I want to use the API from Maps.Me. I've
downloaded the repository from github
extracted the files
copied the lib folder
created a libs folder as ...AndroidStudioProjects[MyApp]\app\libs
pasted the lib folder into the libs folder
The instructions on github say I should then "add the library project to [my] project". My problem is that all the advice I can find here and elsewhere online assumes that I will have a jar file which I will now see in Android Studio. I don't have a jar file and I can't see a libs folder anywhere in the Project tab on Android Studio.
(The libs folder that I have created contains the folders and files that I would expect to see in an Android Studio project folder, namely res and src folders and AndroidManifest.xml, build.gradle, build.xml and project.properties files)
What do I do next?
One thought is that I should import the downloaded library as a new project into Android Studio and then create a jar file from it. Would this work? Perhaps there is an easier way?
In case it helps anyone coming to this thread in future, I'll describe how I have worked around this issue.
As can be seen from the comments, I failed to import the library into my app in Android Studio, despite all the helpful guidance from CommonsWare. If I were more familiar with Android Studio, and Gradle specifically, I hope that I would have been able to succeed. However, I have followed a route which, for me with my limited experience of Android Studio, is more straightforward.
For each class in the downloaded repository I added a new Java class to my app with the same name.
I did not include one of the classes which included a dialog and relied on a layout and other resources, since I knew that I would not need this class
I copied all the code, except in each case for the package name, from each class in the depository and pasted it into the new classes.
I removed from the code that I did copy the one reference to the missing class
the result was code that worked exactly (so far as I know) as if I had imported the library.
Obviously, the result is inelegant, but for an app that is solely for my personal use it is good enough. It works.
I need to import this library project into my eclipse. While i am trying to use this project it have some error. Can you help me on this. https://github.com/daimajia/AndroidImageSlider
That project is created for use with Gradle for Android. Eclipse does not support that yet. It is also distributed as an AAR, which Eclipse does not support. There are recipes for converting AARs into Eclipse-friendly Android library projects that you can try. Otherwise, you will need to reorganize the project code yourself to support the classic Eclipse-style project structure. Mostly, that will involve moving the contents of library/src/main/ into a regular Eclipse Android library project:
The res/ directory and AndroidManifest.xml file would go in the library project root directory
The java/ directory would be renamed src/ and also go in the library project directory
However, you will have to repeat this process each and every time the library's author updates the library, at least for those updates that you are interested in.
You may wish to see if there is an alternative library that meets your needs but is better packaged for use with Eclipse.
Basically there are some changes to be done to eclipse project before importing it to eclipse like src folder.
The project you posted may contains many error since it have two more android project dependency.
I tired to convert above project with its dependency :
Checkout Complete Source Code
There is one more project lib u need to add LIB
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.
I imported an Android project into Eclipse (Custom ADT). During the import process, I chose to copy project into Workspace.
My project could compile and run well but after sometime, it stopped working. When I check in the 'Problems' View, I see that it still looks for the BIN folder in the folder from which the project was imported and it can't find the library it wants to reference.
Aren't Libraries copied along with the project in Android? How do I fix this?
A good way to add external JARs to your Android project or any Java project is:
Create a folder called libs in your project's root folder - you already had this
Copy your JAR files to the libs folder
Now right click on the Jar file and then select Build Path > Add to Build
Path, which will create a folder called 'Referenced Libraries' within your
project
By doing this, you will not
lose your libraries that are being referenced on your
hard drive whenever you transfer your project to another computer.
You need to place the Libraries into your libs folder before you copy/import. Because if you just added the Library over the Build-path its just copy the Reference, not the Library itself.
How can I easily import the whole reposition from git (bitbucket) using EGit in Eclipse that contains 3 Eclipse projects (one end-project and two library projects) into default git folder, if my Eclipse workspace folder already contains library projects?
After warning on the picture:
My libraries projects are not found because they are in a different folder than the library projects. I would like to avoid putting my git local reposition in eclipse workspace or changing project.properties to link to the absolute path of libs.
or changing project.properties to link to absolute path of libs.
That is actually a good solution, since you can declare a library:
relative to a project location (or the workspace location),
or using linked resources, as in this answer (and this blog post)
That should help allowing you to import only TwistedCircle, because its properties would refer to other projects relative to the project or the workspace folder.