- 博客(41)
- 收藏
- 关注
原创 深入字节码
字节码万岁!!!https://mp.weixin.qq.com/s/2-ztm5A0W8mDtCrzH_cX-g字节一面:能聊聊字节码么?https://mp.weixin.qq.com/s/h9n6wkqyyrAN6EbmMlFBlA
2022-05-21 11:17:37
177
原创 从责任链模式看Android事件分发
从责任链模式看Android事件分发https://mp.weixin.qq.com/s/sSPFz3E5gncYiMMFtF_xlg每当用户触摸了屏幕,会发出一系列的事件 ACTION_DOWN、ACTION_MOVE、ACTION_UP,如果用户点击后触发了 ACTION_DOWN,后续的事件难道每次都要一个个遍历去寻找目标 View 吗,系统肯定有个机制可以保证快速的找到目标 View。在 ViewGroup 中有个 mFirstTouchTarget 字段就是用来做这个的。这里也是使用..
2021-03-18 09:44:54
198
原创 Android DDMS在mac下打开卡死的问题
Android DDMS在mac下打开卡死的问题https://www.jianshu.com/p/df924fa08e68DDMS 是一款分析Android 性能很好的工具,但是Google爸爸宣布不维护了,导致了现在Android studio 3.0之上的版本都无法打开,只能显示,但是啥都操作不了,原因是jdk的不兼容,如果java version 大于等于1.8.0_152,就会出问题,151版本的就没问题好在有教程。1.找到sdk所在的目录,找到monitor,双击打开,或者配置了A..
2020-12-29 14:43:53
599
原创 Android v1/v2/v3 签名机制
Android | 他山之石,可以攻玉!一篇文章看懂 v1/v2/v3 签名机制https://juejin.cn/post/6906882748909092871
2020-12-17 18:21:16
520
原创 Android AudioRecord录音音量大小
Android AudioRecord录音音量大小https://blog.youkuaiyun.com/lhmin5200/article/details/65632915private doublecalculateVolume(byte[] buffer){ double sumVolume = 0.0; double avgVolume = 0.0; double volume = 0.0; for(int i = 0; i < ..
2020-11-22 16:31:02
2406
原创 Gradle根据参数配置不同的依赖
Gradle根据参数配置不同的依赖 https://zhuanlan.zhihu.com/p/86118527dependencies { implementation 'com.android.support:appcompat-v7:26.0.2' implementation 'com.android.support:design:26.0.2' if ("${rootProject.ext.isUploadMaven}" == ("false")) { .
2020-11-19 14:37:19
487
原创 圆弧布局,卫星菜单
https://github.com/oguzbilgener/CircularFloatingActionMenuhttps://github.com/siyamed/android-satellite-menuhttps://github.com/ogaclejapan/ArcLayoutA very simple arc layout library for Android.https://developer.android.com/reference/an..
2020-11-12 16:29:25
288
1
原创 greenDAO 使用
greenDAO Documentationhttps://greenrobot.org/greendao/documentation/Tutorials and How-TosHow to get startedIntroduction–project setupModelling entities– schema and annotationsSessions– identity scope and session cacheQueries– using the ...
2020-11-06 10:38:38
148
原创 bottomsheetdialogfragment nav bar 黑色变白色
https://stackoverflow.com/questions/47553936/prevent-bottomsheetdialogfragment-covering-navigation-barI had the sameproblemand I finally found a solution which is not hacky or needs an orbitant amount of code.This Method replaced the window backgro...
2020-11-02 16:36:19
592
原创 谷歌官方字体方案
可下载字体https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fontsXML 中的字体https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml
2020-10-28 14:45:28
133
原创 Xposed原理分析
Xposed原理分析https://www.cnblogs.com/boycelee/p/13418371.html安卓系统启动什么zygote?init是内核启动的第一个用户级进程,zygote是由init进程通过解析init.zygote.rc文件而创建的,zygote所对应的具体可执行程序是app_process,所对应的源文件是App_main.cpp,进程名称为zygote。init.zygote.rc:service zygote /system/bin/app_pr..
2020-10-23 11:06:48
2362
1
原创 Android 官方 Kotlin 协程
Android 上的 Kotlin 协程https://developer.android.com/kotlin/coroutines
2020-10-22 15:20:35
273
原创 MessageQueue nativePollOnce 一个不一样的 ANR
一个不一样的 ANRhttp://tao93.top/2019/01/18/%E4%B8%80%E4%B8%AA%E4%B8%8D%E4%B8%80%E6%A0%B7%E7%9A%84%20ANR/经过一番查找与验证,我发现原因大致是,当一个 Java 线程抛出了未捕获的异常时,JVM 先会调用到 UncaughtExceptionHandler,然后再会把此线程停止掉。所以这段代码中,如果主线程抛出异常,那么第 6 行的方法结束后,主线程就会被 JVM 给停止掉,既然主线程都停止掉了,那自然就无..
2020-10-22 14:43:22
6878
原创 Android launchMode
当我按下 Home 键再切回来,会发生什么?https://juejin.im/post/6883741254614515720Understand Android Activity's launchMode: standard, singleTop, singleTask and singleInstancehttps://inthecheesefactory.com/blog/understand-android-activity-launchmode/en...
2020-10-20 18:26:26
166
原创 Gradle Transform
Javassist 在RA 中的应用https://bytedance.feishu.cn/docs/doccnwmMlBfNVmHYVkJ0BBi0ILdTalk About Transform APIhttps://bytedance.feishu.cn/docs/doccn2xC4wxPLDaAwBZFtOkuOlb#
2020-10-20 16:01:17
254
原创 Java 中调用 Kotlin
Java 中调用 Kotlinhttps://www.kotlincn.net/docs/reference/java-to-kotlin-interop.htmllater
2020-10-20 15:46:46
241
原创 Android SharedPreferences的设计与实现
反思|官方也无力回天?Android SharedPreferences的设计与实现https://juejin.im/post/6884505736836022280当SharedPreferences对象第一次通过Context.getSharedPreferences()进行初始化时,对xml文件进行一次读取,并将文件内所有内容(即所有的键值对)缓到内存的一个Map中,这样,接下来所有的读操作,只需要从这个Map中取就可以了。虽然节省了I/O的操作,但另一个视角分析,当xml中数据量过大时,..
2020-10-20 11:00:18
379
原创 Linux 知识小集合
对不起,学会这些 Linux 知识后,我有点飘https://juejin.im/post/6881755746216706062目录Linux 简介 Linux 接口 Linux 组成部分 Shell Linux 应用程序 Linux 内核结构 Linux 进程和线程 基本概念 Linux 进程间通信 信号 signal 管道 pipe 共享内存 shared memory 先入先出队列 FIFO 消息队列 Message Queu..
2020-10-13 10:23:26
170
原创 Android Splash页秒开 Activity白屏 Activity黑屏
带你重新认识:Android Splash页秒开 Activity白屏 Activity黑屏https://blog.youkuaiyun.com/yanzhenjie1003/article/details/52201896闪屏原因剖析StartingWindow(Preview Window)我们正常开发中会在Activity的onCreate()方法中调用setContentView(View)设置该Activity的显示布局,那么问题就来了,既然我们设置了布局,为什么启动的时候还会白屏或者黑屏而不..
2020-10-13 09:45:02
262
原创 android emoji吏上最全的详解
android emoji吏上最全的详解https://blog.youkuaiyun.com/u013394527/article/details/103040564emoji 识别https://apps.timwhitlock.info/unicode/inspectEmoji Unicode Tableshttps://apps.timwhitlock.info/emoji/tables/unicode#emoji-data.txthttps://unicode.org/Publ...
2020-10-12 14:11:19
1282
1
原创 kotlin 协程视频讲解,不只视频
学不会协程?很可能因为你看过的教程都是错的——Kotlin 的协程「用力瞥一眼」https://www.bilibili.com/video/BV164411C7FK?t=613Kotlin 协程的挂起好神奇好难懂?今天我把它的皮给扒了https://www.bilibili.com/video/BV1KJ41137E9?t=132到底什么是「非阻塞式」挂起?协程真的比线程更轻量级吗?https://www.bilibili.com/video/BV1JE411R7hp...
2020-10-12 13:33:49
630
原创 Android app 后台被杀恢复
android 模拟应用因内存不足被后台杀死命令https://www.jianshu.com/p/effb4546b9aaadb shell am kill-all 应用通过home键已经停留在后台使用,杀掉所有后台程序,需要先将目标程序按home进入后台,然后打开一个其他程序ps:命令多运行几次处理Android应用在后台被杀死https://blog.youkuaiyun.com/xiao_nian/article/details/79970144一、背景 我们...
2020-10-12 11:40:15
3457
2
原创 Android全面解析之Handler机制
Android全面解析之Handler机制https://blog.youkuaiyun.com/weixin_43766753/article/details/108968666有空再记录
2020-10-10 09:43:19
355
原创 TextView 无序列表
How to add bulleted list to android application?https://stackoverflow.com/questions/4992794/how-to-add-bulleted-list-to-android-application一、Tough to do as ul/li/ol are not supported. Fortunately you can use this as syntactic sugar:• foo...
2020-10-09 17:08:18
457
原创 SharedPreferences性能问题
SharedPreferences性能问题https://bytedance.feishu.cn/docs/doccnqs6lpMphwYg0R6cOZaW7Cc#SharedPreferences ANR 总结https://zhuanlan.zhihu.com/p/152623807获取 SharedPreferences 总结:获取 SP 的过程是通过 synchronized 关键字保证多线程安全的。 通过 Map 进行缓存 Sp 实例,因此多次调用 getSharedPr...
2020-10-09 13:54:27
1053
1
原创 Java并发——Synchronized优化(轻量级锁、偏向锁)
Java并发——Synchronized优化(轻量级锁、偏向锁)https://blog.youkuaiyun.com/asialiyazhou/article/details/760986071 重量级锁在上一篇博客中我们知道,Synchronized的实现依赖于与某个对象向关联的monitor(监视器)实现,而monitor是基于底层操作系统的Mutex Lock实现的,而基于Mutex Lock实现的同步必须经历从用户态到核心态的转换,这个开销特别大,成本非常高。所以频繁的通过Synchronized.
2020-10-09 11:28:18
140
原创 Android Sqlite DB 事务、连接、串行执行
What are the best practices for SQLite on Android?https://stackoverflow.com/questions/2493331/what-are-the-best-practices-for-sqlite-on-android/3689883#3689883The SqliteOpenHelper object holds on to one database connection. It appears to offer you a ...
2020-10-09 11:01:01
217
原创 Don't break the chain: use RxJava's compose() operator
https://blog.danlew.net/2015/03/02/dont-break-the-chain/One nice aspect of RxJava is that you can see how data is transformed through a series of operators:Observable.from(someSource) .map(da...
2019-11-24 10:59:12
213
原创 RxJava使用速查
为什么要用RxJava?RxJava的观察者模型可以让我们用各种类似集合的操作符来方便的操作异步数据的集合,Observables和他的近亲Iterable对比。对于普通集合迭代的时候,我们是从集合中拉取数据,而Observables是主动的推送数据到观察者。RxJava以同样的原则对待同步和异步线程产生的数据流。对于异步操作,避免了回调嵌套地狱。流式调用让代码更容易阅读理解,减少bu...
2019-11-21 17:57:37
175
原创 RxJava官方Wiki
RxJava官方Wiki https://github.com/ReactiveX/RxJava/wiki/Filtering-Observables
2019-11-18 19:46:03
417
原创 RxJava基本原理
给 Android 开发者的 RxJava 详解❤❤❤❤❤https://gank.io/post/560e15be2dca930e00da1083RxJava基本原理分析❤❤❤❤❤ https://www.jianshu.com/p/88aacbed8aa5关于 RxJava 最友好的文章—— RxJava 2.0 全新来袭❤❤❤❤❤ https://juejin.im/post/582...
2019-11-18 16:46:00
184
原创 给初学者的RxJava2.0教程
给初学者的RxJava2.0教程(一)❤❤❤❤❤ https://www.jianshu.com/p/464fa025229e给初学者的RxJava2.0教程(二)❤❤❤❤❤ https://www.jianshu.com/p/8818b98c44e2给初学者的RxJava2.0教程(三)❤❤❤❤❤ https://www.jianshu.com/p/128e662906af给初学...
2019-11-18 16:43:13
179
原创 RxJava使用目录
0. 简介 1. 创建操作符 1.1 create() 方法预览: 有什么用: 怎么用: 1.2 just() 方法预览: 有什么用? 怎么用? 1.3 From 操作符 1.3.1 fromArray() 方法预览: 有什么用? 怎么用? 1.3.2 fromCall...
2019-11-18 13:43:19
158
原创 协程相关博文
Kotlin 协程入门这一篇就够了https://juejin.im/post/5d0afe0bf265da1b7152fb00 Kotlin 的协程用力瞥一眼https://kaixue.io/kotlin-coroutines-1/
2019-11-17 13:38:52
115
原创 协程在Retrofit上的使用
前情提要:很简单的用法,没啥可补充的,英文也很简单,自己看吧。Suspend what you’re doing: Retrofit has now Coroutines support!It official now!Retrofit 2.6.0has been released with support for suspend functions.This allows...
2019-11-17 11:39:00
1879
1
原创 Coroutines On Android (part III): Real work(协程在Android上的使用三:真实案列)
前情提要:本文作者是谷歌公司的大牛,其实这一篇文章主要讲了如何用协程解决多线程并发的问题,有3中方法。1、是取消上一个任务;2、是排队执行任务;3、是重用上一个任务。非常值得看看。This is part of a multi-part series about using Coroutines on Android. This post focuses on solving pract...
2019-11-16 14:39:36
531
原创 Coroutines on Android (part II): Getting started(协程在Android上的使用二:开始)
前情提要:本文作者是谷歌公司的大牛,主要讲了结构化并发启动协程,以保证1、父作用域取消时,所有子作用域也会被取消;2、挂起方法返回时,里面的协程执行完毕;3、内部协程出错时,外部会得到通知。This is part of a multi-part series about using Coroutines on Android. This post focuses on starting...
2019-11-16 12:48:51
316
原创 Coroutines on Android (part I): Getting the background(协程在Android上的使用一、背景)
前情提要:本文作者是谷歌公司的大牛,主要介绍协程和callback背景介绍,值得看看。This is part of a multi-part series about using Coroutines on Android. This post focuses on how coroutines work and what problems they solve.Other art...
2019-11-15 16:45:44
344
原创 将kotlin协程和架构组件一起使用
前情提要:kotlin协程和架构组件一起使用,完全都不用自己care取消耗时任务执行的问题,真香。Use Kotlin coroutines with Architecture componentsKotlin coroutinesprovide an API that enables you to write asynchronous code. With Kotlin corouti...
2019-11-15 14:17:28
930
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人