原创 安卓性能優化之懶加載的原理及實現(超詳細仿微信頭條實現Fragment數據懶加載)

從ViewPager的源碼層理解實現fragment 的懶加載 Part1:懶加載概述1: 懶加載的由來和預加載的弊端2:什麼是懶加載?3:從ViewPager的源碼理解爲什麼不能通過setOffscreenPageLimit方

原创 Android framework源碼分析二 應用進程啓動流程源碼分析(Android8.0)

點擊桌面圖標如何啓動的app Android8.0概述1:APP啓動的入口Launcher的分析2:APP的啓動在Activity中啓動過程3:APP的啓動在AMS中啓動過程4:Process、ZygoteProcess的啓動過程

原创 Android studio編寫第一個NDK工程的過程詳解(附Demo下載地址)

Android studio編寫第一個NDK工程的過程詳解,以及Demo下載地址1:創建工程和配置NDK2:編寫JNI程序1:創建HelloWord.java類在此類中定義native方法,注意該文件中最好不要有中文字符,我這裏加

原创 面試必備2:JDK1.8LinkedHashMap實現原理及源碼分析

JDK1.8LinkedHashMap實現原理及源碼分析概述LinkedHashMap的數據結構增、改put(key,value)方法源碼1:重寫了newNode()方法源碼2:複寫了afterNodeAccess(Node e

原创 ARouter::There is no route match the path [/xxx/xxx], in group [xxx][ ]

ARouter::There is no route match the path 問題的解決 出現這個問題,我按照按照官方給的排查問題的方案未能解決,因爲自己的配置沒問題,解決方案如下。 1:先說說一般出現這個問題可能由以下原因

原创 RPC failed curl 18 transfer closed with outstanding read data fatal protocol error bad pack header

本週從git clone下載項目時由於項目過大,http方式報錯protocol error: bad pack header,ssh方式報錯fatal: early EOF fatal: index-pack failed期間查

原创 java.lang.IllegalArgumentException: Unexpected char 0x5a46 at 35 in Content-Disposition value: f

java.lang.IllegalArgumentException: Unexpected char 0x5a46 at 35 in Content-Disposition value: form-data; name=“fil

原创 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk

今天在集成三方SDK是出現**Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in lib

原创 Android NDK 運行錯誤:java.lang.UnsatisfiedLinkError: Couldn't load XXX indLibrary returned null

今天試着去編譯打包so庫出現,在最後加載時出現了java.lang.UnsatisfiedLinkError: Couldn't load XXX indLibrary returned null,找不到so庫,檢查了一番原來是因

原创 Android studio運行時報錯Cause: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

Cause: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26) studio 編譯時沒問題,運行時出現了Cause: invalid opcode

原创 OKhttp在4.x手機報錯java.lang.ExceptionInInitializerError

今天在自測時,項目跑到紅米4.4的手機上Okhttp報錯java.lang.ExceptionInInitializerError,詳細日誌如下: 看到這個錯誤信息Caused by: java.lang.IllegalState

原创 Android studio3.2出現Your project contains C++ files but it is not using a supported native build

Studio3.2 報錯Your project contains C++ files but it is not using a supported native build system 檢查工程的幾項配置 1:gradle

原创 No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android

今天在編譯之前的NDK工程的時候報錯No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android,期間也踩

原创 Android locationManager.getLastKnownLocation(provider)一直未null的解決方案,親測有效

最近在使用Android自帶的LocationManager獲取地理位置信息時,遇到在室內測試locationManager.getLastKnownLocation(provider)一直爲空,至於權限之類的都在AndroidM

原创 微信小程序使用真機或開發工具進行http請求開發測試親測有效

微信小程序使用真機或開發工具進行http請求開發測試1使用微信開發這工具進行http請求的配置2:真機進行http請求 微信開發這平臺要求上線微信小程序配置的合法域以及網絡請求名必須是https,如果是在開發測試階段需要使用htt