Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

ParseStethoInterceptor

Jaime Agudo edited this page Mar 28, 2017 · 7 revisions

Stetho is an open source library which allows you to debug your app through Chrome Developer tool. With the help of ParseStethoInterceptor, it is supper easy to integrate Parse with Stetho. You can follow this tutorial to add ParseStethoInterceptor and Stetho to your app.

Configure Parse SDK in your app

Check the website and getting started about how to setup Parse.

Add ParseInterceptors dependency to your app

In your app's build.gradle, add dependency from maven.

dependencies {
    compile 'com.parse:parse-android:1.14.1'
    debugCompile 'com.facebook.stetho:stetho:1.4.2'
    debugCompile 'com.parse:parseinterceptors:0.0.2'
    // If you are using okhttp in your app, make sure you use 2.5.0 or above
    // compile com.squareup.okhttp:okhttp:2.5.0
}

Initialize Stetho and add ParseStethoInterceptor to Parse

In you app's Application#oncreate(), first initialze Stetho, then initialize a ParseStethoInterceptor instance and add it to Parse. Make sure you add ParseStethoInterceptor before you initialize Parse.

// The stetho initialization may change if you use different Stetho version
Stetho.initializeWithDefaults(this);

Parse.addNetworkInterceptor(new ParseStethoInterceptor());
// Interceptor should be added before your initialize Parse
Parse.initialize(this);

Check results through Chrome debug tool

After Parse SDK sends http requests to Parse server, you can check the http requests and responses information in Chrome debug tool. In your Chrome browser, browse to

chrome://inspect

Click the inspect button under your app, you will see