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
Android 8.0のPush受信時のサービス起動について
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
hideoohashi
November 15, 2018
Programming
1.6k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android 8.0のPush受信時のサービス起動について
hideoohashi
November 15, 2018
More Decks by hideoohashi
See All by hideoohashi
SmartNews 5.0 ちょっと苦労した話 / shibuya.apk #19
hideoohashi
5
5k
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
180
Kotlinの15年とServer-Side Kotlin
n_takehata
1
190
Inertia Rails: The One-Person Framework with React & Friends
skryukov
0
200
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
0
110
最近”作らせてる” ローカルAIアプリの話
akit37
0
530
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
400
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
140
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
160
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
250
パスワード再設定メールのURLについて知っておこう
uyuki234
0
200
Getting Started with Vibe Coding
miccheng
0
140
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
330
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
510
Game over? The fight for quality and originality in the time of robots
wayneb77
1
320
Code Review Best Practice
trishagee
74
20k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
590
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
460
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
How to train your dragon (web standard)
notwaldorf
96
6.9k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
650
Transcript
Android 8.0のPush受信時の サービス起動について 2018/11/15 - potatotips #56 Hideo Ohashi 1
About Me • Androidエンジニア8年間やってます • 現在はスマートニュース株式会社でAndroidアプ リ開発全般に関わっています 2
Today’s topic • Android 8.0対応時に発生した、Push受信時の バックグラウンドサービス起動の問題と、そこか ら学んだことの共有させていただきたいと思いま す 3
バックグラウンドサービスの制限 • Android 8.0からバックグラウンドサービスの実 行に制限がつきました ◦ https://developer.android.com/about/versions/oreo/background • ただし特定の状況のときは実行制限はなくなり、 優先度高のPush受信もそのうちのひとつです
4
状況 • SmartNewsではPushを受けた後に処理を Serviceに委譲し、別途画像を取得して Notificationを出していました • Android8.0でもそのままで動作するはずが、 startService()の呼び出しで IllegalStateExceptionが発生していました 5
なぜだろうか? 6
原因(たぶん) • 試しに優先度高のPushを受けてから60秒ほど 経った後にstartService()を呼び出したら IllegalStateExceptionが発生しました • onReceive()では基本的にstartService()を呼び 出しているだけなので、Pushを受けてからアプリ のonReceive()が呼ばれるまでの、アプリ側から 手が出せないところで時間がかかってしまってい
る可能性が高い 7
どう解決したか • Serviceを使っていた理由は主に画像ダウン ロードだったので、startService()に失敗した場 合は画像なしでNotificationを出すことで解決さ せました ◦ 多少の情報は落ちてもリアルタイムに表示することを優 先させました 8
まとめ • 何かPushを受けてバックグラウンドサービスを 動かしたいとき、優先度高のPushでも startService()が失敗する場合があることを考え て設計・実装したほうがよさそう 9
ご静聴ありがとうございました 10