Json在[关闭]下解析给定的响应

问题描述 投票:-4回答:2

嗨,我想解析下面的json响应

{
    "appstore_information": {
        "time_fence": {
            "auto_expire_app_restriction": {
                "enable_auto_expiry": true,
                "expiry_date": "10\/15\/2012 12:00:00 AM",
                "time_bound_access_restriction": {
                    "duration_in_hrs": 18,
                    "start_time": "10\/17\/2012 12:00:00 AM",
                    "time_zone": "(UTC+02:00) Cairo"
                }
            },
            "local_data_time_fence": {
                "enable_local_data_time_fence": true,
                "expire_time_limit": {
                    "days": 2,
                    "hours": 17,
                    "minutes": 16
                }
            }
        },
        "use_offline_access": true
    },
    "display_message": "Profile is available in information.",
    "message_status": "Success."
}

任何帮助都感激不尽

java android json parsing
2个回答
0
投票

你可以在Android上使用GSON,你可以创建POJOs镜像你的json数据结构,然后调用:

AppStoreInformation asi = new Gson().fromJson(jsonString, AppStoreInformation.class);

这篇文章可能有所帮助:Android Series: Parsing JSON data with GSON


2
投票

http://json.org/,这里是解析器库的列表:

ASP:
    JSON for ASP.
    JSON ASP utility class.
ActionScript:
    ActionScript3.
    JSONConnector.
Ada:
    GNATCOLL.JSON.
Bash:
    Jshon.
    JSON.sh.
BlitzMax:
    bmx-rjson.
C:
    JSON_checker.
    YAJL.
    js0n.
    LibU.
    json-c.
    json-parser.
    jsonsl.
    WJElement.
    M's JSON parser.
    cJSON.
    Jansson.
    jsmn.
    cson.
C++:
    JSONKit.
    jsonme--.
    ThorsSerializer.
    JsonBox.
    jsoncpp.
    zoolib.
    JOST.
    CAJUN.
    libjson.
    nosjob.
    rapidjson.
C#:
    fastJSON.
    JSON_checker.
    Jayrock.
    Json.NET - LINQ to JSON.
    LitJSON.
    JSON for .NET.
    JsonFx.
    JSON@CodeTitans
    How do I write my own parser?
    JSONSharp.
    JsonExSerializer.
    fluent-json
    Manatee Json
Clojure:
    clojure-json.
    API for json.
Cobol:
    XML Thunder.
ColdFusion:
    ColdFusion 8.
    toJSON.
D:
    Cashew.
    Libdjson.
Dart:
    json library.
Delphi:
    Delphi Web Utils.
    JSON Delphi Library.
    JSON Toolkit.
    tiny-json.

E:
    JSON in TermL.
Erlang:
    ejson.
    mochijson2.
Fantom:
    Json.
Go:
    package json.
Haskell:
    RJson package.
    json package.
Haxe:
    hxJSON.
Java:
    org.json.
    org.json.me.
    Jackson JSON Processor.
    Json-lib.
    JSON Tools.
    Stringtree.
    SOJO.
    Jettison.
    json-taglib.
    XStream.
    Flexjson.
    JON tools.
    Argo.
    jsonij.
    fastjson.
    mjson.
    jjson.
    json-simple.
    json-io.
    JsonMarshaller.
    google-gson.
    Json-smart.
    FOSS Nova JSON.
JavaScript:
    JSON.
    json2.js.
    json_sans_eval.
    clarinet.
Lisp:
    Common Lisp JSON.
    Yason.
    Emacs Lisp.
LotusScript:
    JSON LS.
Lua:
    Json4Lua.
    LuaJSON.
    LuaJSON C Library.
    Lua CJSON.
    dkjson.
Matlab:
    JSONlab.
    JSON Parser.
    (another) JSON Parser.
Objective C:
    json-framework.
    MTJSON.
    JSONKit.
    yajl-objc.
    TouchJSON.
OCaml:
    Yojson.
    jsonm.
OpenLaszlo:
    JSON.

Perl:
    CPAN.
    perl-JSON-SL.
PHP:
    PHP 5.2.
    json.
    Services_JSON.
    Zend_JSON.
    Solar_Json.
    Comparison of php json libraries.
Pike:
    Public.Parser.JSON.
    Public.Parser.JSON2.
PL/SQL:
    pljson:
    Librairie-JSON.
PowerShell:
    PowerShell.
Prolog:
    SWI-Prolog HTTP support
    Ciao JSON encoder and decoder
Puredata:
    PuRestJson
Python:
    The Python Standard Library.
    simplejson.
    pyson.
    Yajl-Py.
    ultrajson.
Qt:
    QJson.
R:
    rjson.
Racket:
    json-parsing.
Rebol:
    json.r.
RPG:
    JSON Utilities.
Ruby:
    json.
    yajl-ruby.
    json-stream.
Scala:
    package json.
Scheme:
    MZScheme.
    PLT Scheme.
Squeak:
    Squeak.
Symbian:
    s60-json-library.
Tcl:
    JSON.
Visual Basic:
    VB-JSON.
    PW.JSON.
Visual FoxPro:
    fwJSON.
    JSON.
    vfpjson.
© www.soinside.com 2019 - 2024. All rights reserved.