这篇文章主要介绍了Android平台JSON预览(JSON-handle),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
开发中需要用到json,在浏览器显示的json非常乱,难以理解。有没有让人一目了然的工具,让json看起来非常直观呢,json-handle随之而出,包含火狐和chrome两种插件,官方地址:http://jsonhandle.sinaapp.com/
Chrome常用的插件 JSON-handle ,用过的都知道。
对于经常在浏览器调试json的你,json-handle是个不二的选择.最近在做接口加密,所有的数据( request
和 response
)都是加密数据,无法沟通 fildder
或者 Charles
抓包查看。那么自己做一个查看 json`
格式的View`:支持动态的放大,缩小,支持所有数据格式~!
效果图:
GitHub地址: JsonHandleView
依赖
implementation 'com.tzx.json:jsonhandleview:1.0.0'
使用
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical">
<com.dandan.jsonhandleview.library.JsonViewLayout
android:id="@+id/jsonView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
JsonViewLayout jsonViewLayout = findViewById(R.id.jsonView);
jsonViewLayout.bindJson("your json strings." || JSONObject || JSONArray);
自定义风格
// Color
jsonViewLayout.setKeyColor()
jsonViewLayout.setObjectKeyColor()
jsonViewLayout.setValueTextColor()
jsonViewLayout.setValueNumberColor()
jsonViewLayout.setValueNullColor()
jsonViewLayout.setValueBooleanColor()
jsonViewLayout.setArrayLengthColor()
// TextSize
jsonViewLayout.setTextSize()
文章到这里就全部讲述完啦,若有其他需要交流的可以留言哦~!~!希望对大家的学习有所帮助,也希望大家多多支持编程学习网。
本文标题为:详解Android平台JSON预览(JSON-handle)


基础教程推荐
- IOS获取系统相册中照片的示例代码 2023-01-03
- MVVMLight项目Model View结构及全局视图模型注入器 2023-05-07
- Android Compose自定义TextField实现自定义的输入框 2023-05-13
- iOS Crash常规跟踪方法及Bugly集成运用详细介绍 2023-01-18
- iOS中如何判断当前网络环境是2G/3G/4G/5G/WiFi 2023-06-18
- Android实现短信验证码输入框 2023-04-29
- iOS开发使用XML解析网络数据 2022-11-12
- Flutter进阶之实现动画效果(三) 2022-10-28
- iOS开发 全机型适配解决方法 2023-01-14
- Android开发Compose集成高德地图实例 2023-06-15