通过
可以简单的通过一个 github 中的地址,就直接将项目运行到手机上。
- dryrun
可以快速检索需要引用库的
与
- jcenter
的引用代码。
- maven central
很便捷的反编译工具,可对 dex 文件直接反编译打开:
。
- jadx-gui classes.dex
除了在 CI 系统上保持对资源变化的持续监控 (对大多数的 Android 应用而言,资源往往是 Apk 大小的主要根源之一),
,离线编译,免去检测的网络耗时
- --offline
,停止所有的 gradle 编译,包括 IDE 中的
- gradle --stop
可以通过
来查看最终的依赖关系。
- ./gradlew dependencies
如针对项目中的 app module 进行查看其引用关系:
。
- ./gradlew :app:dependencies
都是对相通库同类型的引用,如都是
,或都是
- testCompile
,那么 Gradle 会自动选择最高版本的:
- compile
- compile'cn.dreamtobe.filedownloader:filedownloader-okhttp3-connection:1.0.0'
- compile 'com.squareup.okhttp3:okhttp:3.6.0'
- compile 'com.liulishuo.filedownloader:library:1.4.1'
对相同库不同类型的引用时,此时会发生冲突:
- compile'cn.dreamtobe.filedownloader:filedownloader-okhttp3-connection:1.0.0'
- compile 'com.squareup.okhttp3:okhttp:3.6.0'
- testCompile 'com.liulishuo.filedownloader:library:1.4.1'
这个时候我们就要根据需要 exclude 掉冲突的版本,如我们只需要引用
版本与
- okhttp 3.6.0
:
- filedownloader 1.4.1
- compile('cn.dreamtobe.filedownloader:filedownloader-okhttp3-connection:1.0.0') {
- exclude group: 'cn.dreamtobe.filedownloader', module: 'library'
- exclude module: 'okhttp'
- }
- compile 'com.squareup.okhttp3:okhttp:3.6.0'
- compile 'com.liulishuo.filedownloader:library:1.4.1'
- testCompile 'com.liulishuo.filedownloader:library:1.4.1'
- testCompile 'com.squareup.okhttp3:okhttp:3.6.0'
轻松给方法添加耗时日志:
- @DebugLog
- publicStringgetName(String first, String last){/* ... */}
输出日志:
- V/Example: --> getName(first="Jake", last="Wharton")
- V/Example: <-- getName [16ms] = "Jake Wharton"
统计事件之间的耗时:
- App Start --> 0ms
- Splash Screen --> 5ms
- Splash Load Data --> 37ms
- Splash Load Data <-- 1042ms, execution = 1005ms
- Splash Screen <-- 1042ms, execution = 1037ms
- Main Activity Launch --> 1043ms
- onCreate() --> 1077ms
- onCreate() <-- 1100ms, execution = 23ms
- onStart() --> 1101ms
- onStart() <-- 1131ms, execution = 30ms
- Main Activity Launch <-- 1182ms, execution = 139ms
- App Start <-- 1182ms
基于 Android Studio 的 Copyright 功能
至此,默认创建的文件就顶部就会申明 license,并且可以对文件一件添加 license
当然如果需要特殊配置针对不同语言文件 license 格式等配置,可以在 Formatting 下面进一步配置。
除了上面两个,也可以使用 Android Studio 自带的:
谷歌官方提供的 Google Play 差分包大小,也可以做简单的文件大小变更大小对比,可以集成到 CI 中持续跟踪包大小变化,也可以简单的对比两个包的大小:
- New APK size on disk: 18,
- 271,
- 850 bytes[17.4MB] Estimated download size
- for new installs: Full new APK(gzipped) size: 16,
- 339,
- 603 bytes[15.6MB] Estimated download size
- for updates from the old APK,
- using Bsdiff: Bsdiff patch(gzipped) size: 2,
- 989,
- 691 bytes[2.85MB] Estimated download size
- for updates from the old APK,
- using File - by - File: File - by - File patch(gzipped) size: 1,
- 912,
- 751 bytes[1.82MB]
来源: http://www.tuicool.com/articles/AvyuaeN