随笔分类 - android
摘要:Android 实现tcp连接的方式 SocketChannel AsynchronousSocketChannel Socket SocketChannel SocketChannel是Java NIO库提供的一种通道(Channel)类型,用于基于NIO的网络通信。 SocketChannel提
阅读全文
摘要:首先创建一个c++的 Android native项目, 将编译好的so放入指定目录 修改gradle文件 android { ... sourceSets { main { jniLibs.srcDirs = ['jniLibs'] } } } 选择cpu架构 defaultConfig { ex
阅读全文
摘要:MediaRecorderMediaCodecMediaMuxerMediaPlayer ExoPlayer MediaRecorder音频或视频录制MediaRecorder实现视频采集优缺点优点: 使用方便,得到就是编码和封装好的音视频文件,可以直接使用。缺点: 无法获取原始数据,从而无法对原始
阅读全文
摘要:参考 https://www.cnblogs.com/yongdaimi/p/11244950.html使用EGL的绘图的一般步骤、获取 EGL Display 对象:eglGetDisplay()、初始化与 EGLDisplay 之间的连接:eglInitialize()、获取 EGLConfig
阅读全文
摘要:编译时的注意事项想要播放https 配置时需要附带 --enable openssl avformat_open_input返回-1330794744 --enable-opengl 启用OpenGL渲染【默认-否】 --enable-openssl 启用openssl,如果不使用gnutls、li
阅读全文
摘要:1.Build command failed. Error while executing process E:\Develop\Android\sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C E:\Project\Android\test\Pla
阅读全文
摘要:word内标记 建议用txt 写完复制进去,不要直接在word内写 使用的docx格式对应 XWPFDocument XWPFDocument--文档 XWPFParagraph-段落 XWPFRun-文本对象(不同样式:加粗、颜色、等)每种格式一个XWPFRun XWPFTable-表格 XWPF
阅读全文
摘要:1.gradle 7.0使用 2.每个使用的module下 plugins { id 'com.android.application' id 'dagger.hilt.android.plugin' } dependencies { //项目单独引用 implementation (libs.da
阅读全文
摘要:1.方式--设置统一的ItemDecoration(如果左右边框和中间不对等,可以在xml设置RecyclerView的margin或者padding) recyclerView.addItemDecoration(new ItemOffsetDecoration(10,5,10,5)) impor
阅读全文
摘要:1.a.a.c.d: End of input at line 1 column 1 path $ Caused by: java.io.EOFException: End of input at line 1 column 1 path $ 并且返回体 body的内容为空 清理用户缓存数据或者重新
阅读全文
摘要:
使用AppBarLayout+CollapsingToolbarLayout+Toolbar+nestedScrollView+RadioGroup 制作商品详情页
阅读全文

摘要:官方文档地址 其他配置 1.创建一个config.gradle Project gradle引用 2.module gradle配置 debug下的 作为lib时的 解决错误:InstantRun support error, com.android.tools.fd.runtime.Paths 以
阅读全文
摘要:动画素材地址:https://www.lottiefiles.com/ 编译的时候一直报:Manifest merger failed with multiple errors, see logs 后来发现2.5版本的minSdkVersion 是16。自己的是14 lottie-android l
阅读全文
摘要:不需要监听滑动位置,只需要重写ScrollView的onOverScrolled和stopNestedScroll方法就可以了 使用
阅读全文
摘要:可使用github做maven仓库
阅读全文
摘要:1.下载ndk(会下载到sdk目录下) 2.配置 3.配置build.gradle(app) android { defaultConfig { ndk { moduleName "JniDemo" //生成so名称 abiFilters "armeabi","armeabi-v7a","x86"
阅读全文
摘要:FragmentPagerAdapter加载fragment并使用setUserVisibleHint()处理预加载时,给textview赋值时出现的空指针异常 出现了这个错误 测试发现具体问题是:只有加载的第一个Fragment会出现这种状况,后边则可以正常显示 最后打印了生命周期才发现是这样的,
阅读全文
摘要:
自定义android toolbar,使用menu文件和xml布局扩展toolbar菜单选项
阅读全文

摘要:
使用SwiperRefreshLayout,AppBarLayout,ToolBar,CollapsingToolbarLayout,CoordinatorLayout
阅读全文
