-
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
목차
국문요지 -----------------------------------------------2
1. 서론 ------------------------------------------------6
1) 배경
2) 동기 및 필요성
2. 본론 ------------------------------------------------6
1) 구상
2) 구현 내용
3) 주요 이론
4) 실험 구성 및 과정
5) 부품 선정
3. 결과 및 고찰 ------------------------------------------18
1) 실험 결과
2) 연구 계획
4. 공동 팀원 및 역할 분담 -----------------------------------19
5. 참고 문헌 ---------------------------------------------19
6. 부록 -------------------------------------------------20
1) 데이터시트
2) 회로도
3) 프로그램소스코드
1. 서론 ------------------------------------------------6
1) 배경
2) 동기 및 필요성
2. 본론 ------------------------------------------------6
1) 구상
2) 구현 내용
3) 주요 이론
4) 실험 구성 및 과정
5) 부품 선정
3. 결과 및 고찰 ------------------------------------------18
1) 실험 결과
2) 연구 계획
4. 공동 팀원 및 역할 분담 -----------------------------------19
5. 참고 문헌 ---------------------------------------------19
6. 부록 -------------------------------------------------20
1) 데이터시트
2) 회로도
3) 프로그램소스코드
본문내용
xt = context;
try {
// UUID를 사용하여 서버 소켓을 만듭니다.
tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(
"My Bluetooth", mUuid);
} catch (IOException e) {
showToast("서버 소켓을 만드는데 실패하였습니다. " + e.toString());
}
mmServerSocket = tmp;
}
public void run() {
showToast("클라이언트를 기다리는 중입니다.");
BluetoothSocket socket = null;
// 클라이언트가 접속을 시도할때까지 기다립니다.
while (true) {
try {
if (mmServerSocket != null) {
socket = mmServerSocket.accept();
}
} catch (IOException e) {
break;
}
// If a connection was accepted
if (socket != null) {
// 클라이언트와 연결되고 소켓이 생성되면
// 소켓을 통해 데이터 송수신을 시작합니다.
startConnectedThread(socket);
showToast("클라이언트와 연결되었습니다.");
try {
if (mmServerSocket != null) {
mmServerSocket.close();
}
} catch (IOException e) {
e.printStackTrace();
showToast("서버 소켓을 종료하는 중 에러가 발생하였습니다. " + e.toString());
}
break;
}
}
}
// 리스닝 소켓을 닫고 스레드를 종료합니다.
public void cancel() {
try {
if (mmServerSocket != null) {
mmServerSocket.close();
}
} catch (IOException e) {
}
}
}
private void showToast(String msg) {
Message message = handler.obtainMessage();
message.what = SHOW_TOAST;
message.arg1 = 0;
message.arg2 = 0;
message.obj = msg;
handler.sendMessage(message);
}
}
package com.example.doorlock;
import java.util.ArrayList;
import java.util.Set;
import android.app.ListActivity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class SearchBluetoothDeviceActivity extends ListActivity {
private ArrayAdapter mArrayAdapter;
private ArrayList mBluetoothDeviceList;
BluetoothAdapter mBluetoothAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_bluetooth_device_activity);
ArrayList arrayList = new ArrayList();
mArrayAdapter = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, arrayList);
setListAdapter(mArrayAdapter);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothDeviceList = new ArrayList();
if (mBluetoothAdapter == null) {
finish();
}
if (!mBluetoothAdapter.isEnabled()) {
Intent it = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(it, MyBluetoothAppActivity.REQUEST_ENABLE_BT);
}
Set pairedDevices = mBluetoothAdapter
.getBondedDevices();
if (pairedDevices.size() > 0) {
for (BluetoothDevice device : pairedDevices) {
mArrayAdapter
.add(device.getName() + "\n" + device.getAddress());
mBluetoothDeviceList.add(device);
}
}
}
@Override
public void onListItemClick(ListView parent, View v, int position, long id) {
super.onListItemClick(parent, v, position, id);
BluetoothDevice device = mBluetoothDeviceList.get(position);
Intent it = new Intent();
it.putExtra("device", device);
setResult(MyBluetoothAppActivity.SEARCH_BT_DEVICE, it);
finish();
}
}
try {
// UUID를 사용하여 서버 소켓을 만듭니다.
tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(
"My Bluetooth", mUuid);
} catch (IOException e) {
showToast("서버 소켓을 만드는데 실패하였습니다. " + e.toString());
}
mmServerSocket = tmp;
}
public void run() {
showToast("클라이언트를 기다리는 중입니다.");
BluetoothSocket socket = null;
// 클라이언트가 접속을 시도할때까지 기다립니다.
while (true) {
try {
if (mmServerSocket != null) {
socket = mmServerSocket.accept();
}
} catch (IOException e) {
break;
}
// If a connection was accepted
if (socket != null) {
// 클라이언트와 연결되고 소켓이 생성되면
// 소켓을 통해 데이터 송수신을 시작합니다.
startConnectedThread(socket);
showToast("클라이언트와 연결되었습니다.");
try {
if (mmServerSocket != null) {
mmServerSocket.close();
}
} catch (IOException e) {
e.printStackTrace();
showToast("서버 소켓을 종료하는 중 에러가 발생하였습니다. " + e.toString());
}
break;
}
}
}
// 리스닝 소켓을 닫고 스레드를 종료합니다.
public void cancel() {
try {
if (mmServerSocket != null) {
mmServerSocket.close();
}
} catch (IOException e) {
}
}
}
private void showToast(String msg) {
Message message = handler.obtainMessage();
message.what = SHOW_TOAST;
message.arg1 = 0;
message.arg2 = 0;
message.obj = msg;
handler.sendMessage(message);
}
}
package com.example.doorlock;
import java.util.ArrayList;
import java.util.Set;
import android.app.ListActivity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class SearchBluetoothDeviceActivity extends ListActivity {
private ArrayAdapter
private ArrayList
BluetoothAdapter mBluetoothAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_bluetooth_device_activity);
ArrayList
mArrayAdapter = new ArrayAdapter
android.R.layout.simple_list_item_1, arrayList);
setListAdapter(mArrayAdapter);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothDeviceList = new ArrayList
if (mBluetoothAdapter == null) {
finish();
}
if (!mBluetoothAdapter.isEnabled()) {
Intent it = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(it, MyBluetoothAppActivity.REQUEST_ENABLE_BT);
}
Set
.getBondedDevices();
if (pairedDevices.size() > 0) {
for (BluetoothDevice device : pairedDevices) {
mArrayAdapter
.add(device.getName() + "\n" + device.getAddress());
mBluetoothDeviceList.add(device);
}
}
}
@Override
public void onListItemClick(ListView parent, View v, int position, long id) {
super.onListItemClick(parent, v, position, id);
BluetoothDevice device = mBluetoothDeviceList.get(position);
Intent it = new Intent();
it.putExtra("device", device);
setResult(MyBluetoothAppActivity.SEARCH_BT_DEVICE, it);
finish();
}
}
키워드
추천자료
- haptic(햅틱)에 대하여
- 북한의 과학기술
- 바이오 칩의 기술 및 응용에 관한 특허 분석
- 자동차기관의 고효율과 배기정화
- 교재와 교수매체
- 인터넷의 역기능과 대처 방안-개인정보의 유출과 사생활 침해
- [바이오칩][단백질칩][뉴로칩][바이오칩 분류][단백질칩 연구동향][뉴로칩 구성][뉴로칩 개발...
- 두산중공업의 베트남 진출 전략 분석
- 재미있는 자동차 이야기 - 도요타(토요타) 리콜 사태 사례
- [BIT][BT][IT]BT 생명공학기술 IT 정보통신기술 융합(BIT)의 현황, 추진전략, BT 생명공학기...
- 컴퓨터 정보통신 학과 입사용 추천 자기소개서 자소서 이력서
- 히든챔피언 분석보고서 <이오테크닉스>
- PDLC
소개글