Advertisement
Guest User

Untitled

a guest
Jan 15th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. package com.kiapwnz.kiaswarapp;
  2.  
  3. import java.net.SocketTimeoutException;
  4.  
  5. import com.kiapwnz.kiaswarapp.exception.BadRcon;
  6. import com.kiapwnz.kiaswarapp.exception.ResponseEmpty;
  7.  
  8. import android.os.Bundle;
  9. import android.app.Activity;
  10. import android.view.Menu;
  11. import android.view.View;
  12. import android.view.View.OnClickListener;
  13. import android.widget.Button;
  14.  
  15. public class MainActivity extends Activity
  16. {
  17.  
  18. Button DevButton;
  19.  
  20. @Override
  21. protected void onCreate(Bundle savedInstanceState) {
  22. super.onCreate(savedInstanceState);
  23. setContentView(R.layout.activity_main);
  24. DevButton = (Button) findViewById(R.id.button1);
  25. DevButton.setOnClickListener(new OnClickListener()
  26. {
  27. public void onClick(View v)
  28. {
  29. try {
  30. Rcon.send(28555, "127.0.0.1", 27017, "password", "say Hallo");
  31. } catch (SocketTimeoutException e) {
  32. e.printStackTrace();
  33. } catch (BadRcon e) {
  34. e.printStackTrace();
  35. } catch (ResponseEmpty e) {
  36. e.printStackTrace();
  37. }
  38. }
  39. });
  40. }
  41.  
  42. @Override
  43. public boolean onCreateOptionsMenu(Menu menu) {
  44. // Inflate the menu; this adds items to the action bar if it is present.
  45. getMenuInflater().inflate(R.menu.activity_main, menu);
  46. return true;
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement