skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

    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;
    }
    

    }


  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search