how to set dependecy of RecyclerView Of Android L in Eciplse? - android

Recently RecyclerView and CardView have been introduced by Android L Version.As per information that I have,The RecyclerView and CardView widgets are part of the v7 Support Libraries. To use these widgets in our project, we have add these Gradle dependencies to our app's module
dependencies {
...
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
}
so IT IS SUPPORTED TO ECLIPSE? if yes then how? or it is supported to Android Studio only? Please help me,if you know about it.

Yes, it's supported on Eclipse. But you have to add to eclipse manually (res and java code). You can download source from here.

Related

implementing card view in build.gradle

I am trying to implement card view by implementing it in my build.gradle.
However while doing this, I am getting an error. It is saying
"Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with this: Refactor > Migrate to AndroidX... less... (Ctrl+F1)"
I understand how to do it but am not sure if I should since I am not getting any build errors and my gradle is still syncing. Can someone tell me whats going on?
You are using androidx libraries together with a very old version of support library of cardview.
Remove the dependency of support library
//implementation 'com.android.support:cardview-v7:16.0.4'
and add:
implementation 'androidx.cardview:cardview:1.0.0'
More info about androidx here.
You have another option.
Just add the MaterialCard included in the official Material Components library:
implementation 'com.google.android.material:material:1.1.0-alpha10'
and in your xml you can use:
<com.google.android.material.card.MaterialCardView
...>
Just open your project and make the compile and target version to 28 , then sync then go to refractor on toolbar of studio , there you will see migrate to android x just tap on that. It will resolved all your issue.

How to use a GitHub project in Android Studio

I know there are already similar question but I still could not find a way to do this. I want to use this github project in a new android app. Could anyone elaborate how to do that ?
It's easy.
For example, you want to add the library which is given below.
1)just take compile link --> compile 'com.intuit.sdp:sdp-android:1.0.2'
2)add it in app level gradle
dependencies {
compile 'com.intuit.sdp:sdp-android:1.0.2'
}
3)sync project
Now u can use easily this github library.
EDIT:
In the latest version of Android Studio implementation must be used instead of compile
So,
compile 'com.intuit.sdp:sdp-android:1.0.2'
becomes,
implementation 'com.intuit.sdp:sdp-android:1.0.2'
First,you need to download the project .Then,you should follow the steps below,in you project,chose Android studio File->new->import module.Find the path of the project which was downloaded just now into Source directory.The last step ,into project structure select dependencies, chose Module dependency,click Ok.So,you can use the github project in you new android app.Sorry,my english is very pool ,hope that can help you.

Using Android Support Library

I am trying to use the support library.
I have added this dependency to the gradle file
compile 'com.android.support:appcompat-v7:23.1.1'
And I also have downloaded it in the SDK manager
But when I try to use this Control
PercentRelativeLayout it does not work. The layout xml file does not seem to recognize it . android.support.percent.PercentRelativeLayout
Any solutions please?
you need to add the dependency on your build.gradle. E.g.
com.android.support:percent:23.1.0
the appcompat's dependency is not enough. You can read more here
use this dependency in your gradle file
compile 'com.android.support:percent:23.0.0'
PercentRelativeLayout doesn't comes under support library.
There is nice samples also for percent support library, check here

Add android-numberpicker backport to Android Studio Gradle project

I want to use this library in my Android Studio project https://github.com/SimonVT/android-numberpicker. I can't for the life of me figure out how to add it to my project. Can someone just outline how this would work? I've only ever added libraries that were contained in jar files.
In build.gradle, use:
dependencies {
compile group: 'net.simonvt', name: 'android-numberpicker-parent', version: '1.0.0'
}
If you are using new gradle build system (and you really should), just add
compile 'net.simonvt:android-numberpicker:1.0.0'
to your build.gradle's dependencies section.
I found a forked version of this library which can be imported from source as a module in Android Studio. It is available here:
https://github.com/heavyplayer/android-numberpicker

material support library, can't find Cardview/Recycleview

I have searched the internet but i couldn't find my answer. How can I use Card view/Recycle view they are not in my layout palette or i can't use them manually and I am using eclipse
The CardView and RecycleView are not by default in the AppCompat library. You should include the CardView and RecycleView libraries manual to your project.
Reference: https://developer.android.com/training/material/lists-cards.html#Dependencies
Gradle (using Android Studio):
dependencies {
compile 'com.android.support:appcompat-v7:21.0.+'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
}
In the layout palette there is a section called "Custom" click on the "CustomView" and you shall see all the imported views from the dependencies added in the gradle file.
my problem when adding the library was the same as this guys problem
Unable to add library to android project
so I fixed it.

Categories

Resources