What is Backwards Compatibility in Android Studio?

16,142

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.

Share:
16,142

Related videos on Youtube

coderpc
Author by

coderpc

Full Stack Developer

Updated on June 04, 2022

Comments

  • coderpc
    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

    enter image description here

    Generally, what do android developers prefer? enabling backwards compatibility or without it? Can anyone explain me which one is better.

  • CommonsWare
    CommonsWare about 7 years
    Android apps can be backwards compatible without checking this checkbox.
  • Tristan Wiley
    Tristan Wiley about 7 years
    Ah, I should clarify that. My bad.
  • CommonsWare
    CommonsWare about 7 years
    Android apps can be backwards compatible without checking this checkbox.
  • Tomer Dricker
    Tomer Dricker about 7 years
    That'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
    CommonsWare about 7 years
    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.
  • Tomer Dricker
    Tomer Dricker about 7 years
    I 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
    Qback over 6 years
    As mentioned above, this options affect only how your app looks, you can support older andro versions with "just" Activity too.