詳解Android平臺JSON預覽(JSON-handle)
開發(fā)中需要用到json,在瀏覽器顯示的json非常亂,難以理解。有沒有讓人一目了然的工具,讓json看起來非常直觀呢,json-handle隨之而出,包含火狐和chrome兩種插件,官方地址:http://jsonhandle.sinaapp.com/
Chrome常用的插件 JSON-handle ,用過的都知道。
對于經(jīng)常在瀏覽器調(diào)試json的你,json-handle是個不二的選擇.最近在做接口加密,所有的數(shù)據(jù)( request
和 response
)都是加密數(shù)據(jù),無法溝通 fildder
或者 Charles
抓包查看。那么自己做一個查看 json`
格式的View`:支持動態(tài)的放大,縮小,支持所有數(shù)據(jù)格式~!
效果圖:
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使用WebView實現(xiàn)截圖分享功能
這篇文章主要為大家詳細介紹了Android使用WebView實現(xiàn)截圖分享功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-05-05Android AlertDialog實現(xiàn)分享對話框/退出對話框/下載對話框
這篇文章主要介紹了Android AlertDialog實現(xiàn)分享對話框/退出對話框/下載對話框的相關資料,需要的朋友可以參考下2016-04-04Android中TextView實現(xiàn)部分文字可點擊跳轉(zhuǎn)
這篇文章主要為大家詳細介紹了Android中TextView實現(xiàn)部分文字可點擊跳轉(zhuǎn)的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-10-10詳解Android獲取系統(tǒng)內(nèi)核版本的方法與實現(xiàn)代碼
這篇文章主要介紹了詳解Android獲取系統(tǒng)內(nèi)核版本的方法與實現(xiàn)代碼的相關資料,這里提供了具體實現(xiàn)獲取內(nèi)核的方法,需要的朋友可以參考下2017-07-07淺談Android studio 生成apk文件時的 key store path 的問題
這篇文章主要介紹了淺談Android studio 生成apk文件時的 key store path 的問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-03-03Android scheme 跳轉(zhuǎn)的設計與實現(xiàn)詳解
這篇文章主要介紹了Android scheme 跳轉(zhuǎn)的設計與實現(xiàn),本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-06-06