首页 > 解决方案 > 如何在没有 Pojo 的情况下从 api 添加数据

问题描述

我从无法转换为 pojo 的 api 获取数据,因此无法以正常方式获取数据 我得到的数据

 {"TABLE_DATA":"
{\"data\":[
[\"Tiger Nixon\",\"System 
Architect\",\"Edinburgh\",\"5421\",\"2011/04/25\",\"$320,800\"],
[\"Garrett 
Winters\",\"Accountant\",\"Tokyo\",\"8422\",\"2011/07/25\",\"$170,750\"],
[\"Ashton Cox\",\"Junior Technical 
Author\",\"SanFrancisco\",\"1562\",\"2009/01/12\",\"$86,000\"],
[\"Cedric Kelly\",\"Senior Javascript 
Developer\",\"Edinburgh\",\"6224\",\"2012/03/29\",\"$433,060\"],
[\"Airi 
Satou\",\"Accountant\",\"Tokyo\",\"5407\",\"2008/11/28\",\"$162,700\"],
[\"Brielle Williamson\",\"Integration Specialist\",\"New 
York\",\"4804\",\"2012/12/02\",\"$372,000\"],
[\"Herrod Chandler\",\"Sales Assistant\",\"San 
Francisco\",\"9608\",\"2012/08/06\",\"$137,500\"],
[\"Rhona Davidson\",\"Integration 
Specialist\",\"Tokyo\",\"6200\",\"2010/10/14\",\"$327,900\"],
[\"Colleen Hurst\",\"Javascript Developer\",\"San 
Francisco\",\"2360\",\"2009/09/15\",\"$205,500\"],
[\"Sonya Frost\",\"Software 
Engineer\",\"Edinburgh\",\"1667\",\"2008/12/13\",\"$103,600\"],
[\"Jena Gaines\",\"Office 
Manager\",\"London\",\"3814\",\"2008/12/19\",\"$90,560\"]`

没有可用的 pojo 这是我第一次在 API 中工作,任何指南都会有所帮助。我正在使用 retofit 和 rxjava2 接收以下数据。数据格式为 post 方法。

标签: androidstringlistapiarraylist

解决方案


这是一个 jquery 格式。您可以尝试使用此https://javacodegeeks.com/2013/02/jquery-datatables-and-java-integration.html

也看看这个主题stackoverflow.com/questions/48942253/how-to-implement-jquery-datatable-in-android-any-library

您从中获取数据的服务可能有机会设置数据格式,您必须在 GET 查询中指定它,查看 API 文档。


推荐阅读