標籤:JAVA

使用 Google AdMob 在 Android APP 插入廣告
大部分 Android APP 的商業模式都是使用免費增值模式,也就是基本功能免費,進階功能付費。在這種模式下,除了依靠使用者付費之外,通常也會插入廣告來創造更高的收益。而 Google AdMob 就能完成這件事情。本文將以 Android 示範如何在 Android APP 內插入 Google 廣告。

Android 卡片翻轉動畫效果
大概思路是先建立兩個 View 疊在一起,一前一後,前面的顯示,後面的隱藏。旋轉的時候分三步驟,第一步將前面的 View 從 0 度旋轉到 90 度,第二步將前面的 View 隱藏,後面的 View 顯示,第三將將後面的 View 從 -90 度旋轉到 0 度,這樣就完成了一次卡片旋轉動畫,下面來看看實際的程式碼該怎麼寫。

Android 6 種資料儲存方法總結說明
前幾篇文章介紹了在 Android 開發中,使用的各種資料儲存方式。Android 資料儲存方式包含:Resource Files、Internal Storage、External Storage、SharedPreferences、SQLite 資料庫及 Room 資料庫。

Android Room 資料庫使用方法
Room 持續性資料庫為 SQLite 提供抽象層,可讓資料庫更順暢的存取,同時充分發揮 SQLite 的效用,由於 SQLite API 存在一些缺點,因此 Google 強烈建議使用 Room 來存取 SQLite 資料庫中的資料。

Android SQLite 資料庫使用方法
SQLite 是一種輕量化的關聯式資料庫,適合用來儲存複雜且重複的結構化資料,如果您熟悉 SQL 資料庫,那麼使用 SQLite 必定能駕輕就熟,使用上大同小異。目前 Android 已經內建 SQLite ,無需安裝任何套件,也無需任何權限就能使用。

Android SharedPreferences 使用方法
SharedPreferences 是一種輕量化的 Key-Value 資料儲存方式,適合用來儲存簡單輕量的資料,例如使用者帳號、暱稱、登入時間...等等。如果是複雜格式的資料,則建議使用 JSON 檔案或 SQLite 資料庫儲存。

Android External Storage 外部儲存使用方法
External Storage 中的檔案能與其他 APP 共享資源,也可以使用手機內建的檔案管理 APP 來瀏覽這些檔案。由於 External Storage 儲存設備可能被使用者移除,因此比較適合用來儲存 APP 執行時非必要的檔案,就是被刪除也不影響 APP 執行的檔案。

Android Internal Storage 內部儲存使用方法
Internal Storage 是在 Android 安裝 APP 後,系統會自動在手機內部規劃一個專屬的目錄 (app-specific) 來儲存 APP 資料。適合用來儲存 APP 執行時會用到的必要檔案,或較機密的資料。

Android Resource Files 資源檔案使用方法
Resource Files 是用來儲存圖檔、動畫檔、佈局檔......等靜態資源,儲存的目錄有 res 及 assets 兩個目錄,其中又以 res 目錄最常使用。res 目錄具有嚴格的子目錄結構定義,assets 則可以自訂目錄結構。

Android 資料儲存 - 完整目錄
本文為 Android 資料儲存系列文章的目錄,Android 資料儲存方式包含:Resource Files、Internal Storage、External Storage、SharedPreferences、SQLite 資料庫及 Room 資料庫。