Android Weekly Notes

Android Weekly Notes #503

2022-05-24  本文已影响0人  圣骑士wind

Android Weekly #503

https://androidweekly.net/issues/issue-503

Your Deep Links Might Be Broken: Web Intents and Android 12

每个Android版本的发布都会带来两种changes:

Google提供了Behavior changes的文档: Behavior changes: all apps

Android 12对deeplink有了这个改动:

Starting in Android 12 (API level 31), a generic web intent resolves to an activity in your app only if your app is approved for the specific domain
contained in that web intent. If your app isn't approved for the domain, the web intent resolves to the user's default browser app instead.

这个改动是什么意思呢?

从Android 6开始, Google提供了Android App Links, 可以把app作为链接的默认处理方式, Android系统会直接打开这个app. (需要在自己domain的网站上配置一个文件, 设置app的包名和签名.)

从Android 12开始, Google会要求对HTTP或HTTPS的链接都使用App Links, 否则将永远是在浏览器打开.

几个实现关键点:

Animations in Jetpack Compose with examples

Sample: https://github.com/canopas/Jetpack-compose-animations-examples

Learning in public: Lessons from open source

作者开源了依赖检测插件: https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin

作者讲了他的心路历程.

The Imposter's Guide To Dependency Injection

有Video: https://youtu.be/Nr_njiLsjcM

还发表在这里: The Imposter's Guide To Dependency Injection

从Firebase的例子开始讲起, 如果直接用, 会不可测试.

由构造传入解决了测试问题之后, 下一个问题是, 如果我想共享依赖的实例怎么办.

为了解决这个问题需要做3步:

不同的依赖注入框架都是离不开这基本的三步.

举例说明了Hilt和Koin的例子.

All about Preferences DataStore

data store preference的特点和使用.

Improving App Performance with Baseline Profiles

广告了一下Baseline Profiles这个工具: https://developer.android.com/topic/performance/baselineprofiles

链接里关于facebook app启动速度优化的文章值得一看: https://android-developers.googleblog.com/2021/11/improving-app-startup-facebook-app.html

Make a monorepo for your Android projects

把所有side project搞个mono repo, 听上去是个好主意啊.

文章介绍了一些具体的gradle设置.

sample: https://github.com/blundell/monorepo

Tracing main thread messages in Perfetto

看主线程在干什么.

Building design system with Jetpack Compose

design system.

有系统的介绍, 相关资源和Compose相关的实现.

Kotlin Multiplatform: The Best Choice

多种跨平台方案的比较.

有很多图表.

Code

上一篇 下一篇

猜你喜欢

热点阅读