Android Open Source - AndroidGameController One Button






From Project

Back to project page AndroidGameController.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidGameController listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.danloman.udpcontroller;
/* ww w  .j  a v  a  2 s . c o  m*/
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

/**
 * Created by dlom on 1/11/15.
 */
public class OneButton extends Fragment
{
    @Override
    public View onCreateView(
      LayoutInflater inflater,
      ViewGroup container,
      Bundle savedInstanceState)
    {
        View rootView = inflater.inflate(R.layout.one_button, container, false);
        Button BigButton = (Button) rootView.findViewById(R.id.BigButton);
        BigButton.setOnClickListener(BigButtonListener);
        return rootView;
    }

    View.OnClickListener BigButtonListener = new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            MainActivity.sendData("W00t");
        }
    };
}




Java Source Code List

org.danloman.udpcontroller.ApplicationTest.java
org.danloman.udpcontroller.DefaultFragment.java
org.danloman.udpcontroller.MainActivity.java
org.danloman.udpcontroller.OneButton.java
org.danloman.udpcontroller.TwoButton.java