how to use android project library in eclipse? - android

I am new in android. I see a lot of android libraries out there like github.com but when I download them none of them are a *.jar file like this one:
NumberProgressBar
It seems that all these libraries are for android studio NOT eclipse (Am I correct? This is important).
My question is: How do I use these libraries in eclipse?
I tried to import the downloaded library as an android project and then mark it as "is library" and then add to my project, but that did not work.

That library is designed to be built with Gradle for Android (with or without Android Studio), producing an AAR.
Eclipse does not have native AAR support. I have published a recipe and a Ruby script to convert an AAR into a library project that Eclipse can use, though I have not tested it much.
Or, you can download the source code and attempt to reorganize it into an Eclipse-style library project.

I just downloaded it and add it as library project and everything looks fine. How do you do it, it's extremely simple. Let us know in which step you have a problem so we can figure out what is wrong.

You have to build the library first.
For your example, read the Readme file, section 'Build'.

Related

android-support-v4.jar showing empty files

I just add external jar(android support.v4.jar) to my project using eclipse IDE.
But it show empty packages.Can anyone guide me how to solve this.?
External jar show empty packages:
I just add external jar(android support.v4.jar) to my project using eclipse IDE.
Not quite. You added support-v4-23.1.1-sources.jar. The key part of that filename, with respect to your problem, is sources. This JAR contains Java source code, not compiled Java classes.
Can anyone guide me how to solve this.?
Google is no longer supporting Eclipse. There is no official distribution of any of the support libraries as simple JARs, or even Eclipse-style library projects.
The simple solution is to move to Android Studio, or possibly IntelliJ IDEA, instead of using Eclipse.

How to use/install certain library in Android Studio

I found this "amazing" library that i think it would look nice in my small project but i don't find how to use it / how to install.
This is the url:
https://github.com/kmshack/Android-ParallaxHeaderViewPager
Thanks.
It seems to be available via Maven (see here). It might be an old version however. You could also import the project into Android Studio, build the jar and put it in your project's libs folder. A third option would be to make it build as part of your own project. For the latter you can use this for inspiration.

Trouble installing OpenCV for android

I am trying to get the OpenCV library working with android. I imported this library project into eclipse and made a new android project (the one I will develop) and just. I set the build path to include the OpenCV project in eclipse. However, when I run my new project, it says
[2014-10-13 19:41:57 - OpenCV Library - 2.4.10] Could not find OpenCV Library - 2.4.10.apk!
From what I understand, my new project should automatically pull in the library project and install it. I am wondering if I am missing any steps (because it doesn't seem to be pulling in the project)? Does it have to be the same target sdk? I am quite sure I followed all of the OpenCV installation guide and have no compile errors in the projects. Also if I load up the sample projects by directly installing the apks they seem to work fine. I even tried it with the OpenCV Manager app already installed but that didn't work either. Thanks for any help.
Just add the OpenCV library project as shown below, the problem will go.
Project -> Properties -> Android
and press OK.
You should check "Library" build option in Eclipse for OpenCV android project.(Not your project)
Clean your OpenCV library,build it again and check in OpenCv library->bin->opencv library -X.X.XX.jar if there is a file (X==> VERSION)(see picture).See this for .jar file. If this file does not exist then your library is not generated then check the video it might help This should help if your library is not built.
My personal experience:I wasn't able to generate the jar file for some reasons using OpenCv2.4.10 .If the same happens to you consider using OPENCVTEGRA library it works at least for me.
Answering 1st time. Hope this helps

I can't figure out how to add Downloader Library and Licensing Library to Android Studio

I'm trying to use Google's Downloader Library and Application Licensing Service since my app is going to use APK Expansion. But the problem is I don't know how to add those 2 libraries to Android Studio. I always import libraries to Android Studio by File -> Import Module and then I select it.
But when I do that this time, it says:
Select modules to import
Even after I've already selected the Downloader Library or Licensing Library.
I also tried importing them by copying the directories to my app directory and then including them in gradle dependencies but that doesn't work either.
Could someone walk me through adding these 2 libraries to my Android Studio because I can't seem to figure it out.
For anyone else coming along with similar problem.
I solved it by importing module (File->New->Import Module) and selecting the licensing and the downloader library folders each time.
Note however that the .project file for downloader has a line that throws Android off (correctly):
android.library.reference.1=../market_licensing
Remove this line and the module imports fine.
Thank you Google once again for your clear instructions and clean environment!!!
BTW: What the heck are they writing in their guide
http://developer.android.com/google/play/expansion-files.html#AboutLibraries
"Select the Properties tab and in Library Repository, enter the
library from the /extras/google/ directory (play_licensing/ for
the License Verification Library or
play_apk_expansion/downloader_library/ for the Downloader Library)."
Does that even make any sense to anyone?!
I solved the problem in a very weird way.
I noticed that I can't import those 2 libraries directly to Android Studio because they are missing a lot of project files and therefore Android Studio doesn't recognize them as libraries.
I then imported both libraries to Eclipse so that everything neccessary was generated and then exported them directly to Android Studio.
That worked like a charm.
Maybe a weird way to import a library but at least it worked.
I just wanted to add a comment that the .project file for downloader should point to correct dependency:
android.library.reference.1=../../market_licensing/library
Now importing downloader will also import licensing which depends and create the correct dependency.
EDIT: That libraries are rather old. I've found new versions here:
https://github.com/google/play-apk-expansion
https://github.com/google/play-licensing
When I tried to import library, I met same issue, and I could resolve by adding 'include ':library-directory-name'
copy your library directory into your project
add "include ':library-directory-name'" in settings.gradle file same as include ':app'

Linking Opencv to my own android project

I want to work on an Android project (under Eclipse) using Opencv, I've imported the Opencv library and it's associated samples to Eclipse, as explained here:
http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package.html.
I tested the samples and they work well. But when I create my new own Android project in Eclipse, it can't link Opencv which is placed in the same workspace as the project (i.e. error when I write import org.opencv.core.*).
Is there something that has to be done for a new project to be linked with Opencv (src and lib)?
I recomend you to download the OpenCV prebuild package and follow these instructions.
I don't know if you are going to use C++ for openCV and crosscompile with NDK and JNI library, but that way is quite easy to set up everything. If you need more help about how including C++ OpenCV codes in android projects I can check my codes. Good luck.
It sounds like you haven’t included the Open CV library’s in your new project.
I can’t remember the exact step to include libraries in projects but below are a couple of link that might help.
http://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project's_classpath%3F
Import Libraries in Eclipse?

Categories

Resources