private void doFQLQuery()
{
//get the active facebook session
Session session = Session.getActiveSession();
//create the fql query
String fqlQuery = "SELECT likes.user_likes FROM stream WHERE post_id ='XXXXXXXXXXXXX_XXXXXXXXX'";
//create a bundle for the parameters(your query)
Bundle params = new Bundle();
params.putString("q", fqlQuery);
//setup the request
Request request = new Request(session, "/fql", params, HttpMethod.GET, new Request.Callback()
{
public void onCompleted(Response response)
{
//when the request is completed output the results to the log
Log.i(TAG, "Result: " + response.toString());
}
});
//execute the request
Request.executeBatchAsync(request);
}
에서
덕분에 당신은 FQL 쿼리를 실행하고 응답을 얻기 위해이 코드를 사용할 수 있습니다. 결과에 대해 수행하려는 모든 처리는 onCompleted 메소드에서 수행해야합니다.