I am writing an Android application which establishes a “semi-permanent” TCP socket connection, i.e. the connection should always be established when the application is visible but can be closed when it is not visible.
Currently, the connection is handled in a thread. The connection is only needed in one activity.
I am wondering what would be the advantages of putting the networking thread into an Android local service.
If you don’t need to fetch data from the connection in background when app is not visible, then there is no benefit in putting in into a service.