Page 158 - MDP2020-2
P. 158
| 인천전자마이스터고등학교 ·············································································································
152
나. PWM LED 제어, 초음파 센서 코드
다. 안드로이드 스튜디오 코드
//MainActivity.java 파일
package com.example.webtest;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
private Button btn_pass;
@Override // 프로그램 시작할 때 부르는 메소드
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); //상태줄 제거
setContentView(R.layout.activity_main);