nontravis / debugging-project-example

Debugging example project. We use stetho and timber library to find any bug that may occur to write coding faster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cover

(th) read blog

(en) read blog

Setup

compile 'com.jakewharton.timber:timber:4.5.1'
compile 'com.facebook.stetho:stetho:1.5.0'
// Depend on your network
compile 'com.facebook.stetho:stetho-okhttp3:1.5.0'
// or
compile 'com.facebook.stetho:stetho-okhttp:1.5.0'
// or
compile 'com.facebook.stetho:stetho-urlconnection:1.5.0'
// for use javascript console
compile 'com.facebook.stetho:stetho-js-rhino:1.5.0'
[MainApplication.class]
public class MainApplication extends BaseApplication{

    @Override
    public void onCreate(){
        super.onCreate();
        Timber.plant( new DebugTree() );

        Stetho.initialize(
                Stetho.newInitializerBuilder( this )
                        .enableWebKitInspector(
                                () -> new Stetho.DefaultInspectorModulesBuilder( MainApplication.this )
                                        .runtimeRepl(
                                                new JsRuntimeReplFactoryBuilder( MainApplication.this )
                                                        .addVariable( "foo", "Assign to foo variable" )
                                                        .build()
                                        ).finish() )
                        .enableDumpapp(
                                () -> new Stetho.DefaultDumperPluginsBuilder( MainApplication.this )
                                        .provide( new HelloWorldDumperPlugin() )
                                        .finish() )
                        .build()
        );
    }
}

1. UI Debugging

2. Network Debugging

3. Resource Debugging

4. Javascript Console

5. dumpapp

Webview debugging

Developed By Thai android developer.

alt text

Follow facebook.com/thekhaeng.io on Facebook page. or @nonthawit at my Medium blog. :)

For contact, shoot me an email at nonthawit.thekhaeng@gmail.com

About

Debugging example project. We use stetho and timber library to find any bug that may occur to write coding faster.


Languages

Language:Java 81.3%Language:Python 17.0%Language:Shell 1.7%