阅读前提: 你需要提前了解 drawable 和 mipmap 是什么;

使用Android Studio IDE, 新建Android项目的时候,程序(APP)启动图标ic_launcher.png,没有在之前的老地方(drawable目录),而是出现在mipmap目录结构下;

为了一探究竟,翻阅了Android 开发者官网(http://developer.android.com);

找到以下解释:

main/res/    Contains application resources, such as drawable files, layout files, and string                  values in the following directories. See Application Resources for more information.    drawable/For bitmap files (PNG, JPEG, or GIF), 9-Patch image files, and XML files that describe Drawable shapes or Drawable objects that contain multiple states (normal, pressed, or focused). See the Drawable resource type.    mipmap/For app launcher icons. The Android system retains the resources in this folder (and density-specific folders such as mipmap-xxxhdpi) regardless of the screen resolution of the device where your app is installed. This behavior allows launcher apps to pick the best resolution icon for your app to display on the home screen. For more information about using the mipmap folders, see Managing Launcher Icons as mipmap Resources.

恕我英语能力不足,无法翻译;
原文地址:http://developer.android.com/intl/zh-cn/tools/projects/index.html#ApplicationModules

勉强使用工具翻译,大致内容如下:    drawable/用于图片文件(PNG, JPEG , or GIF), .9图片文件 和 XML文件;    mipmap/用于App Launcher图标;

其他官网相关阅读地址:
http://developer.android.com/intl/zh-cn/tools/projects/index.html#mipmap

http://developer.android.com/intl/zh-cn/guide/practices/screens_support.html#support


补充阅读:
两者使用上没有任何区别,你把它当drawable用就好了。唯一的区别就是用mipmap系统会在缩放上提供一定的性能优化。

比如:
Nexus 6 有 493 ppi,它刚好在 xxhdpi和xxxhdpi之间,所以显示的时候需要对xxxhdpi的资源进行缩小,如果你用了mipmap-xxxhdpi,那么这里会对sclae有一个优化,性能更好,占用内存更少。所以现在官方推荐使用mipmap.


至此: 文章就结束了,如有疑问: QQ群:274306954 欢迎您的加入.

更多相关文章

  1. Jeally Bean中MonekyRunner 帮助文件
  2. android启动过程配置文件的解析与语法
  3. [Android Pro] 通过Android trace文件分析死锁ANR
  4. android 文件读取总结
  5. Android中获取文件存储位置(内部存储或者扩展SD卡)
  6. android 应用在SD卡创建应用的文件夹
  7. 如何去除Android布局文件xml中的斜体样式

随机推荐

  1. 关于Eclipse无法在线安装升级Android(安
  2. BadTokenException Error In Android(安
  3. Android-显示传感器的值
  4. android界面设计(一)侧边栏的两种实现方式
  5. Android对话框使用详解(二)
  6. IDEA 快捷键 Android(安卓)Studio快捷键
  7. Android(安卓)JNI开发摘录(二)之JNI数组处
  8. hap组 常用命令
  9. 使用Android(安卓)Studio进行cocos2d-x开
  10. Android(安卓)Camera调用流程