Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Oのバックグラウンド制限

Android Oのバックグラウンド制限

Android O のバックグラウンド制限について説明します。

参照:
- Background Check and Other Insights into the Android Operating System Framework (Google I/O '17)
https://www.youtube.com/watch?v=hbLAzwhBjFE
- バックグランド実行制限
https://developer.android.com/preview/features/background.html?hl=ja
- 暗黙的なブロードキャストの例外
https://developer.android.com/preview/features/background-broadcasts.html?hl=ja

Hiroshi Kurokawa

June 02, 2017
Tweet

More Decks by Hiroshi Kurokawa

Other Decks in Technology

Transcript

  1. 8 ࣮ߦྫʢόοΫάϥ΢ϯυαʔϏεʣ public class MainActivity extends AppCompatActivity { @Override protected

    void onCreate(Bundle savedInstanceState) { service = new Intent(this, MyService.class); startService(service); public class MyService extends Service { private Timer timer; private final TimerTask task = … @Override public int onStartCommand(Intent intent, int flags, int startId) { timer = new Timer(); timer.scheduleAtFixedRate(task, 0, TimeUnit.SECONDS.toMillis(10));
  2. 10 ࣮ߦྫʢϑΥΞάϥ΢ϯυαʔϏεʣ public class MyService extends Service { private Timer

    timer; private final TimerTask task = … @Override public int onStartCommand(Intent intent, int flags, int startId) { timer = new Timer(); timer.scheduleAtFixedRate(task, 0, TimeUnit.SECONDS.toMillis(10)); PendingIntent pendingIntent = … Notification notification = … startForeground(startId, notification);
  3. 21 ·ͱΊ w "OESPJE0ͷόοΫάϥ΢ϯυ੍ݶ w όοΫάϥ΢ϯυαʔϏε w ҉໧తϒϩʔυΩϟετ w ୅ସखஈ

    w ϑΥΞάϥ΢ϯυαʔϏε w +PC4DIFEVMFS"MBSN.BOBHFS4ZOD"EBQUFS w ϓογϡ௨஌ w +PC*OUFOU4FSWJDF