【问题标题】:Get data using json api wordpress使用 json api wordpress 获取数据
【发布时间】:2014-11-03 16:32:25
【问题描述】:

如果你想创建原生移动安卓应用程序,我认为使用 JSON Parse 比 RSS Reader 更实用。在后端安装 Wordpress 和 Plugin JSON API,然后使用 Asynctask vs Volley Library 来前端 Android。向 ListView 显示数据 - OnItemClickListener 以获取项目的更多详细信息。但不幸的是 JSON 文件在 Content Array 中有一些不同的内容,因为内容包括 img 类。

"content":"<p><img class=\"alignnone size-medium wp-image-7\" src=\"http:\/\/localhost\/novemberproject\/wordpress\/wp-content\/uploads\/2014\/11\/1522040_20130503100310-300x233.jpg\" alt=\"1522040_20130503100310\" width=\"300\" height=\"233\" \/><\/p>\n<p>A sports car (sportscar) is a small, usually two seater, two door automobile designed for spirited performance and nimble handling.<\/p>\n"

如果结果放到TextView,会报错:

" Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ ) ". 

任何人有时间解释,如何实施这个案例研究?谢谢。

【问题讨论】:

    标签: android json wordpress rss android-volley


    【解决方案1】:

    您可以将数据添加到空数组。并转换为 json,这个数组。因此,您不必自己编写 JSON。 *与:json_encode

    【讨论】:

    • 转换为 json 我在 wordpress 中使用插件 JSON API。问题是图片里面的内容,我是否必须创建一个自定义的php文件?
    猜你喜欢
    • 2021-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-13
    • 1970-01-01
    • 2015-01-31
    • 1970-01-01
    相关资源
    最近更新 更多