Android面试题之android部分

一、Android各个编译版本差异汇总,从5.0开始。

        1.安卓5.0 API-21

                      1.1  Material Design设计规范,编译版本提升至至少21时才能方便使用Appcompat-V7 RecyclerView-V7 CardView-V7等框架.

                     1.2 禁用隐式意图启动服务,运行时会直接抛出IllegalArgumentException异常

                           过时禁用 Intent intent = new Intent(); intent.setAction("com.example.myapplication"); startService(intent);

                           只能使用显式意图 Intent intent = new Intent("com.example.myapplication");  

       2.安卓6.0 API-23

                    2.1 对于一些敏感权限,需要动态申请权限,否则会抛出异常

      3.安卓7.0 API-24

                    3.1   APK signature scheme v2,android 7.0 新引入应用签名方案,它能提供更快的应用安装时间和更多针对未授权 APK 文件更改的保护,但是需要注意的是,这种方式的打包很容易的apk内部的版本更新的时候出现解析安装包错误提示。

                    3.2   StrictMode API政策禁止在您的应用外部公开file:// URI。如果启动一个包含文件 URI 的intent会抛出FileUriExposedException异常。受此影响的有拍照图片选择,下载apk安装等功能。要在应用间共享文件,您应发送一项content:// URI,并授予 URI 临时访问权限。

      4.安卓8.0 API-26 (8.1 API-27)

                     4.1  roundedIcon 自适应图标,在manifest文件中额外提供圆形应用icon

                     4.2  新增特殊权限:android.permission.REQUEST_INSTALL_PACKAGES当需要安装未知来源应用时使用

                         

     

   

猜你喜欢

转载自blog.csdn.net/u010256329/article/details/91804293