Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[JA] High-Performance Android: Rebirth of our U...
Search
mercari
PRO
September 30, 2017
2.3k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[JA] High-Performance Android: Rebirth of our US App
mercari
PRO
September 30, 2017
More Decks by mercari
See All by mercari
[DevDojo] Getting Started with BI: Looker Essentials - 2025
mercari
PRO
0
120
[DevDojo] Introduction to LLMs & AI Agents - 2025
mercari
PRO
0
160
[mercari GEARS 2025] Techniques for Reliable Code Generation Using AI Agents
mercari
PRO
0
270
[mercari GEARS 2025] Foundations of AI - The Invisible Forces Driving Product Innovation
mercari
PRO
0
260
[mercari GEARS 2025] Building Foundation for Mercari’s Global Expansion
mercari
PRO
1
440
[mercari GEARS 2025] The Past, Present, and Future of Anti-Phishing Measures at Mercari
mercari
PRO
0
140
[mercari GEARS 2025] Backend Standardization with MCP
mercari
PRO
0
210
[mercari GEARS 2025] Transforming customer engagement with Google Customer Engagement Suite
mercari
PRO
0
350
[mercari GEARS 2025] PJ Aurora’s Vision and Automated UI Quality Evaluation Agents
mercari
PRO
0
340
Featured
See All Featured
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
How to Ace a Technical Interview
jacobian
281
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
First, design no harm
axbom
PRO
2
1.2k
Designing for Timeless Needs
cassininazir
1
260
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Designing Powerful Visuals for Engaging Learning
tmiket
1
420
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
The untapped power of vector embeddings
frankvandijk
2
1.8k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Transcript
Mercari Tech Conf 2017 Mercari Android Engineer Tsuyoshi Yoshioka (@tsuyogoro)
About me Tsuyoshi Yoshioka (@tsuyogoro) Android Engineer Mercari, Inc (since
Mar, 2016)
Summary • US の Mercari アプリを 6 月に刷新しました • 大刷新した
UI & アーキテクチャ • 全ての選択にはプロダクトをより良くするための理由がある • Mercari Android チームならではの “High 意識” なチームワーク
Android team history since 2016
Mercari Android Team in 2016 JP/US
公安 9 課モデル “ ” 我々の間にはチームプレイなどどいう 都合のよい言い訳は存在せん。 あるとすればスタンドプレーから生じる、 チームワークだけだ。 荒巻大輔,
2002 (攻殻機動隊 S.A.C)
太平洋越しの連携を最適化するノウハウ • 6:30 daily sync meeting • Screen Hero
Mercari Android Team in 2017 US JP UK
US Android team in 2017
US Android Team in 2017 Too difficult to list all...
Re:born
Technical view introduction
None
“速さ” のための挑戦 1. 誰でも同じコードが書けるようにする 2. 全ての問題を適切なサイズに落として解く 3. 最新技術へのチャレンジを積極的に行う
1. 誰でも同じコードが書けるようにする 共通の設計図 共通の武器
1. 誰でも同じコードが書けるようにする View View Model Service Repository • Activity /
Fragment / View • 唯一 Context を触れることができるレイヤ • ViewModel に従うだけ (No logic) • 表示と直接関係ないロジックを持つ • Network access...etc • 全てのロジックは stateless で、Service は状 態を持ってはいけない • 表示に関するロジックを持つ • Pure java であり、JUnit testable • データを持っているレイヤ • 格納場所を意識せずにアクセスできるインター フェースを持つ
1. 誰でも同じコードが書けるようにする 全レイヤを RxJava2 の stream で繋ぐ → RxJava2 をチームの共通の武器に
共通の武器 (RxJava2) を持ってハイコンテキストな議論 配送方法と重さと配送負担が変 更になったら送料計算し直す Flowable.combineLatest ( shippingClass, shippingPayer, (c,
p) -> { .... } 適当なフィールドが入力されてて たら処理する .filter (signal -> !itemName.get().isEmpty() && itemCategory.has() && itemCondition.has()) .flatMapMaybe(signal -> ... 連打防止 (backpressure) RxTextView .textChangeEvents(hashTag) .throttleLast ( 100, TimeUnit.MILLISECONDS )....
1. 誰でも同じコードが書けるようにする 共通の設計図 共通の武器 MVVM + Redux like layered architecture
RxJava2 ...etc
2. 全ての問題を適切なサイズに落として解く • 大きい問題を大きいまま倒そうとするのは無謀 • 大きい問題を小さなサイズに分割したい • 画面を作る時に Activity に全部突っ込む
• 複数の API リクエストと処理を一つのクラスに突っ込む • ...etc 問題を小分けに、かつ、 Configurable にする DI !!
DI 知ってますよね? 直接関係ない問題は 外の人に解いてもらう class SellService { private SellApi sellApi;
private ItemApi itemApi; private AddressApi addressApi; private SuggestApi suggestApi; SellService(ItemApi itemApi, SellApi sellApi, AddressApi addressApi, SuggestApi suggestApi) { this.sellApi = sellApi; this.itemApi = itemApi; this.addressApi = addressApi; this.suggestApi = suggestApi; }
DI 知ってますよね? 自分が解くべき事に注力 /** * Get user's default deliver address.
*/ @CheckReturnValue Maybe<DeliverAddress> getDefaultAddress() { return addressApi.getDeliverList() .filter(resp -> !resp.addresses.isEmpty()) .map(resp -> { Optional<DeliverXX> address = Stream.of(resp.addresses) .filter(addr -> Defaults.get(addr.isDefault)) .findFirst(); if (address.isPresent()) { return address.get(); } else { // if couldn't found default, use first one return resp.addresses.get(0); } }); }
2. 全ての問題を適切なサイズに落として解く • View / ViewModel / Service / Repository
未満の大きさに • 基本的にコンストラクタへの injection を利用する あれ、でも Activity や Fragment ってコンストラクタ無い … Dagger2 !!
Activity へ inject コンストラクタに触れないクラ スへの injection を実装する public class ItemDetailActivity
extends BaseActivity { @Inject ItemDetailViewModel viewModel; @Inject UrlConstruct urlConstruct; @Inject MasterData masterData; ... @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_detail); AppComponent.Holder.get(this) .plus(new ItemDetailComponent.Module(this, itemId)) .inject(this);
2. 全ての問題を適切なサイズに落として解く • 問題がシンプルだと、ゴールへの距離が詰めやすい • 他のメンバーとの • Unit test を書くのが容易になり、Unit
test が動作確認の最速の手段になる • (副産物) Dagger2 の scope を駆使して、 Activity lifecycle の対処も打てた コミュニケーション 続きは
3. 最新技術へのチャレンジを積極的に行う • Protocol buffers • ReactNative • Kotlin +
Kotlify progress 隔週で - Tokyo / San Francisco の Kotlin
事 情の交換 - テクニカルな面での情報交換 - but still we’re looking for a strong reason, why Kotlin? Google I/O の Kotlin サポート発表以来、新規ファイルは全て Kotlin
None
“速さ” のための挑戦 1. 誰でも同じコードが書けるようにする 2. 全ての問題を適切なサイズに落として解く 3. 最新技術へのチャレンジを積極的に行う
太平洋横断開発の難しさと挑戦 コードを書く前に作戦レビュー 高品質 Pull Request 大きい要件にはブランチ戦略 早起き Screen hero (雑な)
日報 たまに出張 共通の設計図 共通の武器 「ハイパフォーマンスな開発チームというのは ...あqwせdrftgyふじこ !!!」(← やらない) 意識高い系 High 意識 「とりあえずこれ上手くいきそうだからやろう。意識たかいたかーい」 (← やる)
Next...
High Scalable Android チーム in the near future… 100 Android
Engineers More than 100 times performance
Referring... https://eng.uber.com/plugins/
まとめ
Summary • US の Mercari アプリを 6 月に刷新しました • 爆速かつハイパフォーマンスなチームを目指したアーキテクチャで、改めて
US 市場を 取りに行く • そしてその先はメンバーが増えれば増えるほどパフォーマンスが上がっていく、スケー ラブルなチームを作り、”新たな価値を生みだす世界的なマーケットプレイス” を実現し たい • We’re High 意識、いしきたかいたかーい
Thank You
None