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.
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: [list] [*]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. [/list] What is the recommended way of achieving the same.