I am creating a android app that uses a TCP socket to connect to a server. It continuously receives xml strings from this socket and I need to parse it as it comes. Currently I've implemented the socket in a service in the same process of the application.
I get outofmemory exception sometimes. The xml strings I receive will be around 1-3mb. My question is, will it be more efficient if a run my service in a separate process as my socket constantly needs to work? What is the best way to implement a socket in android which works the app life span?