-
-
Notifications
You must be signed in to change notification settings - Fork 41
ParseStethoInterceptor
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.
Check the website and getting started about how to setup Parse.
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
}
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);
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