其實android 寫program 都幾煩 ....

最近搞緊個小project ,想寫個android app .... 



其實Android 同iOS , 最煩係版本一轉版本,隨時會有功能轉了

例如想用media 去揾檔案,點知去到4.0 開始,唔可以直接用 GetPath 揾檔案位置,要用好多額外coding 揾 .... 

原因:

但在Android 4.4以及之後的版本,系統似乎內建了內容瀏覽器,並且使用了Android 4.4之後才新增的文件URI格式,回傳的URI Authority將會使用「com.android.externalstorage.documents」、「com.android.providers.downloads.documents」或是「com.android.providers.media.documents」。如果直接用這樣的URI查詢ContentProvider,將會得到空的路徑,因此這樣的URI需要進行一些轉換,才能被用來查詢ContentProvider。

咁搞都好煩 ... 


好彩,Lotus Script 同Lotus Formula 功能都好穩定,唔call 其他library , 其實多數可以平安過渡去新版 ... 

ref : https://magiclen.org/android-filechooser/

ref: http://hmkcode.com/android-display-selected-image-and-its-real-path/

Add comment


Security code
Refresh