How to use/install certain library in Android Studio - android

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.

Related

Using TabLayout in Android Eclipse project

I am trying to use a TabLayout in an Android project using Eclipse and Andmore but haven't been able to find a jar containing the required android.support.design.widget.TabLayout class.
Googling a bit, it seems I need the com.android.support:design:22.2.0 library. However, the latest version I can find in my SDK installation (under extras/android/support) is v17.
Where can I find this library (without having to migrate to Android Studio)?
Update your sdk using sdk manager.
With the help of a few other answers I finally managed to import everything. Putting it all together, just copyiing the jar into libs will not be sufficient. Here's how it works in Andmore (ADT should be similar but some options apparently differ):
Make sure your SDK is up to date. Specifically, you want the latest version of Extras > Android Support Library (should be version 22 or higher) and a matching version of Tools > Android SDK Build-tools.
If you have a copy of android-support-v4.jar in the libs folder of your app's source tree, replace it with a recent copy from <sdk>/extras/android/support/v7/appcompat/libs. (If you have other Android support JARs in that location, you may need to update those as well.)
Copy <sdk>/extras/android/support/v7/appcompat and <sdk>/extras/android/support/design into your workspace folder. (Not really necessary, but using a local copy will prevent polluting your SDK setup with Eclipse-generated files.
Select File > New... > Android Project.
Select Create project from existing source and select your copy of the appcompat folder. Be sure to select at least API 22 as a build target (I needed to use API 23, YMMV), and don't forget to give it a meaningful name.
When import has finished, open the properties of the new project, go to Android and check Is Library.
Repeat the same two steps to import the design library. After import, in its project properties, go to Android, and in Libraries add a reference to the appcompat project.
Open the properties of your app project, go to Android, and in Libraries add a reference to the design project.
I had to make some minor modifications to my source code as some resource identifiers are no longer constants as of API 14, requiring me to convert a switch statement to a series of ifs. After that, I could finally build my app.
This should work for other Android libraries as well – their locations are documented in http://developer.android.com/tools/support-library/features.html.
Edit: There may be an easier way: Both ADT and Andmore also have Android Tools > Add Support Library, which might make a few of the aforementioned steps easier, which installs the most recent version of the support library. But you still have to add them to your project by hand.
Got it. Everything's there if you update your SDK to the latest version, things are just a bit hidden in the folder tree. You'll need three JARs:
extras/android/support/v7/appcompat/libs/android-support-v4.jar (the file was already in my project but I upgraded it anyway – not sure if it was necessary)
extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar
extras/android/support/design/libs/android-support-design.jar
Copy these three to your project's libs dir, refresh your project in Eclipse (cleaning won't hurt as well) and you should be good.
Library locations are documented in http://developer.android.com/tools/support-library/features.html

does ADT(eclipse) supports apklib or aar now, upto ADT v23.04?

Almost no one had successful import a Apklib(aar) refenerence in ADT.
Here is a issues, but no answer. In issues, this is a solution works but ugly.
Being a fan of ADT, i do not wanna use Android Studio.
is there some way to use Apklib(aar) in eclipse?
tried for sevearl weeks, i turned to idea with gradle.
as far as i kown, apklib is supported, while aar is not full supported.
Here is one way to use AAR.
just unpackage the aar into a folder, then import into eclipse as a library project. do not forget to add the classes.jar into build path.
then add a library project dependency to you own project.
it works.

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'

how to use android project library in eclipse?

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'.

Categories

Resources