How to Publish an Android Library to jcenter

I used to using this plugin for creating android library release zip file, and manually upload it to bintray website. blundell/release-android-library Recently, it says it’s no longer being maintained; and another gradle plugin is recommended. novoda/bintray-release Novoda’s bintray-release allows you to upload locally built javadoc/source jars, and library aar files to bintray directly, without manual work. What a relief if it really works. By following the instructions on GitHub, within minutes, the configuration is ready for trial. ...

December 3, 2019

Android Studio Plugin 開發踩坑記 (I)

對一個 Android app 開發者來說,工作中使用時間最長的軟體,我想應該就是 Android Studio 了吧。 工欲善其事,必先利其器。除了要花時間熟悉內建的各項功能外,有些時候,根據自己的開發習慣,會希望它再額外多些功能,讓自己的開發流程更加順手。 ...

October 6, 2019

My 2 cents on Image Processing in Flutter

In Flutter, it’s easy to load an Image widget. Flutter provides several different ways: You can use ***Image.network(), Image.asset() or Image.memory()***depending on the source you want to load the image. However, Flutter is known to be slow at processing image, including decoding image when the source file is relatively large. View gist The above code snippet is an example of loading an Image from the internet. At line 8: download the data from the internet; ...

July 29, 2019

Flickr Authentication in Flutter (Part II)

Flickr Authentication in Flutter (II) Following the steps described in last article, you can have a working version of Flickr authentication module in Flutter. However, it’s very tedious to remember the pin code, and input it in the dialog in step 2. By reading closely the “Getting a request token” part in Flickr website, you’ll find that, in fact, there’s another way to get the verifier we need without user intervention. A parameter called “oauth_callback” is used to specify a url. If it’s defined in the request; after authorization is complete, Flickr will redirect the user back to your application using the oauth_callback specified with your Request Token. It looks like this: ...

July 25, 2019

Summary of Clean Architecture (I)

上高地。日本 Clean Architecture: A Craftsman’s Guide to Software Structure and Design, First Edition Part I writing working codes is easy; to write codes that are easy to maintain and extend is really hard. Ch1 What is Design & Architecture In this book, design and architecture means the same thing: it’s simply a continuum of decisions from the highest to the lowest levels. ...

July 25, 2019

Flickr API integration in Flutter with Dart

Flickr used to be a cool photo service that gathered many talented photographers. I started uploading all my photos to it since 2005, and now I’ve uploaded more than 160k photos. With so many memories in Flickr, I would like to have an app to randomly show me my own photos in order to refresh good old memories. There are many Flickr API Kits in different programming languages in Flickr official website; however, Dart is not one of them. I either need to implement the API wrapper by referencing its Web API document or find another solution on the internet. ...

July 23, 2019

幻滅,是成長的開始 — Flutter 的 async 與 isolate

原以為 Flutter 寫起來很開心,有任何耗時比較長的工作,就塞到一個 Future someFunction(…) async {…} 中就好,不需要像 Android 裡還需要用到 rxJava 或是自己建 thread 來處理。但後來發現其實沒有那麼單純。就像下面這篇文章開頭講的一樣:剛接觸 Flutter 的人通常不會管到 asynchronous 的問題,直到 UI 開始變得很卡的時候。 ...

May 28, 2019

如何移掉 flutter app 中的 debug label

在開發的時候,會注意到畫面的右上角有個 Debug 的標籤。官方的說法是,因為開發的版本開啟了很多協助開發或除錯的功能,所以運行速度會跟正式版差很多。為了避免使用的人以為這就是 flutter app 的速度,所以針對測試中的版本,預設都會加上 debug 標籤,讓人比較不會誤會 (真的這樣就不會誤會嗎?) ...

May 11, 2019

Flutter 中處理 Image 的方式

Image processing in flutter (remove white background) 在 Android 中,把圖片顯示出來前,如果對 Image 做點變化的話,通常會將 Image 先轉成 Bitmap,再針對 Bitmap 中的每個 pixel 去做處理,最終轉成 Drawable,再送給 View 去繪製。作法可以參加 CalliImageView 中的 adjust function。 ...

April 13, 2019

Extract translated strings in Android project

Hakone.Japan It’s common that an android developer is working on several projects. Sometimes, you just need some existing string translations from another Android project. Usually, the translated strings are scattered in strings.xml file in tens of folders named values-xx. There’s no easy way to copy these string definitions from multiple folders into new project. Therefore, I wrote a simple python script to do the job. All you have to do is: ...

April 3, 2019