Newstrong's 博客

Kratos
专注于用户阅读体验的响应式博客主题
未分类

moshi 极简封装

目录 前言 Jackson的基本使用 Jackson获取泛型类型的巧妙处理 借鉴jackson优化moshi的封装 使用 总结 前言 之前写了一篇文章是介绍moshi的基本使用和实战,感兴趣的可以先看一下对kotlin友好的现代 JSON 库 moshi 基本使用和实战 在那篇文章中,我们最后针对moshi做了个封装,代码大致如下: import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi import com.squareup.mo…

2024年9月28日 0条评论 6点热度 0人点赞 newstrong 阅读全文
性能优化

内存泄露(十)-- KOOM(高性能线上内存监控方案)

KOOM介绍 OOMMonitor 介绍 KOOM线上APM监控最全剖析 一文看懂快手KOOM高性能监控方案 KOOM 浅析 【开源库剖析】KOOM V1.0.5 源码解析 目录 KOOM 功能 1. Java Heap 泄漏监控 1.1 OOMMonitor 介绍 1.2 OOMMonitor 适用范围 1.3 OOMMonitor 接入 2. Native Heap 泄漏监控 2.1 LeakMonitor 介绍 2.2 LeakMonitor 适用范围 2.3 LeakMonitor 接入 3. Thread…

2024年9月28日 0条评论 3点热度 0人点赞 newstrong 阅读全文
未分类

自定义的BasicTextField,只包含 BasicTextField 的基本功能和 placeHolder

/** * 自定义的BasicTextField,只包含 @see BasicTextField 的基本功能和 placeHolder * * @param placeHolder 没有输入的占位符 */ @Composable fun CustomBasicTextField( value: String, onValueChange: (String) -> Unit, placeHolder: (@Composable BoxScope.() -> Unit)? = null, modifier:…

2024年9月25日 0条评论 3点热度 0人点赞 newstrong 阅读全文
未分类

FindClass from any thread in Android JNI

Android's JNI tips page mentions this FAQ: Why didn't FindClass find my class? They mention multiple solutions and the last option there is this one: Cache a reference to the ClassLoader object somewhere handy, and issue loadClass calls directly. This requires…

2024年9月20日 0条评论 19点热度 0人点赞 newstrong 阅读全文
未分类

Android中进程相关信息获取,pid,进程名

1. 获取pid int pid = android.os.Process.myPid(); 2. 获取进程名及其他信息 ActivityManager mActivityManager = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo appProcess : mActivityManager .getRunningAppPr…

2024年9月20日 0条评论 4点热度 0人点赞 newstrong 阅读全文
Android

Android开发-----JNI反射kotlin静态方法

Google官方sample中的问题 google官方的ndk-sample中的hello-jnicallback项目, 在通过反射调用JniHandler.java类中的getBuildVersion()方法时, 由于是直接调用的java的static方法,并没有出错 而在kotlin的语法中, 要实现java中static需要使用到companion关键字 但是如果只是增加了companion, 那么在jni中通过GetStaticMethodID()获取getBuildVersion()静态方法会报如下错误 …

2024年9月18日 0条评论 3点热度 0人点赞 newstrong 阅读全文
Android

微信Android客户端的ANR监控方案

微信Android客户端的ANR监控方案 用户7563717074065 2021-08-07 1,527 阅读12分钟 mp.weixin.qq.com/s?__biz=MzA… 微信公众号,WeMobileDev 2021年7月19日发布的 微信Android客户端的ANR监控方案 该方案的所有代码已经在Matrix(github.com/Tencent/mat… 1.SignalAnrTracer onAlive方法里调用nativeInitSignalAnrDetective方法监听SIGQUIT信号 pu…

2024年9月18日 0条评论 0点热度 0人点赞 newstrong 阅读全文
Android

信号机制和Android natvie crash捕捉

一、信号机制 image.png 函数运行在用户态,当遇到系统调用、中断或是异常的情况时,程序会进入内核态。信号涉及到了这两种状态之间的转换。 1、信号的接收 接收信号的任务是由内核代理的,当内核接收到信号后,会将其放到对应进程的信号队列中,同时向进程发送一个中断,使其陷入内核态。 此时信号还只是在队列中,对进程来说暂时是不知道有信号到来的。 2、信号的检测 进程陷入内核态后,有两种场景会对信号进行检测: 进程从内核态返回到用户态前进行信号检测 进程在内核态中,从睡眠状态被唤醒的时候进行信号检测 当发现有新信号时,…

2024年9月18日 0条评论 2点热度 0人点赞 newstrong 阅读全文

近期文章

  • 世界,您好!
  • ZSH Git Plugin 别名表格
  • Prefer Function Reference over Lambda in Kotlin? Wrong!
  • ZonedDateTime toString compatability with ISO 8601
  • Jetpack 自定义 DropDownMenu
标签聚合
gpt googleplay kotlin

COPYRIGHT © 2026 Newstrong's 博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang