I\'m building a simple chat that connects between an android client and a java server (running on my pc). The user can send and receive messages to/from the android app and
I suggest you take a look at the Android documentation for background services. Personally I would use the IntentService as it's a well established pattern within Android.