Reputation: 1319
Firstly, let me say that the Android Support Libraries are still a bit intimidating to me. I'm no expert yet. A lot has been written about using them to get api>=21 features on pre-Lollipop devices, but what should I be using if my minSdkVersion
is 21?
For example, consider Toolbar
. Is there any reason why I shouldn't use the native version instead of support.v7.widget.Toolbar
? It should work fine on all post-Lollipop devices. Or, if this is a naive assumption, is there a more recent support library that I should be using?
Upvotes: 1
Views: 49
Reputation: 36035
Most likely (though perhaps not right now) it would be good to use the support library version over the system version. The support libraries get features added to it as new Android versions come out. So, with the support library tools, you'll get features that are available for 21, 22, 23, and beyond. The support libraries will also automatically handle errors if those features are not possible with the certain version of Android (like with the new Permissions apis introduced in 23).
With the system versions, you'll have to check yourself if you're on 21, 22, 23 to use specific methods or functionality.
Now, at the same time, you may not particularly care about these future features. The Toolbar
for example is very handy and capable as-is. If you write something using only the 21 APIs, then they (should) work for future Android versions.
Upvotes: 2