Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First try to validate the response. I would use:</p> <pre><code>JSONObject json = new JSONObject(response); </code></pre> <p>It gives you an opportunity to check the content of the json object using it's methods. You can't assume, that facebook api will always respond expected form of data. You can do:</p> <pre><code>Log.w("FacebookListener", "Unexpected response: " + response); </code></pre> <p>And then inspect Logcat output.</p> <p>OK. I haven't tested it yet, but according to: <a href="http://developers.facebook.com/docs/reference/rest/fql.query/" rel="nofollow">http://developers.facebook.com/docs/reference/rest/fql.query/</a> the graph path for fql queries is "fql"</p> <p>In <code>mAsyncFacebookRunner.request(null, params, new FQLRequestListener());</code> you pass null, but "fql" is probably expected</p> <p><strong>EDIT</strong> I have checked it on graphapi explorer - it works, when "query" is replaced by simple "q". Make sure, you are authenticated within your app (Single sign on, or OAuth dialog)</p> <pre><code>Bundle params = new Bundle(); params.putString("q", query); mAsyncFacebookRunner.request("fql", params, new FQLRequestListener()); </code></pre> <p><strong>Another EDIT:</strong> While working on different project, I have noticed, that there may be a problem with Facebook Util class's method "read" - sometimes (even if InputStream had data) BufferedReader returned null, and broke loop. I have changed body of the method into:</p> <pre><code> private static String read(InputStream in) throws IOException { StringBuffer sb = new StringBuffer(); final InputStreamReader rd = new InputStreamReader(in); try { final char[] buffer = new char[1024]; int read; while((read = rd.read(buffer)) != -1){ sb.append(buffer, 0, read); } } catch (Exception e) { } finally { try { rd.close(); } catch (Exception e2) { } } return sb.toString(); } </code></pre> <p>and it worked.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload