Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Dagger2AndBuildVariants
Search
funnelbit
February 24, 2016
Technology
490
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dagger2AndBuildVariants
funnelbit
February 24, 2016
More Decks by funnelbit
See All by funnelbit
Hatena Engineer Seminar #9
funnelbit
5
7.5k
droidkaigi-2017-renovation
funnelbit
10
11k
Dart
funnelbit
0
310
BottomBarAndSnackBar
funnelbit
0
560
Dagger2 Optional bindings
funnelbit
0
620
WearableRecyclerView
funnelbit
1
860
QucikSettingsTileAPI
funnelbit
0
390
Mobile Vision
funnelbit
0
500
AwarenessAPI
funnelbit
0
170
Other Decks in Technology
See All in Technology
re:Inventで、人生は変わったのか? / growth-builders-hub-1-reinvent-2026
mhrtech
2
190
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
8
5.1k
Adversary Infrastructure Hunting101
disconinja
0
190
kintoneで在庫管理システムを作るときの要件定義・設計ポイント
kai0707
0
200
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
140
AIエージェント時代、Kaggleにどう取り組むか
takanao
2
470
AIコーディングエージェント開発_全体像
happysamurai294
0
150
Lint の層を組み直した話
bengo4com
2
290
新卒エンジニア、 介護士になる
ryu1013
1
670
WireGuard for Apache NuttX - Bringing Secure Remote Access to embedded Devices -
aki310ooooo
0
120
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
120
Agent Loopを組み込んだ アンビエントなAI機能を実現する / Ambient AI fetures with Agent Loop
nekorush14
0
130
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
550
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Odyssey Design
rkendrick25
PRO
2
910
Utilizing Notion as your number one productivity tool
mfonobong
4
630
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
340
Done Done
chrislema
187
17k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Six Lessons from altMBA
skipperchong
29
4.6k
Paper Plane
katiecoart
PRO
5
54k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
We Have a Design System, Now What?
morganepeng
55
8.4k
Transcript
%BHHFS ͱ #VJME7BSJBOUT ଜɹྋ
ࣗݾհ w ଜɹྋ w ͯͳJEGVOOFMCJU w 5XJUUFSJEFYQFSPQFSP
None
ͯͳϒοΫϚʔΫ
%BHHFS #VJME7BSJBOUT
%BHHFS w IUUQHPPHMFHJUIVCJPEBHHFS w %*ίϯςφ w "15ͬͯίϯύΠϧ࣌ʹґଘղܾ
#VJME7BSJBOUT w #VJME5ZQFT 1SPEVDU'MBWPST
HSBEF productFlavors { typea { applicationId "com.funnelbit.testablediconceptapplication.typea" } typeb {
applicationId "com.funnelbit.testablediconceptapplication.typeb" } }
TSDNBJOKBWB TSDUZQFBKBWB TSDUZQFCKBWB
TSDNBJOKBWB
"QQ$PNQPOFOU#BTF public interface AppComponentBase { // App void inject(App app);
// Activity void inject(MainActivity mainActivity); }
"QJ$MJFOU public interface ApiClient { void request(String query, Callback callback);
class Response { public final String body; public Response(String body) { this.body = body; } } interface Callback { void onSuccess(Response response); void onFail(Exception e); } }
&OUSZ.BOBHFS public class EntryManager { final ApiClient mApiClient; @Inject EntryManager(ApiClient
apiClient) { mApiClient = apiClient; } public void create() { mApiClient.request("create query", new ApiClient.Callback() { … }); } public void delete() { mApiClient.request("delete query", new ApiClient.Callback() { … }); } }
.BJO"DUJWJUZ public class MainActivity extends AppCompatActivity { @Inject EntryManager mEntryManager;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((App) getApplication()).getAppComponent().inject(this); setContentView(R.layout.activity_main); mEntryManager.create(); mEntryManager.delete(); } }
TSDUZQFBKBWB
"QQ$PNQPOFOU @Component(modules = AppModule.class) public interface AppComponent extends AppComponentBase {
}
"QQ.PEVMF @Module public class AppModule { @Provides public ApiClient provideApiClient()
{ return new AppClientImpl(); } }
"QQ public class App extends Application { private AppComponent mAppComponent;
@Override public void onCreate() { super.onCreate(); mAppComponent = DaggerAppComponent.builder() .appModule(new AppModule()) .build(); } public AppComponent getAppComponent() { return mAppComponent; } }
"QQ$MJFOU*NQM public class AppClientImpl implements ApiClient { @Override public void
request(String query, Callback callback) { callback.onSuccess(new Response("production response")); } }
TSDUZQFCKBWB
"QQ$PNQPOFOU @Component(modules = {StubAppModule.class, DebugModule.class}) public interface AppComponent extends AppComponentBase
{ }
4UVC"QQ.PEVMF @Module public class StubAppModule { @Provides public ApiClient provideApiClient()
{ return new StubApiClient(); } }
"QQ public class App extends Application { private AppComponent mAppComponent;
@Inject LogUtil mLogUtil; @Override public void onCreate() { super.onCreate(); mAppComponent = DaggerAppComponent.builder() .stubAppModule(new StubAppModule()) .debugModule(new DebugModule()) .build(); mAppComponent.inject(this); mLogUtil.debugLog("͜Μʹͪ"); } public AppComponent getAppComponent() { return mAppComponent; } }
ߏ·ͱΊ w ڞ௨ͯ͠͏ͷNBJOʹ͔͘ w ৼΔ͍Λม͍͑ͨ߹*OKFDU w "QQNBJOʹஔ͔ͳ͍ w $PNQPOFOUNBJOͷ֎ w
.PEVMFNBJOҎ֎ͷ֎
·ͱΊ w ͕͍ͨ͠Ͱ͢ w ͲΜͳײ͡Ͱಋೖ͍ͯ͠Δ͔ w ςετͷ࣌Ͳ͏ͯ͠Δ͔
͋Γ͕ͱ͏͍͟͝·ͨ͠