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

Applicationクラスのライフサイクル に気をつけよう

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for gotlin gotlin
November 15, 2024
80

Applicationクラスのライフサイクル に気をつけよう

Avatar for gotlin

gotlin

November 15, 2024
Tweet

Transcript

  1. 4 Applicationクラスのライフサイクルに気をつけろ! class MyApplication: Application() { override fun onCreate() {

    super.onCreate() } } <!– AndroidManifest.xml --> <application android:name=".MyApplication"> <activity android:name=".MyActivity" /> </application>
  2. 16 Applicationクラスのライフサイクルに気をつけろ! Android4大要素 Activity Notification etc. Widget etc. Application Screen

    etc. アプリは 開いていない Data access etc. Service Broad Cast Receiver Content Provider
  3. 18 Applicationクラスのライフサイクルに気をつけろ! Widgetを作成 @AndroidEntryPoint class MyWidgetReceiver : GlanceAppWidgetReceiver() { ...

    } <!- AndroidManifest.xml --> <receiver android:name=".MyWidgetReceiver" > </receiver> https://developer.android.com/develop/ui/views/appwidgets/layouts
  4. 19 Applicationクラスのライフサイクルに気をつけろ! Widgetを作成 @AndroidEntryPoint class MyWidgetReceiver : GlanceAppWidgetReceiver() { ...

    } <!- AndroidManifest.xml --> <receiver android:name=".MyWidgetReceiver" > </receiver> BroadcastReceiver https://developer.android.com/develop/ui/views/appwidgets/layouts
  5. 21 Applicationクラスのライフサイクルに気をつけろ! 通知を送信 <!- AndroidManifest.xml --> <service android:name="MyNotificationService"> </service> class

    MyNotificationService : FirebaseMessagingService() { ... } https://developer.android.com/develop/ui/views/notifications
  6. 22 Applicationクラスのライフサイクルに気をつけろ! 通知を送信 class MyNotificationService : FirebaseMessagingService() { ... }

    Service <!- AndroidManifest.xml --> <service android:name="MyNotificationService"> </service> https://developer.android.com/develop/ui/views/notifications