Prepare to Project android to Control arduino
https://developer.android.com/guide/topics/ui/controls/togglebutton.html http://androidcontrol.blogspot.co.id/2014/06/arduino-control-rgb-leds-via-bluetooth.html ToggleButton toggle = ( ToggleButton ) findViewById ( R . id . togglebutton ); toggle . setOnCheckedChangeListener ( new CompoundButton . OnCheckedChangeListener () { public void onCheckedChanged ( CompoundButton buttonView , boolean isChecked ) { if ( isChecked ) { // The toggle is enabled } else { // The toggle is disabled } } });