VK news tape



  • Problem with getting news from Connect through VK SDK Android. Since there are no standard classes in SDK, I'm forming a GET request for API:

    "https://api.vk.com/method/newsfeed.get?user_id="+id+"&filters=post&count=1&v=5.42&access_token="+ MyVK.getInstance().getAccessToken()
    

    Where:
    iduser_id;
    MyVK.getInstance().getAccessToken() - Token received.

    I kind of take it, I cut the answer to clean it up. {"response": and } at the end.
    And I'd like to put everything in. JSONArray♪ I' news. items, profile list profilesList of groups groups etc.
    I used to put everything in a separate place. HashTable

    How do you keep it to have access to every single news?

    Data that return VK:

    {"response":{"items":[{"type":"","source_id":,"date":,"post_id":,"post_type":""‌​,"text":"","attachments":[{"type":"","photo":{"id":,"album_id":,"owner_id":,"user‌​_id":,"photo_75":"",width":,"height":,"text":"","date":,"post_id":,"access_key":"‌​"}}],"post_source":{"type":"api"},"comments":{"count":0,"can_post":0},"likes":{"c‌​ount":67,"user_likes":0,"can_like":1,"can_publish":1},"reposts":{"count":7,"user_‌​reposted":0}}],"profiles":[],"groups":[{"id":,"name":"","screen_name":"","is_clos‌​ed":,"type":"","photo_50":""}
    


  • Try to find a convenient tool. For example, in order to receive requests and analyse answers, use https://square.github.io/retrofit/ for storage - https://github.com/pushtorefresh/storio or https://realm.io/news/realm-for-android/ ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2