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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
160
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
370
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
140
ゲームのリアルタイム通信から見た QUIC と MoQ
segadevtech
0
120
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1k
Getting Started with Google Antigravity
glaforge
0
250
夫婦で子育てするための育児標準化
codmoninc
PRO
0
210
Essential architectural thinking (revised edition)
ufried
0
120
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
120
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.3k
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
110
Featured
See All Featured
From π to Pie charts
rasagy
1
400
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
My Coaching Mixtape
mlcsv
0
350
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Rails Girls Zürich Keynote
gr2m
96
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Pragmatic Product Professional
lauravandoore
37
7.5k
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 ςετͷ࣌Ͳ͏ͯ͠Δ͔
͋Γ͕ͱ͏͍͟͝·ͨ͠