KitKat is, at the time of writing this, the latest Android version on the market but should be very soon replaced by Lollipop. Kitkat runs 37.8 % of the Android phone as of November 2014, and therefore, you should be careful while using what it proposes as you are targeting a subset of Android users equipped with last generation phones.
To follow this recipe, create a new project called
KitKat and create a new AVD running Android 4.4 to deploy your code. In order to create an AVD running Android 4.4, you'll need to download and install the corresponding SDK using the Android SDK Manager.
MainActivityclass, add the following code in the
if(Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat) ...