Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.kiapwnz.kiaswarapp;
- import java.net.SocketTimeoutException;
- import com.kiapwnz.kiaswarapp.exception.BadRcon;
- import com.kiapwnz.kiaswarapp.exception.ResponseEmpty;
- import android.os.Bundle;
- import android.app.Activity;
- import android.view.Menu;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.Button;
- public class MainActivity extends Activity
- {
- Button DevButton;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- DevButton = (Button) findViewById(R.id.button1);
- DevButton.setOnClickListener(new OnClickListener()
- {
- public void onClick(View v)
- {
- try {
- Rcon.send(28555, "127.0.0.1", 27017, "password", "say Hallo");
- } catch (SocketTimeoutException e) {
- e.printStackTrace();
- } catch (BadRcon e) {
- e.printStackTrace();
- } catch (ResponseEmpty e) {
- e.printStackTrace();
- }
- }
- });
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.activity_main, menu);
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement