K
K
Kirill Sidorov2014-12-24 06:13:50
Android
Kirill Sidorov, 2014-12-24 06:13:50

How to use Appcompat V7 on SDK below 21?

I'm a super newbie in Android, 2 days experience, so don't kick too hard. Sketched a small application, tested on the emulator. I decided to check on the device, but I could not. I started to figure it out myself, I came across the value of Compile SDK Version: 21 (Android L, 5.0). After a little thought, I came up with the idea that I am building a project on SDK 21, although I am trying to test on an Android 4.4 device. I decided to downgrade the version, but after that R stopped generating, the reason for this was a bunch of errors in styles mentioning the Material design. I read about Appcompat V7, from which I realized that this library is just designed to help with a smooth migration to 5.0 when developing for two winds 4 and 5. Hence the questions:

  1. What did I misunderstand about Appcompat?
  2. Is my assumption about the impossibility of launching the project with SDK 21 on devices with android 4.x.x+ correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anyd3v, 2014-12-24
@anyd3v

1. no
2. no
To support older versions, you need to specify minSdkVersion and not "Compile SDK Version: "
all com.android.support:* libraries are made to bring the functionality of older versions to younger ones.
To use sdk 21 you need to set:
compileSdkVersion 21
defaultConfig {
minSdkVersion <minimum version>
}
dependencies {
compile 'com.android.support:appcompat-v7:21.+'
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question