I'm trying to implement a Facebook Like Button in an app and I just found a good library: Facebook Like Button by shamanland.
Now the problem is that I'm using Eclipse and I can't figure out how to import this project correctly in order to use it in the app.
Can anyone help?
Thanks!
That project uses the gradle build system, but eclipse uses the ant system.
Google is leaving ant and migrating to the new gradle system which is used with their new Android Studio IDE. Most of the new libraries also are migrating to gradle due to easy dependency management.
This is a good time to migrate your project to Android Studio.
Download it and when you import your project, it will automatically convert it to gradle.
Then you can easily add gradle libraries to your project's build.gradle, and it will take care of downloading and maintaining them.
For this particular library, you have to add the following to your build.gradle:
repositories {
mavenCentral()
}
dependencies {
compile 'com.shamanland:facebook-like-button:0.1.6'
}
You can also download the Gradle plugin for Eclipse, but it may not be fully compatible with ADT. It's better to use the Android Studio and avoid the headache.
More Info Here
You may download compiled aar file from the Maven Cental.
Just import this aar into your Eclipse project as standalone library.
Related
Whenever I install Gradle third-party dependencies, my android studio project doesn't recognize the library classes. For example, I've tried installing a library called fuzzydateformatter. Android studio doesn't recognize the classes from that library. I've also tried installing other third-party libraries but the same thing happens. Only google and androidx libraries seem to work fine.
// Time Formatter
implementation 'si.virag:fuzzydateformatter:1.1.0'
PS: I'm new to android and I use kotlin
That library has not been updated in six years. It is only published on JCenter, which has threatened shutdown a few times. As a result, JCenter is not included as a repository in modern Android Studio projects.
The best solution would be to use another library, one that is actively being maintained.
If you insist on using this library, your choices are:
Use the source code of the library directly, copying it out of GitHub into your project, or
Adding jcenter() as a repository, in the same spot(s) in your project where you have google() and mavenCentral() (e.g., repositories closures in your project-level build.gradle file)
I am trying to use Codenvy to develop, and I am switching from Android Studio. I am in the middle of a project. How can I transition? Can I use a special import feature? I have already tried to copy and paste the code, but a lot of libraries don't seem to be there. If you need to take a look at my source code, then just search up "calc-nigma" in Github search and you can click on the option that is made by beekaydev.
Thank you in advance.
The Problem is not with your code but the dependencies Codenvy is using is Maven while it seems that your application may be using Gradle dependencies.
For the Support of Answer:
Maven uses pom.xml file to build your project.
Gradle uses build.gradle file to build the project.
If you want to move your project to Codenvy try migrating your Gradle build to Maven build using this thread Migrating Gradle build.gradle to Maven pom.xml.
Hope this Helps!
I've been trying to add the volley library to my android project by downloading this repository https://android.googlesource.com/platform/frameworks/volley and then importing the module to my project by following this guide:
First get latest volley with git (git clone >https://android.googlesource.com/platform/frameworks/volley).
In your current project (android studio) click [File] --> [New] -->[Import >Module].
Now select the directory where you downloaded Volley to.
Now Android studio might guide you to do the rest but continue guide to verify >that everything works correct
Open settings.gradle (find in root) and add (or verify this is included):
include ':app', ':volley'
Now go to your build.gradle in your project and add the dependency:
compile project(":volley").
When gradle tries to sync the project after I've imported the module i get the following error message : Error:Could not download layoutlib-api.jar (com.android.tools.layoutlib:layoutlib-api:24.3.1): No cached version available for offline mode.
I believe you want to use Volley and not contribute to the volley library. if that is the case there are better ways to get volley in your project. let Gradle handle it. Gradle is Build Management tool just like Maven but better, As it gives you more freedom and flexibility.
How to add libraries to gradle in android studio. this link shows a how to add libraries to your android project.
As Android Studio uses Gradle things are pretty neat as it uses the middle ground of ANT and Maven for Build and Management tool.
for volley you can add
compile 'com.mcxiaoke.volley:library:1.0.19'
to the app module of your project. this library can be looked up on Github
or you can do that using android studio's GUI, click on File -> Project Structure
example
I am trying to use material designing library https://github.com/drakeet/MaterialDialog from github in my eclipse but I didnt found any jar file in this library project. So how can I use this library in my project in eclipse
If you have a Gradle build, as mentioned in the README, you just add:
dependencies {
compile 'me.drakeet.materialdialog:library:1.2.2'
}
As explained in the blog post, this looks like (in Android Studio)
You have to convert this library project from gradle to eclipse. You can get many links over the web for it. Try this.
The library project you are looking is build into android studio(Gradle). So I recommend you to use android studio instead of eclipse.
I recommend you to use Android Studio with Gradle support by default. But if you want use Eclipse download Gradle plugin and add this lib as dependency
dependencies {
compile 'me.drakeet.materialdialog:library:1.2.2'
}
I am switching from Eclipse to Android Studio. I have couple of 3rd party libraries that I have added features or modified a little bit. Since the libraries in Eclipse are also projects and we can access the code, I had no problem.
In Android Studio compile tag in dependencies is great but in my case I cannot use it unfortunately.
I fork the project and made necessary changes and add the project as a module in Android Studio. Since the library project already has settings.gradle and example and library modules, there is a mess in my project and it does not compile at all.
Has anybody experienced such a problem? What to do and what is the correct way to forked libraries?
What we've done in my project is create gradle scripts for our dependencies that don't have them, and modify the gradle scripts for dependencies that do have them. Gradle does not play very well with modular dependencies, unfortunately: Each sub-project must know its place in the larger overall project. Since you've already forked the github project, modifying it further shouldn't be a problem.