Android Weekly Issue #395
Android Biometrics UX Guide – User Messaging
There are currently only 3 types of Biometrics as of API 29 (Android 10).
// Get Package Manager
val packageManager : PackageManager = context.packageManager
Fingerprint (Added in API 23)
val hasFingerprint = packageManager.hasFeature(PackageManager.FEATURE_FINGERPRINT)
Face (Added in API 29)
val hasFace = packageManager.hasFeature(PackageManager.FEATURE_FACE)
Iris (Added in API 29)
val hasIris = packageManager.hasFeature(PackageManager.FEATURE_IRIS)
Android Unidirectional Data Flow and Local Unit Testing
好长的一篇文章 -> 所以我没有仔细看.
讲了很多单向数据流的架构, 以及测试相关.
看了一个dagger的视频, 2019 dev summit的.
推荐了官方文档, 还有一个codelab project.
后面另一个人上场之后开始讲dagger+kotlin.
以及dagger之后的计划.
Kotlinx Json vs Gson
一个kotlin官方出的json解析库:
https://github.com/Kotlin/kotlinx.serialization
- 跨平台
- 支持: SON, CBOR, and Protobuf.
- 可以结合Retrofit用.
Dagger in a multi-module project without dagger.android
多模块下的dagger.
Implementing your first Android lint rule
自己实现Android Lint rule.
打印log不用Log
Build complex screens faster on Android with Epoxy
使用这个库: https://github.com/airbnb/epoxy
库:
时间线view
https://github.com/vipulasri/Timeline-View
Android Weekly Issue #396
Several Free & Easy Ways to Promote Your App
- Post Your App to ProductHunt
- Answer Questions on Quora
- Get Your App Listed in Roundup Lists
- Write Guides & Tutorials
- Optimize Your Keywords
- Get Influencers to Use Your App
- Talk to Journalists
- Get Active in Forums, Subreddits, and FB Groups
- Create a Referral Program
- Get Your App Featured by Apple & Google
- Make it Easy to Share Content from Your App
- Submit Your App for an Award
- Speak at Events Related to Your App
Kotlin Inject
https://github.com/chRyNaN/inject
这个库的目的就是把Java注解包装了一下好用Dagger?
针对的平台: Kotlin multi-platform.
How to resize Icons & Images easily in Android Studio | John Codeos
工具: Android Drawable Importer
Prepopulate Room with data
Let's Review: Pokedex
宠物小精灵app: https://github.com/mrcsxsiq/Kotlin-Pokedex
Android Weekly Issue #397
Screenshot Testing our Design System on Android
UI: 统一组件, 测试.
Any, Unit, Nothing and all their friends
- Any -> 编译后变成Object
- Unit -> Java中方法返回的void, 实际上Unit的实现是一个单例, Any的一个子类.
- Nothing -> 一个只有私有构造的类型, 没有实例. 用于表示不可能存在的值. 只抛出异常的方法, 不可能有返回值, 就返回Nothing. Nothing是所有类型的子类型.
Store grand re-opening: loading Android data with coroutines
又是讲这个库的: https://github.com/dropbox/store
Kotlin Multiplatform — MVVM & Clean Architecture
有一个不错的架构图.
Code & Libraries
https://github.com/scana/ok-gradle
这个插件还挺方便的, Android Studio中添加依赖.
Android Weekly Issue #398
Bringing an old Android library back to life with Kotlin
把一个老的Java库转换为Kotlin库.
转换后的库: https://github.com/chRyNaN/chords
Butterfly Effects
作者回顾这些年他的进步.
有一个给自定义View用注解加属性的开源库还不错.
https://github.com/ZacSweers/Barber
这个画图工具也挺好的: https://excalidraw.com/
作者说他的三个开源项目后来带来了很多机会, 包括演讲, 博客, 更多的开源项目等.
O(1) Android build time at Tiki
多模块来加快build速度.
Documenting your XML attributes for a Custom View
原来给自定义属性加上注释, 就会出现在ide解释里面.
What’s In Your Toolbox?
作者爱用的一些工具.
github actions原来是个CI啊.
https://github.com/features/actions
设计网站:
material: https://material.io/
facebook的设计网站: https://facebook.design/toolsandresources/
做动画的工具: https://github.com/alexjlockwood/ShapeShifter
Using LiveData & Flow in MVVM — Part I
Enabling dark theme in Android WebViews
Android Weekly Issue #399
Adding some Storage (to) Space
这人用Kotlin multiplatform写了个小程序, 用了Compose和SwiftUI:
https://johnoreilly.dev/posts/minimal-kotlin-platform-compose-swiftui/
本篇文章是写他用SQLDelight加了数据存储的部分.
The Power of Types for Errors
多使用自定义类型, 而不是原生类型, 来写出错误更少, 可读性更强的代码.
Encrypting Shared Preferences with the AndroidX Security Library
数据加密官方framework: https://developer.android.com/topic/security/data.md
可以加密文件和shared preferences.
Android Fragments: FragmentContainerView
Kotlin Code Organization
关于如何组织代码.
Android Weekly Issue #400
Android Styling: Themes vs Styles
style: view属性的集合.
theme: 一组属性声明, 并不特定于View. style, layout可以使用theme中定义的属性.
It's Nothing
Adventures in the Land of EditText
Dynamic screens using server-driven UI in Android
用服务器配置UI显示.
这里面提到几个UI显示的库:
- Epoxy from Airbnb
- Litho from Facebook
- Proteus from Flipkart
- Graywater from Tumblr
- Groupie
Epoxy and Litho是最被广泛使用的.
Utils class in Kotlin
From RxJava to Kotlin Flow: Backpressure
Become a Master Builder with these Android Dev Tools
开发工具介绍.
- Vysor
- Chucker
- Stetho
- LeakCanary
- Shape Shifter
- Charles Proxy
- Accessibility Scanner
- Window VQA
- Screen Recorder
- Dev Tiles
The Surface Duo SDK Preview
微软的一个sdk, 双屏开发.
Android Weekly Issue #401
Tame Your Gradle Dependencies just BECAUSE!
可以给依赖加原因:
implementation("com.blundell:android-blog:1.2.3") {
because "If we didn't Blundell might cry."
}
Dropping Columns Like It's Hot
要删除数据库中的一列.
SQLite本身是不支持的, 用到的第三方库的实现是拷贝了表, 去掉该列.
在此过程中发生了外键的问题, 通过改变流程来解决.
Android Fragments: FragmentFactory
构造有参数的Fragment -> FragmentFactory.
Use view binding to replace findViewById
// Available in Android Gradle Plugin 3.6.0
android {
viewBinding {
enabled = true
}
}
// Android Studio 4.0
android {
buildFeatures {
viewBinding = true
}
}
优势:
- 类型安全.
- Null Safety.
viewBinding和dataBinding的关系? 区别?
- view binding不需要给xml外面包装
标签了. - 两者可以同时使用, 此时要加layout标签.
Android functional Clean Architecture
Getting Started with Kotlin on iOS, Part 1
Code
https://bubu1.eu/openpush/
https://github.com/ncapdevi/FragNav
Json 2 Kotlin转换插件:
https://plugins.jetbrains.com/plugin/9960-json-to-kotlin-class-jsontokotlinclass-
Android Weekly Issue #402
Kdoc for Android libraries using Dokka
Kotlin的文档生成工具: https://github.com/Kotlin/dokka
本文是使用过程中一些具体问题的解决.
Mastering Android Emulator SIM card
模拟器高端玩家.
Exploring the Android 11 Developer Preview: Permission Changes
11的开发者预览: https://android-developers.googleblog.com/2020/02/Android-11-developer-preview.html
本文是对permission部分的内容.
Is Your Kotlin Code Really Obfuscated?
Kotlin的参数检查会暴露名字.
可以通过更新混淆规则解决.
An efficient way to use Uniflow
Uniflow: https://github.com/uniflow-kt/uniflow-kt
单向数据流, 用了协程.
本文是个小例子.
A Dependency Injection Showdown
4个DI框架的比较:
- Koin
- Kodein
- Dagger
- Toothpick
Cheatsheet about Dagger
一些dagger的cheatsheet.
News
https://android-developers.googleblog.com/2020/02/Android-11-developer-preview.html