且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何创建不使用支持库一个新的Andr​​oid项目?

更新时间:2023-01-13 15:59:45

当您设置最小目标在API级别13或14(蜂窝或冰淇淋三明治)东西,所以这些应用程序可以使用,该AppCompat库添加有一个动作条(除其他事项外)。在另一方面,支持库(V4),需要在下面的API级别16什么ViewPagers(一ViewPager的FragmentAdapters在API级别14和15用碎片的支持库)。这是只有在支持V13的ViewPager适配器开始使用新的纯粹的片段。

The AppCompat library is added when you set your min target to something under API level 13 or 14. (HoneyComb or Ice Cream Sandwich) so those apps can use and have an ActionBar (among other things). The support library (v4) on the other hand is required for ViewPagers in anything below API Level 16 (the FragmentAdapters of a ViewPager use Fragments from the Support Library in API level 14 and 15). It's only in Support V13 that the ViewPager Adapters start using the new "pure" Fragments.

所以,如果你想要一个纯粹的/不支持的Andr​​oid应用程序,你可以去API级别14,但你可能仍然需要支持V4库一些事情。

So if you want a "pure/non support" Android App, you can go for API level 14, but you might still need the Support V4 library for some things.

不知道什么原因(我敢肯定,他们有一些),谷歌直接添加一些东西到兼容性库(反之亦然)只所以有时你需要它,即使你真的不希望所有的code ...

For unknown reasons (I'm sure they had some), Google added some stuff directly into the compatibility library (and viceversa) only so sometimes you need it even when you really don't want all the code…