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
AppLaunchChecker
Search
magiepooh
April 21, 2016
Technology
730
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AppLaunchChecker
AppLaunchChecker
magiepooh
April 21, 2016
More Decks by magiepooh
See All by magiepooh
今さら角丸のTransition
magiepooh
0
1.6k
Google I/O Extended Tokyo 2018
magiepooh
2
1.7k
APIのデータのマッピングを 約18倍速くした話
magiepooh
2
1.1k
まだAPI定義管理で消耗してるの?〜Swaggerを用いた大規模アプリ時代のAPI定義管理とコードジェネレート〜
magiepooh
38
19k
RootBeer
magiepooh
0
880
Customize Error Message
magiepooh
0
910
Kotlin入門
magiepooh
2
1.9k
Adjust Full Screen
magiepooh
2
560
How to get size of NavigationBar and StatusBar
magiepooh
1
1.8k
Other Decks in Technology
See All in Technology
インシデント事例と パッケージの全量解析に学ぶ ソフトウェアサプライチェーンの守り方 / supply-chain-attack-defense
flatt_security
0
140
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
220
公式ドキュメントの歩き方etc
coco_se
1
120
CIで使うClaude
iwatatomoya
0
290
発表と総括 / Presentations and Summary
ks91
PRO
0
140
関数型の考えを TypeScript に持ち込んで、テストしやすい純粋関数を増やす / Pure at the Core, Effects at the Edge: Bringing Functional Thinking into TypeScript
kaminashi
2
130
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
290
仕様駆動開発、導入半年。「本当に速くなってるの?」にデータで答える / AICon2026_hirakawa
rakus_dev
0
150
SRE Next 2026 何でも屋からの脱却
bto
0
1k
複数プロダクト組織のAIネイティブ化における戦略 / AICon2026_kude
rakus_dev
0
160
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
140
AIコード生成×サプライチェーン攻撃 — PHPが直面する“二重の信頼問題
shinyasaita
0
230
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
22k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
370
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
500
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
KATA
mclloyd
PRO
35
15k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
Transcript
AppLaunchChecker @magiepooh
About me @magiepooh @magie_pooh Takuma Fujita
Company AbemaTV, Inc. (Cyber Agent, Inc.)
AppLaunchChecker
?
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AppLaunchChecker.hasStartedFromLauncher(this); // =>
false }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AppLaunchChecker.onActivityCreate(this); AppLaunchChecker.hasStartedFromLauncher(this); //
=> true }
public static boolean hasStartedFromLauncher(Context context) { return context.getSharedPreferences(SHARED_PREFS_NAME, 0) .getBoolean(KEY_STARTED_FROM_LAUNCHER,
false); } public static void onActivityCreate(Activity activity) { final SharedPreferences sp = activity.getSharedPreferences(SHARED_PREFS_NAME, 0); if (sp.getBoolean(KEY_STARTED_FROM_LAUNCHER, false)) { return; } final Intent launchIntent = activity.getIntent(); if (launchIntent == null) { return; } if (Intent.ACTION_MAIN.equals(launchIntent.getAction()) && (launchIntent.hasCategory(Intent.CATEGORY_LAUNCHER) || launchIntent.hasCategory(IntentCompat.CATEGORY_LEANBACK_LAUNCHER))) { SharedPreferencesCompat.EditorCompat.getInstance().apply( sp.edit().putBoolean(KEY_STARTED_FROM_LAUNCHER, true)); } } AppLaunchChecker.java
public static boolean hasStartedFromLauncher(Context context) { return context.getSharedPreferences(SHARED_PREFS_NAME, 0) .getBoolean(KEY_STARTED_FROM_LAUNCHER,
false); } public static void onActivityCreate(Activity activity) { final SharedPreferences sp = activity.getSharedPreferences(SHARED_PREFS_NAME, 0); if (sp.getBoolean(KEY_STARTED_FROM_LAUNCHER, false)) { return; } final Intent launchIntent = activity.getIntent(); if (launchIntent == null) { return; } if (Intent.ACTION_MAIN.equals(launchIntent.getAction()) && (launchIntent.hasCategory(Intent.CATEGORY_LAUNCHER) || launchIntent.hasCategory(IntentCompat.CATEGORY_LEANBACK_LAUNCHER))) { SharedPreferencesCompat.EditorCompat.getInstance().apply( sp.edit().putBoolean(KEY_STARTED_FROM_LAUNCHER, true)); } } AppLaunchChecker.java
• SharedPreferencesʹΠϯςϯτͷΞΫγϣϯ ͱ͔ΧςΰϦͱ͔ݟͯϥϯνϟʔ͔Βىಈ͠ ͔ͨΛॻ͖ࠐΜͰΔ͚ͩ • SharedPreferencesͷΛϦηοτ͢Δͷ ༻ҙ͞Ε͍ͯͳ͍
• Πϯετʔϧ > Launcherىಈ // true • Πϯετʔϧ > DeepLink
// false • Πϯετʔϧ > Launcherىಈ > DeepLink // true ݁ɿ
݁ɿ • Πϯετʔϧ > Launcherىಈ // true • Πϯετʔϧ >
DeepLink // false • Πϯετʔϧ > Launcherىಈ > DeepLink // true աڈʹϢʔβ͕ҰͰLauncher͔Βىಈ͔ͨ͠Ͳ͏͔
݁ɿ Ͳ͜Ͱ͑Δ͔શ͘ Θ͔ΒΜɻ