안드로이드 블루투스(android bluetooth) 연결 소스파일(어플)입니다.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
해당 자료는 10페이지 까지만 미리보기를 제공합니다.
10페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

안드로이드 블루투스(android bluetooth) 연결 소스파일(어플)입니다.에 대한 보고서 자료입니다.

목차

[.settings]
[assets]
[bin]
[gen]
[libs]
[res]
[src]
.classpath
.project
AndroidManifest.xml
ic_launcher-web.png
proguard-project
project.properties



822KB
파일 49, 폴더 23

본문내용

MainActivity.java




import android.app.Activity;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.os.Bundle;


public class MainActivity extends Activity implements OnClickListener {

    private static final String TAG = \\"Main\\";
    

    private static final int REQUEST_CONNECT_DEVICE = 1;
    private static final int REQUEST_ENABLE_BT = 2;
    

    private Button btn_Connect;
    private TextView txt_Result;
    
    private BluetoothService btService = null;
    
    
    private final Handler mHandler = new Handler() {

        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
        }
        
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.e(TAG, \\"onCreate\\");
        
        setContentView(R.layout.main);
        
        
        btn_Connect = (Button) findViewById(R.id.btn_connect);
        txt_Result = (TextView) findViewById(R.id.txt_result);
        
        btn_Connect.setOnClickListener(this);
        
        
        if(btService == null) {
            btService = new BluetoothService(this, mHandler);
        }
    }

    @Override
    public void onClick(View v) {
        if(btService.getDeviceState()) {
            btService.enableBluetooth();
        } else {
            finish();
        }
    }
    
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(TAG, \\"onActivityResult \\" + resultCode);

switch (requestCode) {


case REQUEST_CONNECT_DEVICE:

if (resultCode == Activity.RESULT_OK) {
    btService.getDeviceInfo(data);
}
break;

case REQUEST_ENABLE_BT:
// When the request to enable Bluetooth returns
if (resultCode == Activity.RESULT_OK) {
    // Next Step
    btService.scanDevice();
} else {

Log.d(TAG, \\"Bluetooth is not enabled\\");
}
break;
}
    }

}
  • 가격3,100
  • 페이지수49페이지
  • 등록일2014.11.22
  • 저작시기2014.6
  • 파일형식압축파일(zip)
  • 자료번호#950857
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니