-2

I am confused how to implement JSON parsed code into my Android Studio. I have a Facebook page and I have generated the permanent access token from Graph API, now

I don't know how to connect it to Android Studio project where i want to show news feeds from that Facebook page into my app. Just need code that will implement it in studio Java file.

I cannot show app Id and token for security purpose.

Any solution to this question is appreciated.

Thank you.

Joseph Earl
  • 23,351
  • 11
  • 76
  • 89

2 Answers2

0

maybe this is what you are looking for: JSON Parsing in Android

Otherwise - If you simply want json parsing:

Android Json Parsing

check this out too

Community
  • 1
  • 1
Bostrot
  • 5,767
  • 3
  • 37
  • 47
  • thanks @Bostrot .i parsed the data as news feeds from facebook in my app but i don't know how to show each news/post seperately that page is making .At the moment i m getting all feeds and time in a paragraph and if possible then would like to add card view to the feeds. – Yash Rustagi Feb 24 '17 at 21:40
  • @YashRustagi I don't want to just make references, but i think this is what you want: [Json Parsing to ListView](http://stackoverflow.com/questions/38332540/json-parsing-to-listview-android) (if you are using a listview) – Bostrot Feb 25 '17 at 18:47
0

i found out a solution by which i generated Facebook feeds text to show in my app.

first of all you should know about Retrofit through which i fetched Jason data and accessed graph API.

HERE IS THE LINK : https://www.learn2crack.com/2016/02/recyclerview-json-parsing.html

this is how u can pass your API

public class ApiClient {

static OkHttpClient.Builder httpClient;
private static Retrofit retrofitDefault = null;
public static final String ACCESS_TOKEN ="EAAas6ruKIiEBAE9H1E2sIKr206OssCQ9EyzxpkccHbuJj7ZCdLTA1EJpZBqzyx3tylwb7q9VQz0f4G1i1u2mYlJ7K5FBZBm0MlVzk28JT2cVpPMPgNfKKg11uTZA2m0IW211Wj9Mhbjtdg3EsIKiGIHppTw1pkcZD";
public static final String PAGE_ID ="678319485673629";
public static Retrofit getClient() {
    httpClient = new OkHttpClient.Builder();
    if (retrofitDefault == null) {
        retrofitDefault = new Retrofit.Builder()
                .baseUrl("https://graph.facebook.com/")
                .addConverterFactory(JSONConverterFactory.create())
                .client(
                        httpClient.build()
                ).build();
    }
    return retrofitDefault;
}

}