package com.example.client01;


import java.net.ServerSocket;
import java.net.Socket;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

	 Button button1;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		 button1 = (Button) findViewById(R.id.button1);
		 
		 button1.setOnClickListener(new View.OnClickListener() {
		      	public void onClick(View v) {
		      		click();
		      	}
		      });
		

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
	
	
	
	 public void click(){
	     int a = 5;
	     
	     try {
	    	 
	    	 System.out.println("S: Connecting...");
            Socket Socket = new Socket("192.168.1.34", 8081);	
	            
	            
	          
	    	 
	     }
	     catch (Exception e) {
             System.out.println("S: Error");
             e.printStackTrace();
         }
	    	 
	     
	     
	 }
}
