I am trying to incorporate the Google Direction Library created by https://github.com/akexorcist/Android-GoogleDirectionLibrary
In the README it shows the following downloads. I know how to add gradle dependencies, but what does adding proguard and maven do and how do I add it?
Maven
Proguard
You can add the dependency either via Maven OR Gradle. So if you're using Gradle, that's 100% fine and just do that.
As for Proguard, there should be a file called "proguard-rules.pro" or something like that in your project. Simply copy the text from the Github page and paste it into that file in your project.
That's it.
Related
I have a gradle zip file that I want to use as a dependency in my project in intelliJ.
So I opened that project using Open and then pointing to build.gradle file. Tried to run it and got Could not find or load main class.
How to solve this and then also how to add this project to some other project as a dependency in IntelliJ.
I am fairly new to IntelliJ and Java project settings, will appreciate any help. Thanks in advance!
To add it as a dependency you can use this this
The developers of that project have chosen to promote JitPack as the way to consume their JARs. You can tell because their Github project page has a little "JitPack" badge at the top of the readme. If you click on that badge, it takes you to this page showing how to add the dependency to your Gradle or Maven project.
If you're not yet using Maven or Gradle, this is a great opportunity to learn :-)
Gradle Java tutorial
Maven tutorial
When you open your Maven or Gradle project in IntelliJ, it will automatically resolve the dependencies for you.
I've created an Android project in Eclipse and I would like to add the Volley library to it. Searching on the web, I've tried these approaches:
Copy the .jar into the libs folder and right-click and add it to build-path.
Open the library as an android project, mark it as library and add it as a reference in my android app.
Nothing works. I still cannot access the classes provided by the library by importing the classes like follow: com.android.volley
Someone has a solution for this ?
The Solution:
Try this:
Add volley.jar to the libs folder. Don't add it to the build
path.
In Eclipse go to Project and make sure Build Automatically is selected.
Now in Project, click on Clean:
Project -> select Clean -> select the project.
As Volley doesn't have any resources like styles, layouts etc., its not necessary to reference it as a library project. The above should work, provided all steps are followed.
If this doesn't work ...
Make sure the library has not been added to the build path. If it is, then remove it. Now, try:
Closing and re-opening the project.
Restarting the IDE (last resort).
The build process for Volley has changed to Gradle. If you just want to use the library without building it, you can get the Jar from Maven or scroll down to the instructions to building it yourself lower in this answer.
Maven
An easier way to obtain the Jar file is to download it directly from Maven Central. You can find the latest version with this search:
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.mcxiaoke.volley%22
At the time of writing the 1.0.19 version can be found here:
http://search.maven.org/remotecontent?filepath=com/mcxiaoke/volley/library/1.0.19/library-1.0.19.jar
Gradle
The new way to do it is to build the project using Gradle.
You can do this by running:
git clone https://android.googlesource.com/platform/frameworks/volley
gradle build
This will create a file in
build\intermediates\bundles\release
Then add this file into your libs folder and add it to your project.
I have a library that is being built in Eclipse, but I would like to upload it to jCenter to be used as a gradle dependency in an Android Studio project. I have tried building the gradle files in Eclipse, making a Bintray account, and trying to link it to jCenter but nothing seems to go through. It may be because I have not published it on Bintray, but I also do not see any option to publish it anyway.
You need to add Bintray plugin to your Gradle project. Please see the examples.
I'm trying to add https://github.com/astuetz/PagerSlidingTabStrip to my project. Looking at it, I notice that it has files in res and depends on its own R.java file. When I make it a JAR I continue to get errors because the dependencies aren't all there. I'm not sure how to get this to work.
I keep getting errors like
import android.support cannot be resolved and everything else too. I tried referencing different answers on StackOverflow but none of them yielded a working solution.
The resources won't be packaged into the JAR file. Google is working on a new packaging scheme called AAR which is supported by Android Studio.
In order to use this third-party library in your own project, you should clone it to a local repo. Then you can import it directly into your Eclipse workspace and then add the Eclipse project to the classpath of your app's project.
Download the whole source code from https://github.com/astuetz/PagerSlidingTabStrip by git tool.
On your Eclipse IDE, import the library as exsisting source code at Android option.
Add the library your add before into your project.
I am experiencing difficulties to install some project based on a build.gradle file. I was told in a precedent post, that I should use Android Studio but it seems even more difficult (reported conflict for gradle 1.10 and Android Studio). So I am asking if it is possible to import the project directly in my ide, https://github.com/chrisbanes/ActionBar-PullToRefresh. If yes, should I put the library folder below in my libs folder ? Here's a screen of the file hierarchy
Since you are using Android Studio and Gradle, you could import it as suggested by the QuickStart page :
The easiest way to add ActionBar-PullToRefresh to your project is via
Gradle, you just need to add the following dependency to your
build.gradle:
dependencies {
mavenCentral()
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
}
I believe this is by far the easiest way to include that great library in your project.
If you are using Eclipse, you can still use the library, just download the project and create a create a new library project with the code from "library".
Check the guide http://www.jetbrains.com/idea/webhelp/cloning-a-repository-from-github.html
and other github integration http://www.jetbrains.com/idea/webhelp/using-github-integration.html