原创 aidl實現線程間通信(實現步驟)

介紹 爲使應用程序之間能夠彼此通信,Android提供了IPC (Inter Process Communication,進程間通信)的一種獨特實現: AIDL (Android Interface Definition Languag

原创 RecyclerView簡單實現預加載(筆記)

添加依賴 compile 'com.android.support:recyclerview-v7:25.1.0' compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.8

原创 H5混合開發 js與java相互調用

介紹 本篇主要介紹H5與android相互調用 1.Android中調用H5的js的實現 首先創建一個index頁面 <!DOCTYPE html> <html lang="en"> <head> <meta charset=

原创 Viewpager中使得ImageView放大縮小

import android.content.Context; import android.graphics.Matrix; import android.graphics.PointF; import android.graph

原创 TabLayout+ViewPager+Fragment聯合使用

主頁面佈局 添加Tablayout和ViewPager兩個控件 1.添加依賴庫(根據自己依賴庫修改) compile ‘com.android.support:support-v4:24.1.0’ compile ‘com.androi

原创 MVP模式 簡單介紹

MVP示例圖 實現步驟簡單介紹 1.創建IPresenter接口,把所有業務邏輯的接口都放在這裏,並創建它的實現PresenterImpl(在這裏可以方便地查看業務功能,由於接口可以有多種實現所以也方便寫單元測試) 2.創建IView

原创 Retrofit的GET請求使用,結合Gson解析

添加依賴 compile 'com.squareup.retrofit2:retrofit:2.2.0' //轉換器 compile 'com.squareup.retrofit2:converter-gson:2.2.0' compil