title: Get Cover Photo using Facebook API
body: <p>In my Android application, I am trying to get the cover photo of the user from his Facebook account.</p>
  
  <p>I can get the profile picture by using the below code.</p>
  
  <pre><code>profilePicUrl = new URL("http://graph.facebook.com/" + userId + "/picture?type=large");
  
  profilePicBmp = BitmapFactory.decodeStream(profilePicUrl.openConnection().getInputStream());
  </code></pre>
  
  <p>The <a href="https://developers.facebook.com/docs/reference/api/user/" rel="noreferrer">documentation</a> specifies the following for retrieving the cover photo.</p>
  
  <blockquote>
    <p>The user's cover photo (must be explicitly requested using
    fields=cover parameter)</p>
    
    <p>Requires access_token </p>
    
    <p>Returns : array of fields id, source, and
    offset_y</p>
  </blockquote>
  
  <p>So, the structure of the JSON response would be something like this.</p>
  
  <pre><code>{
     "cover": {
        "cover_id": "10151008748223553",
        "source": "http://sphotos-a.ak.fbcdn.net/hphotos-ak-ash4/s720x720/391237_10151008748223553_422785532_n.jpg",
        "offset_y": 0
     },
     "id": "19292868552"
  }
  </code></pre>
  
  <p>I am pretty new to Facebook Graph API and hence do not have much knowledge on how to go about this.</p>
  
  <p>I tried this <code>coverPicUrl = new URL("http://graph.facebook.com/" + userId + "/cover?type=large");</code></p>
  
  <p>and also this <code>coverPicUrl = new URL("http://graph.facebook.com/" + userId + "/fields=cover");</code></p>
  
  <p>But I have not been able to get the cover picture of the user profile.</p>
  
  <p>Searching online also did not yield any fruitful results.</p>
  
  <p>Any help would indeed be appreciated.</p>
  
  <p>Thanks!</p>