自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 收藏
  • 关注

原创 函数返回值不用变量接收的话去哪了

函数返回值不用变量接收的话去哪了

2022-08-04 12:21:36 348 1

原创 记录下app_process相关的东西

首先在Android系统启动的时候会解析init.rc文件,在init.rc文件中import了zygote.rc如下://init.rcimport /init.environ.rcimport /init.usb.rcimport /init.${ro.hardware}.rcimport /init.${ro.zygote}.rcimport /init.trace.rc//init.zygote32.rcservice zygote /system/bin/app_proces

2021-09-01 17:19:18 594 1

原创 Android11 Activity启动流程

2021-08-04 23:11:58 1135 1

原创 kotlin协程原理

kotlin的协程包括基础设施部分和在基础设施上封装的库。主要看下自己如何使用基础设施部分以及它的原理。首先看下我们如何使用的。1.创建协程。fun <T> launch(block : suspend () -> T){ val continuation = block.createCoroutine(object : Continuation<T> { override val context: CoroutineContext = E

2021-08-02 17:19:51 542

原创 Fragment的添加过程

因为看到有些开源框架通过添加一个Fragment监听Activity的生命周期,平时我们用的Fragment都会带有一个布局。那这个Fragment添加到哪了呢?

2021-06-21 17:35:34 967

原创 Android对View预加载

为什么要对View进行预加载呢?提高Activity的启动速度,避免每次解析xml文件。我的思路是对每个Activity要setContentView的的布局进行预加载

2021-06-20 14:39:04 1565

原创 Service的执行流程

当我们执行startService的时候,通过ContextImpl对象执行到startServiceCommon方法:private ComponentName startServiceCommon(Intent service, boolean requireForeground, UserHandle user) { try { validateServiceIntent(service); service.

2021-06-16 17:26:25 682

原创 Android对Bitmap像素进行操作实现滤镜效果

偶然间看到Bitmap对象有getPixel方法和setPixel方法,想到通过这两个方法就可以对Bitmap简单实现滤镜效果了。索性就试了一下。首先获取原始图片并拷贝一份出来进行对比.BitmapFactory.Options options = new BitmapFactory.Options(); options.inMutable = true; src = BitmapFactory.decodeResource(getResources(), R.dr

2021-05-16 23:58:05 498

原创 Android补间动画流程分析

补间动画我们一般AnimationUtils调用load加载一个Animation对象。public static Animation loadAnimation(Context context, @AnimRes int id) throws NotFoundException { XmlResourceParser parser = null; try { parser = context.getResources(

2021-04-09 17:38:06 219

原创 Android逐帧动画执行流程

AnimationDrawable animationDrawable = (AnimationDrawable) getResources().getDrawable(R.drawable.frame_animation);通过以上代码的获取到一个AnimationDrawable,R.drawable.frame_animation随便写的,如下:<item android:drawable="@drawable/ic_launcher_background" android:dura.

2021-04-09 15:36:20 241

原创 Android版本和api级别对应关系

平台版本 API 级别 VERSION_CODE 备注 Android 10.0 29 Q 平台亮点 Android 9 28 P 平台亮点 Android 8.1 27 O_MR1 平台亮点 Android 8.0 26 O 平台亮点 Android 7.1.1 ...

2021-03-18 18:42:33 142

原创 linux中/proc/stat和/proc/[pid]/stat的解析说明

/proc/[pid]/stat记录的是系统中某个进程的状态信息,可以看到所有的信息使用空格分割开了,我们可以进行解析7401 (kworker/u8:1) S 2 0 0 0 -1 69238880 0 0 0 0 57 0 0 0 20 0 1 0 9983671 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 1 0 0 17 3 0 0 0 0 0 0 0 0 0 0 0 0 0pid: 进程ID. comm: task_str.

2021-03-04 16:38:39 2822 1

原创 Leakcanary流程分析

Leakcanary 是我们Android开发中检查内存泄漏的利器。之前有看过源码不太记得了再回顾一遍并记录下来。用法很简单,在我们自定义的Application中的onCreate函数中调用LeakCanary.install(this);public static RefWatcher install(Application application) { return refWatcher(application).listenerServiceClass(DisplayLeakSer

2021-03-03 18:15:57 134 1

原创 okhttp连接复用流程

首先在ConnectInterceptor拦截器的intercept方法中@Override public Response intercept(Chain chain) throws IOException { RealInterceptorChain realChain = (RealInterceptorChain) chain; Request request = realChain.request(); StreamAllocation streamAllocatio

2021-02-24 16:04:02 1521

原创 okhttp 流程分析

先分析同步执行的流程,简单一些:OkHttpClient client = new OkHttpClient.Builder().build();//1Request request = new Request.Builder()//2 .url("https://publicsuffix.org/list/public_suffix_list.dat") .build();client.newCall(request).execute();//3第一步通过建造

2021-02-23 17:51:41 428

原创 opencv 马赛克图片效果

void test(){ Mat originalImage; originalImage = imread("/Users/rzf/Downloads/dogs/src.jpg"); //【1】图片集的采集与处理 int Images_number = 40;//图片集中图片的数量 int step_x = originalImage.cols / Images_number; //将图片剪裁为80*45大小 int step_y = original.

2021-01-27 11:50:10 148

原创 Android无限循环滚动

传统的ViewPager做循环滚动有两种思路。一种是设置count为Integer.MAX,然后根据index对实际数量取模 一种是在开头在开头添加end,在末尾添加start。简单的说就是多两个,滑动到这两个的时候直接setCurrentItem到真正的位置。在观察pdd的拼单的循环滚动的时候,想到几种实现方式。通过Recyclerview,同样跟ViewPager做循环滚动的思路类似,多一点要拦截掉所有的触摸事件。但是这种方式的话无法像pdd的效果那样设置进入和出去的动画。 通过改造Ver

2020-12-31 16:07:16 1722 4

原创 ffmpeg里av_samples_fill_arrays,av_samples_alloc,av_samples_alloc_array_and_samples函数的作用

int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align){ uint8_t *buf; int size = av_samples_get_buffer_size(NULL, nb_channels, nb_samples, .

2020-12-03 17:02:32 2568 2

原创 【转载】模板类不能分文件编写的原因

https://blog.csdn.net/qq_41929943/article/details/103004083

2020-11-20 23:14:36 189

原创 byte为什么要与上0xff

https://www.cnblogs.com/think-in-java/p/5527389.html

2020-11-04 18:20:29 232

原创 instant run开启导致程序不能运行

android studio 的instant run开启后坑死了,也不知道什么时候开启了。程序运行不了,直接crash,会报MainActivity not found in dexPath...,曾开始怀疑是自己的as坏掉了...记录一下,以免下次再遇到。

2017-07-14 01:07:43 671

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除