Page 585 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 585
private BluetoothAdapter mBluetoothAdapter = null;
public static BluetoothTestService Beaconservicestart = null; // 서비스 객체애 대한
클래스
public BeaconService mBeaconService;
/**
* Called when the activity is first created.
*/
@Override//activity 생성 블루투스가 가능한 기종인지 확인하는 메소드를 꺼내서 블루투스
기종인지 확인한다.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main1);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter == null) {
Toast.makeText(this, "Bluetooth is not available",
Toast.LENGTH_LONG).show();
finish();
return;
}
}
public void onClick01(View v) {
Button btn = (Button) v;
if(btn.getId()==R.id.tvId) {
final Intent intent = new Intent(this, BeaconService.class);
startActivity(intent);
mBeaconService = new BeaconService();
- 578 -