我正在制作和Android应用程序中,我从API获取JSON数据,但我不知道如何获取JSON数据,我们传递序列化的getter和setter类。 这里是我的JSON数据{"status":true,"message":"Notifications fetched.","data":[{"id":"69","type":"liked","text":"Sandip Ghosh liked your photo.","for_userid":"56","from_userid":"55","for_image":"54","seen":"0","username":"sandip","firstname":"Sandip","lastname":"Ghosh","imgname":""},{"id":"64","type":"liked","text":"Sandip Ghosh liked your photo.","for_userid":"56","from_userid":"55","for_image":"54","seen":"0","username":"sandip","firstname":"Sandip","lastname":"Ghosh","imgname":""},{"id":"63","type":"liked","text":"Sandip Ghosh liked your photo.","for_userid":"56","from_userid":"55","for_image":"54","seen":"0","username":"sandip","firstname":"Sandip","lastname":"Ghosh","imgname":""},{"id":"62","type":"commented","text":"Sandip Ghosh commented onyour photo.","for_userid":"56","from_userid":"55","for_image":"54","seen":"0","username":"sandip","firstname":"Sandip","lastname":"Ghosh","imgname":""},{"id":"61","type":"liked","text":"Sandip Ghosh liked your photo.","for_userid":"56","from_userid":"55","for_image":"53","seen":"0","username":"sandip","firstname":"Sandip","lastname":"Ghosh","imgname":""},{"id":"27","type":"Follow","text":"Sandip Ghosh started following you","for_userid":"56","from_userid":"55","for_image":"0","seen":"1","username":"sandip","firstname":"Sandip","lastname":"Ghosh","imgname":""}]}
如何获取json in retrofit2
0
A
回答
0
把你的整个JSON来http://pojo.sodhanalibrary.com/ 这将创建模型本身为您服务。 它会毫不费力地创建Serializable模型。 然后使用这些模型来获取值。 欲了解更多关于以下教程: https://github.com/codepath/android_guides/wiki/Consuming-APIs-with-Retrofit
相关问题
- 1. 从json获取ID recycleview retrofit2
- 2. Retrofit2 HTTP获取Json到RecyclerView
- 3. Null Object In Retrofit2
- 4. 如何发布JSON,但使用Retrofit2获取XML响应?
- 5. 畸形的JSON Retrofit2
- 6. Retrofit2如何获得重定向URL @HEAD( “/”)
- 7. Retrofit2后身体为JSON
- 8. Retrofit2 - JSON数组解析
- 9. Retrofit2后JSON与字段名
- 10. 如何从URL获取JSON
- 11. 如何retrofit2的Android
- 12. 如何从System.Windows.Browser.ScriptObject获取JSON
- 13. 如何从JSON获取DateTime
- 14. 如何从json获取值
- 15. 如何获取JSON数据
- 16. 如何获取json变量?
- 17. 如何获取Json在android
- 18. 如何使用RxJava2等Retrofit2
- 19. 如何在retrofit2 android中传递POST参数类型json,?
- 20. Array in Array in JSON
- 21. Retrofit2 SSLHandshakeException
- 22. 使用Cookie获取JSON Android
- 23. 如何使用Retrofit2解析JSON成类的子类(ES)
- 24. 如何显示JSON数据列表视图中与Retrofit2
- 25. 如何使用retrofit2发送json对象的文件
- 26. RetroFit2如何使用@Query
- 27. 如何获取JSON格式的多层
- 28. 如何获取JSON值给变量?
- 29. 如何从Json对象获取数据?
- 30. 是否可以解析JSON没有Retrofit2
小心发布您的代码? – Coder