就地避難 (Shelter in place)

本來打算趁今天天氣不錯總算出太陽了,打算帶小孩去 Golden Gate Park 散散心避開人潮,畢竟現在 COVID-19 太過嚴重,最好還是不要去人多的地方增加感染的機率! 結果就在我們做好便當 (打算去踏青,順便找個無人的草原野餐) 準備出發的時候,竟然收到這則消息 -

原來就在今天舊金山市長 London Breed宣布整個舊金山在 3/17 凌晨 0:00 am 進入就地避難(Shelter in place) 的狀態,這還是我第一次在美國遇到這種狀況. 就上網查查現在是什麼情況.

Read more »

dagger-in-android.png?w=2924

In Dagger, it provides another way to inject/provide resources by using constructor injection. The typical case is that we use constructor injection in a class to inject needed resources as class parameters. In this way, we can directly use the required resources without declaring the @Inject keyword. Another pro tip is that it has very high potentialities to let your injection more robust and more flexible. Let’s see how we can use constructor injection for providing multi-source injection for the different release versions.

Read more »

kotlin-coroutines-1.png?w=2924

I recently read the source code of Coroutines. It’s pretty fun, and I’ve learned a lot from the source code. I am going to share some I learned here. I would break the learning into several parts. I hope everyone can find something useful for your projects.

Read more »

Process v.s Thread

Android OS is a kind of Linus system. Every time you launch an application on your device, it invokes a process to host this application and provides the necessary resources for the application. By default, all components that come from the same application would run in the same process and thread (called main thread or UI thread). By default, you would run all components, Activity, Service, Receiver, Provider, on the same process. But there’s a way for a specific need for developers who want to run these components on different processes. You can add android: process in the AndroidManifest.xml file in each component declaration. For example,

Read more »

dependency-injection-modularized-android-application-1.jpg?w=2924

Story

I recently encountered an issue that I need to separate the App module (Android project) into several library modules to fulfill the requirements of the Dynamic Feature Module in the future. In the beginning, I thought that should be an easy job, how hard it can be?

wait-its-hard.gif
How hard it can be?

Read more »

gopher10th-small.jpg
Credit by Golang Official Blog

In many programming languages such as Java, Kotlin, Objective-C, and Swift, they support the Generic programming. But in Golang, it doesn’t have that kind of feature. What if we want to use this feature, how can we do? Let’s check the Interface in Golang. And how it can achieve the generic programming in Golang.

Read more »

logos.jpg?w=2924

Why

I used to use Wordpress to write my blog. But I recently think of creating the blog system by Golang and make it for fun. Here is what I am doing now. The main reason I start doing is that I found the markdown support in Wordpress is slightly weird and hard to use. When I try to change some blog content, the markdown style sometimes won’t show correctly. That makes me feel frustrated. I think that probably might because I am using the free plan in wordpress.com and have less control of my blog.

So, my goal is quite simple and straightforward. The new blog should fully support markdown content. And it should serve a clean and straightforward interface. Let’s see how I am going to do it.

Read more »