
Java,kotlin
文章平均质量分 65
program008
这个作者很懒,什么都没留下…
展开
-
Android Jetpack 之DataStore 学习笔记
DataStoredefinitionOne of the primary benefits of DataStore is the asynchronous API.aimed at replacing SharedPreferences.Data is stored asynchronously, consistently, and transactionally, overcoming most of the drawbacks of SharedPreferences.另外,DataSto.原创 2021-08-19 17:40:29 · 382 阅读 · 0 评论 -
安全广播LocalBroadcastManager
LocalBroadcastManager是安全的广播,只能在同一个应用中发送和接收。废话不多说,直接撸码,我这个人就那么直接。1、注册广播 MyReceiver receiver = new MyReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction(ConstUtils.ACTION_DO_AC原创 2017-06-27 09:35:54 · 351 阅读 · 0 评论 -
整型int和字节数组byte相互转换
Java中整型int和字节数组byte相互转换,在网络编程中这个算法是最基本的算法,我们都知道,在socket传输中,发送、者接收的数据都是 byte数组,但是int类型是4个byte组成的,如何把一个整形int转换成byte数组,同时如何把一个长度为4的byte数组转换为int类型,分别上传Java版本代码和kotlin版本代码(刚学的,试试手,代码运行结果经过校验无误)Java版本原创 2017-06-21 00:25:23 · 4149 阅读 · 0 评论