I am integrating with Samknows library. Access to their gradle dependency is password protected, hence, I want to add this library locally in the project so, i don't need this password anymore.
I am able to locate the jar and pom file of the dependency. I tried to add this jar in the project as library but seems to not work, as POM file attach to it has all the dependency.
I am not able to figure out how to add these dependence files locally in my project. Any suggestions or approach will be helpful.
Related
I can create my jar file and add it to my android project as a library and use it. But I want any time I made a change in my library, without recopying jar file to my project, apply changes in it.
I don't want use Git
You can push the .jar as an artifact to JFrog or some Artifact Hosting Repository. It'll give you a unique URL which can then be included in your Gradle file.
Everytime you push your new Artifact, you'd mostly increment the version number, so you'll need to do the same in your project. Just like you would for any other library.
https://www.jfrog.com/confluence/plugins/servlet/mobile?contentId=46107909#content/view/46107909
Where can I include online (maven etc) libraries/repo in Android Studio 2.0 without build.gradle?
Before it was somethere in add library dialogs, but now i can add local jars only. But how to add online repositories to old projects without gradle?
Note, i do not want to include all library project/source, import module etc. Just want to link online libs as before.
I am using Android Studio.
I have created a library project.and I have successfully included this library in another prstoject.I have followed the below steps to include that library in my project.
a.I have added that library folder in my project root folder.
b.In settings.gradle file include ':library'
c.In build.gradle file compile project(':library')
Now I want to add library as a gradle file.I want to implement just one line in build.gradle file compile 'com.example.library' and then I can access that library files etc.I don't want to add the library folder in my project.Because when the library folder gets increased at that time my project size is also get increased which is not beneficial for me.So guys please suggest me how can I achieve this.How can I get that gradle file or if you have any idea please suggest me.
Read this. This might help. How to distribute your own Android library through jCenter and Maven Central from Android Studio
I'm struggling to figure out how to import library projects into Android Studio in a fashion that makes them available to multiple projects. The documentation for the new build system implies that you need to import library projects into the root of the project you are working on:
Gradle projects can also depend on other gradle projects by using a multi-project setup. A multi-project setup usually works by having all the projects as sub folders of a given root project
(http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Multi-project-setup)
This is problematic since, as I mentioned above, I would like to keep frequently-used libraries accessible to all current and future projects. For example, I am currently trying to integrate Volley into a new project to evaluate it, with the assumption that I will want to use it in multiple other projects in the future. I cloned it to my "${PROJECT_ROOT}/" folder, which is the same level at which I created my test project, giving me:
${PROJECT_ROOT}/TestProject/Test
${PROJECT_ROOT}/volley
After trying to set up my project's build.gradle file in a variety of ways, the only way that I've managed to make the app compile is to move Volley into the TestProject 'main' project, giving me:
${PROJECT_ROOT}/TestProject/Test
${PROJECT_ROOT}/TestProject/volley
Not only does this prevent me from using Volley in other projects that are not a part of TestProject without duplicating it or cloning it a second time, but it means that git wants me to add it to the repo I've established at the root of TestProject.
How can I reference library projects in my Android Studio projects without including them in the projects themselves?
Couldn't you use git with submodules? e.g. In your .gitmodules file, you may add this:
[submodule "volley"]
path = volley
url = https://path/to/volley/repository
You can set the url to Volley's official repository, or to your own in-house version of volley. Other projects can be setup the same way and point to the same volley repository.
I think this way, other users can call git clone and all the dependent projects will be downloaded within the main project folder and they don't have to worry about downloading the library projects separately.
For Volley though, I would just compile it into a JAR file and stick it into the /libs folder of the main project. That is, if you don't need to modify its source.
[Update]
For library projects that you don't need to modify its source, you can try using Android Studio to compile them into AAR files for sharing. AAR file is like a JAR file to Android, so you can add them to your /lib source folder, or publish them to your local/intranet maven repository. If you choose the maven route, add your local/intranet repository in build.gradle, and reference the library project that you've published.
Hopefully in the future more Library projects owner will build their projects into AAR file and publish them to Maven Central Repository, so we can just reference them directly from the build.gradle file.
I've seen lots of libraries in github that has no dependencies for adding them to a project.
The questions are:
How can I use these libraries?
How can I add them to my project?
For instance, this is a gitbub project that I don't know how to use those:
https://github.com/zzhouj/Android-SlidingUpPanel
Normally, you would download a JAR file - if any - or download the project and build the JAR yourself (like you would do for Volley project). But if there is no JAR support, like Android-SlidingUpPanel, just download it and add it as a module in your project.
Try doing this way;
download android-support-v4.jar, add to your LIBS folder,
build project.