-4

嗨,我想解析下面的 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."
}

任何帮助都感激不尽

4

2 回答 2

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.
于 2012-10-18T06:45:34.997 回答
0

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

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

这里有一篇文章可能会有所帮助:Android 系列:使用 GSON 解析 JSON 数据

于 2012-10-18T06:27:02.013 回答