How to add java project as library in android project using eclipse - android

Can anybody tell How to add java project as library in android project using eclipse?

As is explained in the documentation, you can go into project properties (e.g., Project > Properties from the Eclipse main menu), go into the Android section of the properties dialog, and use the Add... button in the Library group box to pick an Android library project from the available libraries in your workspace.

Maybe take a look here..
Import source java project in Android project
Or you can create a jar file from your project and import it as external jar as described here
hope it helps

For Library Project:
Rightclick->Properties->Android-> tick Is Library
For project in need of import:
Rightclick->Properties->Android->Add...->Library Project

Related

How do i import this project?

Hi I have found this github project:
https://github.com/ManuelPeinado/FadingActionBar
I have tried to import "samples-stock" and "library" into eclipse. Then I assign "library" as a library and add it in "samples-stock".
How would you make it work? I dont understand the authors instructions:
The library is pushed to Maven Central as a AAR, so you just need to add the following dependency to your build.gradle.
Thanks
Does your project, in which you want to use this lib, uses Gradle as build system?
If so, add dependency to build.gradle, as author suggests:
dependencies {
compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar:3.1.2'
}
Else, I believe Android Studio is Intellij IDEA Community Edition, just with android plugin, thus you should be able to add dependency from "Maven" in Libraries. Just copy & paste the
"com.github.manuelpeinado.fadingactionbar:fadingactionbar:3.1.2"
line to the window which opens.
In eclipse:
File->Import->Existing android code into workspace and import library from disk drive.
If you want to run samples that are present in that library you can run them as "Android Application", like any other project.
If you want to use it in your project:
Right click on your project -> Properties -> Android -> Add(select that library) and you are good to go.

Android install external library

I want to use this library https://github.com/koush/ion in my project.But I don't understand how can I install it.I am using Windows 8 and Eclipse.How can I install ?
Download that project and put it in workspace of eclipse and import it from work space to eclipse and make it as library project and add it to your project.
Steps to import:
Right Click on package explorer
Import
Existing Project into Workspace
And then browse to the location where the project downloaded
Import it
Steps to add it as library to your project:
Right-click on your project -> Properties
In Android->Library section click Add
Select recently added project -> OK
That's it!
Now you can use it
You must perform the following steps:
Download ion project code.
Import it in your workspace using eclipse.
Right click in your current project and select Properties. The project properties windows must be opened.
Select Android option.
Go to the bottom of this tab and you can view the Library section.
Add the library dependency using the Add button.
I hope that helps!
You are probably better off downloading the jars vs the source.
https://github.com/koush/ion#get-ion
Download those two and place them in the "libs" directory of your project. If that directory does not exist, create it. From with your Eclipse project preferences, you can add those jars as dependencies.

Project library not getting added to android project

Iam trying to reference a Android project library to my application. I do this:-
1)File->Import->General->Existing project into workspace->Select project library->check copy to workspace.
2)Right click on project->Properties->Android-> Add-> Select project library-> Apply-> ok.
But when I again check if the library is added I get the following:-
How do I resolve this?
Make sure that your library has the same location with your project source files.
It means that if your source is on your workspace , then your library should add into workspace. If not, you should copy your lib into same folder with source then mount it again.
Make sure the library project is checked as a library.
Go to the library projects BuildConfig -> Android -> Check "is library"
Make sure your project and the library project have the same target/min SDK versions.
It's also a good idea to clean your workspace and Build the library project - Right click on library project -> "Build Project"
Try this answer:
The project name needs match the folder name on the file system. What you are seeing in the Project Properties->Android->Library Reference is a relative file system path.
Reference:
In eclipse, unable to reference an android library project in another android project
Thanks to archie-bpgc for comment
i am also facing this problem i have solve this problem like
when import lib in to workspace tick mark as show in picture (basically library project and your project both are in same workspace)
now add lib to your project and clean project
you need to import the project to workspace and the library file into the same workspace.
Then you will not face this error. Kindly the root cause is not known. But this method works.
After all this .. one more way is you can alter the project properties last line where the library file path is specified.
Thank you.

how to use Android CardsUI library in Eclipse?

I am trying to use this library http://www.androidviews.net/2012/12/cardsui/. Import, libs folder and external JAR does not work.
This is an Android library project. It is not an app.
You need to attach the Android library project to your app's project. The process for this is detailed in the documentation. Basically, given that you have already imported the library into your Eclipse workspace, you right-click over your app project in the Package Explorer, choose Properties > Android, scroll down to the Libraries section, click the Add button, and choose your imported library.
You cannot just import the jar file for this project because it requires additional resources such as images. Therefore it needs to be imported as a library project

import a library into my project

I made a project and I want to use the slideMenu library but when I import it the package.R class will be undefined because the attr.xml that found in library res/values. like import offers.findme.com.R;
Try this ...
Once you download the file from site you mentioned and extract it to a given destination, all you have to do (if you're using Eclipse) is
File-->import-->Android-->Existing Android into Workspace , and select that
library location.
And to use it in your projects go to
properties>Android and add the new library.
Hope this helps...
if you use eclipse then start a new project say projectLib from library source
and then configure the build path of the project to include the projectLib and rember to export i with the app
alternatively you could copy the source and resources of your library to your project and instead of offers.findme.com.R look up for your.project.R
You should refer your library project in your android project.
import library project into your workspace and into eclipse.
Right click on your android project. goto properties. Choose android. Click add browse the library project and add the same.
Now clean and build.
For more info check the link below. The link has snap shots if you scroll down
http://developer.android.com/tools/projects/projects-eclipse.html
First you need to import the library as an Android Project.
Then you need to set it as your project's library, by Right-Click your project directory > Properties
There you can mark the library project as your project's library.
After that, Project > Clean your project.
The README file says the steps clearly.
Regards.
There are a invalid line in style.xml that prevent me to access the new library the line was id property

Categories

Resources