Import a library into Android/Java program without using Eclipse - android

I want to know how to import a custom library into my Android/Java program. I want to develop with AndEngine but I don't know how to import libraries manually. :P

Try to use Maven for create android app. Install with maven your lib and add it as dependency in pom.xml
then try to build it with maven.

Try this,
Add the Lib folder on your project. On that folder you should placed your jar files.
After that, Right click on your project and choose the buildpath from appeared menu. There's you can see,
libraries tab->Add Jars->please goes to your project Lib folder(created by you)->jar files.

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.

importing FlowTextView in project

i'm try to import FlowTextview library into my android eclipse project but i can't add it as an android library project
Alternatively, you can try download the jar directly. And put it in the libs folder.
I suppose that works.
I have used flow text view in the past. To add it as a dependency,
Import it to your work space
Go to your Android project, click on Project -> Properties
Click on Android.
At the bottom, you have the option to add a library to your classpath, click it and add flow text view's project.
Assuming you are using Eclipse

Android + Eclipse How to import Enhanced ListView project into mine?

I'm a little newbie on Android programming and the Eclipse IDE.
And I'm having some difficulties to import this lib/project (how do I call it?) into my currently project.
The link to the GitHub repo:
https://github.com/timroes/EnhancedListView/wiki
There the author wrote a "How to include", but I tried the last one (by my one), since I use Eclipse.
"How to include
You need to include the library into your project, by one of the
following ways:
Include it from Maven Central (recommended)
Just enter the following line to your build.gradle file in the dependencies section:
compile 'de.timroes.android:EnhancedListView:X.Z.Y#aar'
Where X.Y.Z is a valid release. You can find all releases on the release page or directly in Maven Central.
If you use Maven to build, just use the above coordinates in your pom.xml.
Download the aar file from the release page and reference it in the dependencies section of your build.gradle:
compile files('libs/EnhancedListView-X.Y.Z.aar')
If you are using Eclipse or Ant, you are on your own. You most likely want to download the sources and import them in your build system."
I tried to include it to the build path, but didn't work. Nothing found on internet. Do I have to include something besides adding project into build path? Do I import it like a lib or project?
Do any of the others options to include would work for me? How do I do it?
Thank you very much!
There is no one click method for Eclipse users. You have to copy the EnhancedListView.java into one of your src packages, the content of the resource directories into your project's resource directories and the annotations.jar from the libs directory to your libs directory.

After importing does not see the library

After importing next problem, does not see the library as I understand.Tell me how to solve the problem
Again, I imported the project, now Screen is not quite empty but not full
aaa Sorry decided I did not put the settings
How did you do the import? I'm not too sure I understand your project structure. Do you have an available JAR file of the library you need? If you do, create a /libs folder in your Android app. Build the project and the import should be available.
If you are importing a library project, right click on your main project, choose Properties then Android then under Libraries, add the library project you need.

How to resolve javax.xml.bind.* imports in Eclipse? [duplicate]

In my Android app I use:
import javax.xml.bind.JAXBContext;
But I get:
The import javax.xml.bind cannot be resolved
I do have com.viewstreet.java.eclipse.jaxbplugin.JAXBPlugin in my plugins list.
#commonsware is correct , just add respctive JAXB API jars in lib folder of your projet or in case of maven project add dependency in pom file
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
viz in my case on linux, solved the issue
Go to https://javaee.github.io/jaxb-v2/ and download the standalone distribution (link at the very bottom of page).
jaxb-ri-2.3.1.zip or whatever version is the latest shall be downloaded. Unzip it and copy the jaxb-ri\mod\jaxb-api.jar from the unzipped folder into the plugins folder of your eclipse installation directory.
Go to eclipse, open your project, right click project name in Projects panel (left most) and choose Properties => Build Path
Under Libraries tab, select Classpath and then click Add External JARs button. Browse and select the file you just copied to eclipse's plugins folder.
Click Apply and Close
Just import your required javax.xml.bind classes and your project shall be built instantly.
Put the JAR in the project's libs/ directory, then add it to the build path via the Add JARs button. That's my standard recipe, and it seems to work, and it has the advantage of putting the JAR in the right spot for command-line builds as well.
At this point, though, I suspect that you will get a compile error. Generally, you cannot import classes in the java and javax packages into an Android project.
Download jax-b.jar and add it as external jar in your project.
Any import cannot be resolved in Java means a class you referenced is not found anywhere on the classpath. You need the library you're trying to use added to your classpath. In Eclipse, that's in project properties in the Java Build Path => Libraries tab. If you don't have the jar file that contains the API you're trying to use, you probably need to get it from http://jaxb.java.net/.
Adding a library/JAR to an Eclipse Android project

Categories

Resources