2012-11-23 4 views
0

fson 쿼리를 사용하여 json 응답을 얻고 있습니다.이 fql 실행 프로세스에 익숙하지 않습니다. 자세한 내용은이 쿼리를 실행하는 방법을 알 수 있습니다. 응답을 가져 오는 동안 리스너 클래스 스트림에서,facebook에서 json 응답을 얻는 방법

SELECT likes.user_likes을 사용하고 WHERE post_id를 = 'XXXXXXXXXXXXX_XXXXXXXXX'

나는 이것을 실행하고 응답을 얻기 위해 아무것도해야합니까? 사전

답변

0
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 메소드에서 수행해야합니다.

관련 문제