Android Weekly Notes #434 #435

Android Weekly Issue #434

Busting Android performance myths

几个关于Android性能的谜题.

  • Myth 1: Kotlin apps are bigger and slower than Java apps -> 不是.
  • Myth 2: Getters and setters are expensive -> 不是.
  • Myth 3: Lambdas are slower than inner classes -> 没有.
  • Myth 4: Allocating objects is expensive, I should use pools -> 这个问题有点复杂, 取决于实际应用场景和实现.
  • Myth 5: Profiling my debuggable app is fine -> debuggable的app没有经过优化, 你可能会把时间浪费在不需要优化的点上.

还有一些奇怪的事情:

  • Strangeness 1: Multidex: Does it affect my app performance?
  • Strangeness 2: Dead code

使用了这个工具:
https://developer.android.com/studio/profile/benchmark

Android Emulator in a CI environment

Android官方博客: https://android-developers.googleblog.com/2019/10/continuous-testing-with-new-android.html

开源了android emulator container:
https://github.com/google/android-emulator-container-scripts

除了部署还可以debug.

Android Weekly Issue #435

Android Sharesheet: Old Dog, New Tricks

分享弹框.

val share = Intent.createChooser(Intent().apply {
  action = Intent.ACTION_SEND
  putExtra(Intent.EXTRA_TEXT, "https://developer.android.com/training/sharing/")

  // (Optional) Here we're setting the title of the content
  putExtra(Intent.EXTRA_TITLE, "Introducing content previews")

  // (Optional) Here we're passing a content URI to an image to be displayed
  data = contentUri
  flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
}, null)

startActivity(share)

Don’t argue with default arguments

关于Kotlin默认参数的实现讨论.

Kotlin Coroutines in Android Summary

协程相关知识点总结.

Paging Library for Android With Kotlin: Creating Infinite Lists

Paging Library的教程, 创建无限的list.

Accessing an Android app secret from GitHub Actions using Gradle

如何处理secrets.

原来Github的settings里面有secrets, github actions的workflow里可以访问到.

Using Github Actions to Automate Our Release Process

用Github Actions来自动化发布.

这里面的脚本还挺全.

可以自动更新changelog.
可以通知slack channel.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容