Android Open Source - Android-BluetoothSPPLibrary Main






From Project

Back to project page Android-BluetoothSPPLibrary.

License

The source code is released under:

Apache License

If you think the Android project Android-BluetoothSPPLibrary 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 app.akexorcist.bluetoothspp;
/*w  w w .ja v a 2  s.  co m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class Main extends Activity implements OnClickListener {


    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Button btnSimple = (Button) findViewById(R.id.btnSimple);
        btnSimple.setOnClickListener(this);

        Button btnListener = (Button) findViewById(R.id.btnListener);
        btnListener.setOnClickListener(this);

        Button btnAutoConnect = (Button) findViewById(R.id.btnAutoConnect);
        btnAutoConnect.setOnClickListener(this);

        Button btnDeviceList = (Button) findViewById(R.id.btnDeviceList);
        btnDeviceList.setOnClickListener(this);

        Button btnTerminal = (Button) findViewById(R.id.btnTerminal);
        btnTerminal.setOnClickListener(this);
    }

    public void onClick(View v) {
        int id = v.getId();
        Intent intent = null;
        switch (id) {
            case R.id.btnSimple:
                intent = new Intent(getApplicationContext(), SimpleActivity.class);
                startActivity(intent);
                break;
            case R.id.btnListener:
                intent = new Intent(getApplicationContext(), ListenerActivity.class);
                startActivity(intent);
                break;
            case R.id.btnAutoConnect:
                intent = new Intent(getApplicationContext(), AutoConnectActivity.class);
                startActivity(intent);
                break;
            case R.id.btnDeviceList:
                intent = new Intent(getApplicationContext(), DeviceListActivity.class);
                startActivity(intent);
                break;
            case R.id.btnTerminal:
                intent = new Intent(getApplicationContext(), TerminalActivity.class);
                startActivity(intent);
                break;
        }
    }
}




Java Source Code List

app.akexorcist.bluetoothspp.ApplicationTest.java
app.akexorcist.bluetoothspp.AutoConnectActivity.java
app.akexorcist.bluetoothspp.DeviceListActivity.java
app.akexorcist.bluetoothspp.ListenerActivity.java
app.akexorcist.bluetoothspp.Main.java
app.akexorcist.bluetoothspp.SimpleActivity.java
app.akexorcist.bluetoothspp.TerminalActivity.java
app.akexorcist.bluetotohspp.library.ApplicationTest.java
app.akexorcist.bluetotohspp.library.BluetoothSPP.java
app.akexorcist.bluetotohspp.library.BluetoothService.java
app.akexorcist.bluetotohspp.library.BluetoothState.java
app.akexorcist.bluetotohspp.library.DeviceList.java