What is Backwards Compatibility in Android Studio?
Solution 1
Android apps can be backward-compatible without checking this checkbox.
If false, this activity base class will be Activity instead of AppCompatActivity
Android studio is letting you know that if you uncheck the "Backwards Compatability(Appcompat)" box, then you'll be including & using the library Activity instead of AppCompatActivity. For a more detailed comparison between the two, check this: Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?
Generally, what do android developers prefer? enabling backwards compatibility or without it?
A comment written by "CommonsWare" explains this best:
An activity created with that checkbox checked is no more backwards compatible than is one without that checkbox checked. Checking the checkbox gives your app a particular look and feel that will retain that look and feel on some older devices; leaving the checkbox unchecked means that some aspects of your look and feel will be different on pre-Android 5.0 devices. This does not impact the core functionality of the activity, though. – CommonsWare
Solution 2
Backwards compatibility allows you to use certain backwards compatible features in your app. They will be able to work on previous versions of Android.
The Android Support Library offers backward-compatible versions of a number of features that are not built into the framework. (Android Support Library website)
For example, instead of Activity
, AppCompatActivity
will be used and is something that is "backwards" compatible. It can be used all the way back to API level 15.
Related videos on Youtube
Comments
-
coderpc about 2 years
I'm a newbie to Android Development. Even though I referred the android developer website, I didn't figure out.
On the customize Activity dialog box, when I unchecked the
Backwards Compatiblity(Appcompat)
in Android Studio 2.3.1 It gave me a hint as:If false, this activity base class will be Activity instead of AppCompatActivity
Generally, what do android developers prefer? enabling backwards compatibility or without it? Can anyone explain me which one is better.
-
CommonsWare about 7 yearsSee stackoverflow.com/a/38963902/115145 and stackoverflow.com/a/36989121/115145 for some more background. There is no "better" in the abstract -- you need to define criteria against which one can compare options.
-
-
CommonsWare about 7 yearsAndroid apps can be backwards compatible without checking this checkbox.
-
Tristan Wiley about 7 yearsAh, I should clarify that. My bad.
-
CommonsWare about 7 yearsAndroid apps can be backwards compatible without checking this checkbox.
-
Tomer Dricker about 7 yearsThat's true. But if you check the "Backwards Compatability(Appcompat)" box when creating a project, it builds the project in a way already suited for backward compatibility.
-
CommonsWare about 7 yearsAn activity created with that checkbox checked is no more backwards compatible than is one without that checkbox checked. Checking the checkbox gives your app a particular look and feel that will retain that look and feel on some older devices; leaving the checkbox unchecked means that some aspects of your look and feel will be different on pre-Android 5.0 devices. This does not impact the core functionality of the activity, though.
-
Tomer Dricker about 7 yearsI just checked to make sure, and it seems you are completely right. When I originally studied it, I always thought that it doesn't change the core functionality like you mentioned, but it adds a lot of unnecessary libraries (If you don't care towards backward compatibility) and that is not the case. Thank you for correcting me!
-
Qback over 6 yearsAs mentioned above, this options affect only how your app looks, you can support older andro versions with "just"
Activity
too.