- 博客(8)
- 收藏
- 关注
原创 android如何将json数据转化为数组
今天在项目中因为数据比较多,师傅就推荐我用json,于是尝试了一下。首先先要知道获取的json格式是什么样的;new Gson().toJson(shuJiaList);然后再将获取到的格式当作json格式来存储数据,如下图所示; { "content": "我们根据老师的信号,", "nianji": 1, "title": "找朋友" },接着弄一个readLocalJson来读取项目中存放的json数据; public static Str
2021-08-31 21:00:17 1034 1
原创 android 导入模块
首先看导入模块有无别的依赖然后将module复制到项目中在setting.gradle中添加include'module名字'
2021-08-26 21:08:22 235
原创 android创建一个bottomsheet底部滑动
今天做项目使用了一个bottomsheet控件,主要是可以从底部弹出一个页面,话不多说直接上代码1首先就是要导入依赖 implementation 'com.android.support:design:28.0.0'2将view添加behavior//设置view显示高度app:behavior_peekHeight="270dp"//必须要加的app:layout_behavior="@string/bottom_sheet_behavior"3.在activity中获..
2021-08-26 21:04:12 418
原创 android 收藏功能
首先创建数据库存放数据public class LikePeise extends LitePalSupport implements Parcelable { private String title ; private int image; private boolean collect; public LikePeise(String title, int image, boolean collect) { this.title = title;
2021-08-26 09:15:52 2222
原创 Android 如何保存图片
1获取权限 public void applyPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { rxPermissions.request(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE).subscribe(granted -> {
2021-08-26 09:01:00 1179
原创 litepal 数据库使用
1.添加依赖:implementation 'org.litepal.guolindev:core:3.2.3'2.创建litepal.xml:<?xml version="1.0" encoding="utf-8"?><litepal><!-- Define the database name of your application. By default each database name should be end with .db. If yo..
2021-08-26 08:55:15 141
原创 kotlin helloworld
先来熟悉一下kotlin吧,嘻嘻嘻!for main(args:Array<String>){println("hello,world")}
2021-08-19 10:08:42 119
原创 Fragment里面加一个轮播图
首先先在Fragment中加入banner <com.youth.banner.Banner android:id="@+id/banner" android:layout_width="match_parent" android:layout_height="100dp" android:layout_below="@+id/toolbar" />然后在依赖.
2021-07-20 10:48:13 1851 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人