Or will those attributes just be ignored on devices with lower API levels?
Why can't I just test this out myself by launching an emulator below the attributes min API? None of those emulators are working for me: https://code.google.com/p/android/issues/detail?id=195990
For example if I use android:fontFamily="@string/sans_serif"
(min API of 16) attribute on an EditText
and run the application on an API 15 device, will the app crash or the attribute be ignored?
it will just get ignored .. you can double check with a quick genymotion emulator https://www.genymotion.com/#!/download
http://developer.android.com/training/basics/supporting-devices/platforms.html#version-codes
Note: When parsing XML resources, Android ignores XML attributes that aren’t supported by the current device. So you can safely use XML attributes that are only supported by newer versions without worrying about older versions breaking when they encounter that code. For example, if you set the targetSdkVersion="11", your app includes the ActionBar by default on Android 3.0 and higher. To then add menu items to the action bar, you need to set android:showAsAction="ifRoom" in your menu resource XML. It's safe to do this in a cross-version XML file, because the older versions of Android simply ignore the showAsAction attribute (that is, you do not need a separate version in res/menu-v11/).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With