是否有任何理由使用support.v4库中的Andr​​oid? [英] Is there any reason to use the support.v4 library in Android?

查看:188
本文介绍了是否有任何理由使用support.v4库中的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经工作了的目标的Andr​​oid 4.0及以上支持早期版本的没有计划的应用程序。有没有对我有什么好的理由来继续使用支持库?

I've been working on an app that is targeting Android 4.0 and above with no plans of supporting earlier versions. Is there any good reasons for me to continue using the support library?

推荐答案

有一些功能独有的适用于所有API级别支持库:

There are a number of features unique to the support library that apply to all API levels:

  • <一个href="http://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html">LocalBroadcastManager - 允许应用程序轻松地注册并获得在一个单一的应用程序的意图,而不在全球播放它们
  • ViewPager - 增加的ViewGroup管理该布局的子视图,用户可之间滑动。
  • <一个href="http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html">DrawerLayout - 增加了对创建href="http://developer.android.com/training/implementing-navigation/nav-drawer.html">导航抽屉,可以从一个边缘拉了
  • <一个href="http://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.html">SlidingPaneLayout - 用于创建连接的摘要和详细视图,适当地适应各种屏幕尺寸添加小部件
  • <一个href="http://developer.android.com/reference/android/support/v4/content/FileProvider.html">FileProvider - 对于应用程序之间共享的私有文件增加了支持
  • LocalBroadcastManager - Allows applications to easily register for and receive intents within a single application without broadcasting them globally.
  • ViewPager - Adds a ViewGroup that manages the layout for the child views, which the user can swipe between.
  • DrawerLayout - Adds support for creating a Navigation Drawer that can be pulled in from the edge of a window.
  • SlidingPaneLayout - Adds widget for creating linked summary and detail views that appropriately adapt to various screen sizes.
  • FileProvider - Adds support for sharing of private files between applications.

和其他如

  • <一个href="http://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver.html">WakefulBroadcastReceiver - 帮助实现一个接收装置唤醒事件,然后一个BroadcastReceiver的常见的模式传递的工作开了一个服务,同时确保设备不会在过渡期间回去睡觉
  • AtomicFile - 为原子操作上的文件
  • <一个href="http://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html">SwipeRefreshLayout - 增加了拉来刷新视图
  • WakefulBroadcastReceiver - Helper for the common pattern of implementing a BroadcastReceiver that receives a device wakeup event and then passes the work off to a Service, while ensuring that the device does not go back to sleep during the transition.
  • AtomicFile - for atomic operations on a file
  • SwipeRefreshLayout - adds pull to refresh to a view

还要注意,一些较新的功能,如嵌套片段的(其中加入只在安卓4.2)是片段的支持库版本。 Renderscript intrinics 也只能在Android的4.2引入的和重要的,如果你正在做的事情,如实时图像处理。 大牌风范通知和通知操作(在安卓4.1中引入)更容易一起工作在使用<一个href="http://developer.android.com/reference/android/support/v4/app/NotificationCompat.html">NotificationCompat (和 Android Wear通知API 是建立在它)。

Also note that some newer features, such as nested Fragments (which were added only in Android 4.2) are available in the support library versions of Fragments. Renderscript intrinics were also only introduced in Android 4.2 and important if you are doing things such as real time image processing. Big style notifications and notification actions (introduced in Android 4.1) are much easier to work with when using NotificationCompat (and the Android Wear Notification API is built on it).

这篇关于是否有任何理由使用support.v4库中的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆