最近一周工作遇到的问题(5.20)

本文分享了Android开发中遇到的问题及解决方案,包括统一第三方库版本、实现全屏与systemBar效果、利用Android Jetpack提高开发效率、使用Android Profiler进行性能调试,以及ConstraintLayout布局实践。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.关于引入第三方libs,导致项目中使用的libs版本不一致,例如support包,第三方使用的版本是25.1.2,而你自己的项目中使用是27,你无法对第三方项目中代码做修改,导致你build项目的时候报重复引入包的错误,可以在build.gradle使用下面一句话统一版本:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '27.1.0'//此处为你需要的版本
            }
        }
    }
}

重新build 发现jar包完全统一了。

2. 关于UI全屏和system Bar 的处理,隐藏或者透明等,官网作出了介绍,链接如下:

  https://developer.android.com/training/system-ui/ ,详细介绍了相关操作

3. android jetpack 

 Jetpack is a set of libraries, tools and architectural guidance to help make it quick and easy to build great Android apps. It provides common infrastructure code so you can focus on what makes your app unique.

  在2018开发者大会里详细介绍这块,官网https://developer.android.com/jetpack/,我个人比较关注

    Architecture Components,这块的更新。

同时可以关注一下YouTube上相关的Google官网视频,以及博客。

4. Android Profiler 比之前的monitor好用很多。

  不过需要开启:run -edit configuration -profiling Enable advanced .调试完成后关闭,就可以查看cpu ,memory,network,以及其详细信息 ,官网介绍

https://developer.android.com/studio/profile/android-profiler


5.ConstraintLayout

   很久没有用他了,这次做界面,全部用它来做发现真的很好用,铺页面很快。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值