Added server/client code to Mainactivity