LoginSignup
5
0

compileSdkVersionとtargetSdkVersionの違い

Posted at

はじめに

いつも忘れてしまう。SDKの違いについてメモとして残しておきます。

targetSdkVersion

以下に影響する

  • UIの見た目
  • UIの動作のアニメーション

compileSdkVersion

以下に影響する

  • 指定したバージョンまでの機能が使える

注意!!

compileSdkVersionで指定したバージョンの機能が使えるけど下位互換を意識する必要がある
以下の表記のやつ

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.L) {
  // ここはLollipop(Android 5.0)以降で実行される。
} else {
  // こっちはKitKat(Android 4.4)以前。
}

まとめ

本当によく忘れるので覚えておいて損はないと思う。

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0