LoginSignup
4
4

More than 5 years have passed since last update.

twitter4j-http2-supportでStethoを導入しやすくしてみた。

Last updated at Posted at 2015-04-22

参考 http://qiita.com/takke/items/96b7a45f0476d546b5b1
参考 http://qiita.com/wasabeef_jp/items/1e7bdb78766708206d3d

このへん見て自分もやりたくなってカッとなってやった。

リポジトリ
https://bitbucket.org/mumei_himazin/twitter4j-http2-stetho

導入

repositories {
    mavenCentral()
    maven{
        url 'http://repository.mumei-himazin.info/nexus/content/repositories/releases/'
    }
}
dependencies {
    compile 'org.twitter4j:twitter4j-core:4.0.3'
    compile 'org.twitter4j:twitter4j-http2-support:4.0.3'
    compile 'info.mumei-himazin:t4j-h2-stetho:2.0'
}

使い方

Twitter twitter = new TwitterFactory(configuration).getInstance();
twitter4j.stetho.Twitter4jStetho.initialize(twitter);

後は参考のところと同じようにApplicationで

public class Application extends android.app.Application{
    @Override
    public void onCreate() {
        super.onCreate();
        com.facebook.stetho.Stetho.initialize(
            com.facebook.stetho.Stetho.newInitializerBuilder(this)
                .enableDumpapp(com.facebook.stetho.Stetho.defaultDumperPluginsProvider(this))
                .enableWebKitInspector(com.facebook.stetho.Stetho.defaultInspectorModulesProvider(this))
                .build()
        );
    }
}

Gradleに書いて
Applicationでテンプレ書いて
twitter4j.twitterをTwitter4jStetho.initialize(twitter)にぶち込むだけです。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4