Its better to keep all application specific things in Application class.
http://developer.android.com/reference/android/app/Application.html
eg-
public class XYZ extends Application {
.....
}
All the app specific initialization could be used here too.
For your requirement , Static initialization fits here well. The only thing is that It can be done in Application class rather than a Service ( which is prone to be killed by android )
Force stopping the app will kill the entire process (i.e. with Process.killProcess(int pid)). All resources associated with the application will be removed and freed by the kernel. So no, there is no way that you can intercept this action.
but for safer side always
1) You should unregister the server connection in OnDestory ()
2) Even for more safer you can use following functions in Application class
public void onLowMemory ()
public void onTerminate ()
public void onTrimMemory (int level)