Q:

Android Fql query Exception

I am new in Facebook SDK.  I want to get PostID and Message from facebook.  This is my android code. 
private void Fql() {
    String fqlQuery = "SELECT post_id, message FROM stream WHERE source_id='100008169074385' ";
    Bundle params = new Bundle();
    params.putString("q", fqlQuery);
    Session session = Session.getActiveSession();
    Request request = new Request(session, "/fql", params, HttpMethod. GET,
            new Request. Callback() {
                public void onCompleted(Response response) {
                     MessageBox(response.toString());
                }
            });
    Request.executeBatchAsync(request);
}

but is Code gives me an exception:"an access token is required to request this resource". 
Please anyone give me some solution

A:

This might help you. 
private void Fql() {

        String fql = "SELECT link_id, title, summary, url from link WHERE  owner = 'YourID'";

        Bundle parameters = new Bundle();

        parameters.putString("query", fql);
        parameters.putString("method", "fql.query");

        Session session = Session.getActiveSession();
        parameters.putString("access_token",  session.getAccessToken());

        String response = null;
        try {
            response = fb.request(parameters);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 

        MessageBox(response);

    }

