Android如何使用FQL获取专辑封面

时间:2012-01-06 10:59:07

标签: android json api

我正在尝试使用封面照片获取相册列表,以便在我的应用中显示。这是我的所作所为:

    Bundle params1 = new Bundle();

    JSONObject jsonFQL = new JSONObject();
    jsonFQL.put("query1", "SELECT aid, name, cover_pid FROM album WHERE owner=" + myId);
    jsonFQL.put("query2", "SELECT src_small from photo WHERE pid IN (SELECT cover_pid FROM #query1)");


    params1.putString("method", "fql.query");
    params1.putString("query", jsonFQL.toString());

    Utility.mAsyncRunner.request(null, params1,
            new AlbumsRequestListener());

但我的要求是:

{"error_code":601,"error_msg":"Parser error: unexpected '{' at position 0.","request_args":[{"key":"access_token","value":"xxxxxxxxxxxxxxxxx"},{"key":"query","value":"{\"query1\":\"SELECT aid, name, cover_pid FROM album WHERE owner=100000000000000001\",\"query2\":\"SELECT src_small from photo WHERE pid IN (SELECT cover_pid FROM #query1)\"}"},{"key":"method","value":"fql.query"},{"key":"format","value":"json"}]}

我做错了什么?谢谢!

1 个答案:

答案 0 :(得分:0)

固定ID,pid =''

中需要引号