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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
magiepooh
April 21, 2016
Technology
740
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
890
Customize Error Message
magiepooh
0
920
Kotlin入門
magiepooh
2
1.9k
Adjust Full Screen
magiepooh
2
570
How to get size of NavigationBar and StatusBar
magiepooh
1
1.8k
Other Decks in Technology
See All in Technology
Dylib Hijacking on macOS: Dead or Alive?
patrickwardle
0
160
「面白い!」を信じ抜け。激動の時代を貫く、オンリーワン・エンジニアの条件
kizawa2020
2
450
顧客の要望は2次情報である 〜アンテナを張るFDEの構造論〜
noriakioji
5
1.1k
型落ちシンクライアント端末のPoEモジュールを自作したかった話
logica0419
0
520
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.3k
internal/testlog で遊ぼう
rokuosan
0
410
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
8
1.6k
紙 to デジタル
ichien178
0
420
1.5時間を無駄にして学んだwsl2におけるaptとsnapの選択と仕組み
yosaka0123
0
470
When Token Pruning is Worse than Random: Understanding Visual Token Information in VLLMs
sansantech
PRO
0
180
Master Dataグループ紹介資料
sansan33
PRO
1
4.8k
Microsoft MVP プログラムを紹介するから目指す人増えてくれ
tsubakimoto_s
0
150
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
220
Making Projects Easy
brettharned
120
6.7k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
It's Worth the Effort
3n
188
29k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
290
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
220
Building Flexible Design Systems
yeseniaperezcruz
330
41k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
260
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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͔Βىಈ͔ͨ͠Ͳ͏͔
݁ɿ Ͳ͜Ͱ͑Δ͔શ͘ Θ͔ΒΜɻ