Android Open Source - BtDemo Main Activity






From Project

Back to project page BtDemo.

License

The source code is released under:

Apache License

If you think the Android project BtDemo 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 cn.edu.hust.cm.bt.demo;
//from www .j a  va2  s.  co m
import cn.edu.hust.cm.bt.demo.client.ClientMainActivity;
import cn.edu.hust.cm.bt.demo.server.ServerMainActivity;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    public void onClick(View view) {
        int id = view.getId();
        switch (id) {
        case R.id.btn_client:
            startBtClient(view);
            break;

        case R.id.btn_server:
            startBtServer(view);
            break;

        default:
            break;
        }
    }

    private void startBtClient(View view) {
        ClientMainActivity.startMe(this);
    }

    private void startBtServer(View view) {
        ServerMainActivity.startMe(this);
    }

}




Java Source Code List

cn.edu.hust.cm.bt.demo.BaseBinderActivity.java
cn.edu.hust.cm.bt.demo.BaseBinderService.java
cn.edu.hust.cm.bt.demo.BaseBluetoothSocket.java
cn.edu.hust.cm.bt.demo.LocalBinder.java
cn.edu.hust.cm.bt.demo.MainActivity.java
cn.edu.hust.cm.bt.demo.client.ClientMainActivity.java
cn.edu.hust.cm.bt.demo.client.package-info.java
cn.edu.hust.cm.bt.demo.server.BluetoothServerThread.java
cn.edu.hust.cm.bt.demo.server.BluetoothServer.java
cn.edu.hust.cm.bt.demo.server.ServerBinderActivity.java
cn.edu.hust.cm.bt.demo.server.ServerBinderService.java
cn.edu.hust.cm.bt.demo.server.ServerMainActivity.java
cn.edu.hust.cm.bt.demo.server.package-info.java