Где мне следует поддерживать соединение сокета в приложении AndroidAndroid

Форум для тех, кто программирует под Android
Гость
Где мне следует поддерживать соединение сокета в приложении Android

Сообщение Гость »


I have an Android app that needs to establish a socket connection when it comes to the foreground. This connection is intended for receiving updates and writing them to a local database. Here are my requirements:
  • Connection Duration: The connection should automatically disconnect after approximately 30 seconds in the background.
  • No Persistent Notification: I cannot use a foreground service because a persistent notification is not suitable for my use case.

What is the recommended way of achieving the same.


Источник: https://stackoverflow.com/questions/780 ... ndroid-app

Вернуться в «Android»