Android Studio 3.3无Backward Compatibility选项?是否需取消该选项?
Hey there! Let's break down your two questions step by step since you're just starting out with Android and following the Head First Android 2017 book.
1. How to "disable backward compatibility" in Android Studio 3.3
The "Backward compatibility" checkbox mentioned in the book was a feature in older Android Studio versions—by Android Studio 3.3, this option was reworked or moved. Here's how you can achieve the same result manually:
- When creating a new project, look for the "Use androidx. artifacts"* checkbox in the final "Configure your project" step. Unchecking this is the modern equivalent of disabling the old backward compatibility option.
- If you've already created the project or don't see that checkbox, adjust these two files:
- Open your app module's
build.gradlefile (not the root project's one). Delete the line that looks likeimplementation 'androidx.appcompat:appcompat:1.xx.x'(or the oldercom.android.support:appcompat-v7:xx.x.xif you're using the old support library). - Open
res/values/styles.xml, and change your theme's parent from an AppCompat theme (likeTheme.AppCompat.Light.DarkActionBar) to a native Material theme. For example:<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> - Click the "Sync Now" button in the top-right corner to apply these changes.
- Open your app module's
2. Should you follow this guidance? Will using AppCompat break the tutorial?
Let's break this down clearly:
- The 2017 edition of Head First Android uses the old Android Support Library (AppCompat was a key part of it), while modern Android Studio uses AndroidX (the updated replacement for the support library).
- If you keep using AppCompat (AndroidX version): Most core concepts from the tutorial will still work. You'll just run into minor differences like import statements—for example, the book uses
android.support.v7.app.AppCompatActivity, but AndroidX usesandroidx.appcompat.app.AppCompatActivity. You'll need to swap these imports when copying code, but functionality stays mostly the same. - If you follow the book's guidance (disable compatibility): Your project will match the book's code exactly. This is ideal for a beginner, as it eliminates confusion from mismatched code or library versions, letting you focus on learning core Android skills instead of troubleshooting version differences.
My recommendation: Since you're new to Android, go with disabling compatibility using the steps above. It'll keep your project aligned with the book and reduce unnecessary friction as you learn.
内容的提问来源于stack exchange,提问作者user8649786
相关产品推荐
相关产品推荐

