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.5k
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
870
Customize Error Message
magiepooh
0
900
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
ロボティクスの技術 / Robotics Technology
ks91
PRO
0
130
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
210
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
270
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
250
GitHub Copilot運用のリアル ~AI Credit時代にどう向き合うか~
takafumisu2uk1
0
150
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
1
490
クレデンシャル流出 ― 攻撃 3 時間 vs 復旧 10 時間。この非対称性にどう備えるか
kazzpapa3
3
570
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
140
從開發到部署全都交給 AI:實作 AI 驅動的自動化流程
appleboy
0
170
アラート調査向けAIエージェントの本番導入とその後/AI Agents for Alert Investigation: Production Deployment and After
taddy_919
0
150
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
320
元銀行員がAIだけでアプリを量産!「バイブコーディング実演セミナー 」
tatsuya1970
0
110
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Amusing Abliteration
ianozsvald
1
210
Utilizing Notion as your number one productivity tool
mfonobong
4
330
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Embracing the Ebb and Flow
colly
88
5.1k
Context Engineering - Making Every Token Count
addyosmani
9
980
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
240
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
RailsConf 2023
tenderlove
30
1.5k
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͔Βىಈ͔ͨ͠Ͳ͏͔
݁ɿ Ͳ͜Ͱ͑Δ͔શ͘ Θ͔ΒΜɻ