阅读前提: 你需要提前了解 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. Android遇到的错误记录
  2. 【Android(安卓)Studio 学习】—— day 01
  3. 【Android】一个简单又实用的toolbar
  4. Android(安卓)NDK开发基础
  5. Android中调用jni报错
  6. android的崩溃报告(crash dump)
  7. 【Android(安卓)Developers Training】 36. 设置文件共享
  8. Android(安卓)JNI之动态创建native
  9. android动态加载外部资源文件

随机推荐

  1. Android支付——支付宝支付总结
  2. Android(安卓)Touch系统简介(二):实例详解o
  3. LinearLayout中组件右对齐
  4. AOSP源码编译 --全部编译
  5. Android(安卓)手势识别--GestureDetector
  6. Android常用组件(View学习之一)
  7. android中-使用2D动画 — 图形处理(Canva
  8. 【Android多线程】线程二三事
  9. Android多国语言-国家代码清单
  10. Android(安卓)Activity生命周期(Android艺