Using Android Support Library - android

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

Related

adding com.android.support:design:28.0.0 dependency

I am trying to add Floating Edit text to my app. For this have added 'com.android.support:design:28.0.0' dependency to my build.gradle (;app).
I'm getting this following error if try to run the project.
if need to refactor>Migrate to androidX :(please guide me to the process)
You don't need this dependency since you are using the Material components library (it is a drop-in replacement for Android's Design Support Library).
Just remove it.

Do I need Gradle dependency for RecyclerView?

I forgot to include this in Gradle -
compile 'com.android.support:recyclerview-v7:23.+'
But my project works fine without this record.
So, why do I need to write it in Gradle?
Can I use only appcompat?
compile 'com.android.support:appcompat-v7:23.2.0'
com.android.support:appcompat-v7 does not depend on com.android.support:recyclerview-v7, but com.android.support:design does.
There's no harm in including this dependency one more time in your build.gradle, but it's not necessary since design includes it.

The following classes could not be found: - android.support.design.widget.TextInputLayout

This is Tutorial which i am following.
Please help me out from this error. Rebuild is not solving the problem.
Does your build.gradle file contain the line below?
compile 'com.android.support:design:22.2.0'
You must include support libraries (like the ones below), yet this is sometimes not sufficient.
compile ("com.android.support:support-v4:23.3.0")
compile ("com.android.support:appcompat-v7:23.3.0")
compile ("com.android.support:support-annotations:23.3.0")
compile ("com.android.support:recyclerview-v7:23.3.0")
compile ("com.android.support:design:23.3.0")
Examine your layout in design view, and click on Show Exception
This answer will help if you have the following problem:
You need to use a Theme.AppCompat theme (or descendant) with the design library.
In your Manifest file, include in your application declaration
android:theme="#style/Theme.AppCompat"
Rebuild and your problem should be solved.
First things first :
If you are using the lastest sdk28 TextInputLayout is having some bug. At least mine did (date: 22 Sept 2018 ) NOT work.
To make it work the best way is to use slightly lower SDK for you target and compile SDK version. (I used sdk 27 and everything worked out fine then.)
To use TextInputLayout and then its features such as "floatinghinttext" you need to update your build.gradle(module.app) found in gradleScripts.
in dependencies add-
implementation 'com.android.support:design:25.0.0'
(if you get some error it must be of some latest version available, so use that instead of 25.0.0)
Note: The "compile" keyword is getting replaced by "implementation" for newer/all versions.
I am fairly new to android development, suggestions are welcomed. Please excuse if any mistakes committed.

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.

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

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.

Categories

Resources