<p><span style="color: #404040; font-family: 굴림;">* getSystemService()&nbsp;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - 데몬으로 떠있는 안드로이드OS로 부터 특정 값(H/W)을 얻어오기&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - getSystemService(Context.SENSOR_SERVICE);&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; 예) 장비에 있는 센서값 객체를 얻어옴&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; ---&gt; 이렇게 얻어오도록 한 다음 OS가 값을 리턴하는 것을 Listener를 통해서 값이 리턴되는 것을 기다림&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (센서값이 객체를 호출시 바로 오는것이 아니기 때문에, 센서값의 경우 센서값이 변화되야지 Listener가 리턴됨)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - SensorEventListener&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; 센서값이 변화되었을 경우 값을 리턴해주는 Listener객체&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; onAccuracyChanged() - 센서 정확도 수정 메소드(배터리 잔량에 따라서 정확도 변화)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; onSensorChanged() - 센서 값 변화 메소드, 메소드의 매개변수(필드)인 SensorEvent를 통해서 위의 정확도를 가져올수 있음&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; (onAccuracyChanged() 사용안해도됨)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* 센서값 호출 및 처리 절차 순서&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - 1) getSystemService(Context.SENSOR_SERVICE);&nbsp; //장비로 부터 센서호출&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; 2) SensorEventListener sensorEL = new SensorEventListener() {}&nbsp; //호출된 센서값을 리턴&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; --- onSensorChanged(SensorEvent event) {}&nbsp; //리턴된 센서값의 호출감지&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *SensorEvent 필드에 실제 센서 측정값 저장(float[] value인자)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; 3) sensorManager.registerListenr();&nbsp; //어떤 주기로 센서값을 가져올 것인지 이벤트 등록&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* 안드로이드에서 쓰레드&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - App을 구성하는 기능, 메소드 하나가 한 쓰레드&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - 기본은 Single Thread, 즉 메소드 하나씩 순서대로 실행 됨&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* view 를 상속받은 widget 클래스(Button/EditText/TextView)는 다른 View의 포함이 불가능함&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; view 를 상속받은 ViewGroup 클래스(ListView-TextView/GallaryView-ImageView포함)는 다른 View 포함&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* view를 상속받은 SurfaceView클래스 : 카메라 이미지를 가져옴&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - 자바에서 단 하나뿐인 멀티쓰레드 동작이 기본인 객체&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - Activity 와 독립적으로 동작함&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* SurfaceHolder&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - SurfaceView의 이벤트를 감시, 콜백메소드(SurfaceHolder.Callback) 호출&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - SurfaceHolder.Callback&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; surfaceCreated&nbsp; - 화면이 활성화 되었을때&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; surfaceChanged - 화면이 변화 되었을때&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; surfaceDestroyed - 화면이 비활성화 되었을때&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - SurfaceView 1개당 SurfaceHolder 1개만 존재 할 수 있어 인스턴트 생성시 new로 생성하지 않음&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; private SurfaceHolder surfaceHolder;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; &nbsp; surfaceHolder = getHolder();&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp;&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* View&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - 화면의 일정영역 차지, 화면에 출력하는 기능&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - public void onDraw(Canvas canvas);&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; Activity가 활성화 될 때 호출되어 화면에 위젯등을 출력&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; ; View.invalidate() 호출&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - canvas.drawText("Hello", 0, 0, paint);&nbsp; //화면에 글씨출력 (출력내용, X좌표, Y좌표, 출력명령)&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; canvas.rotate(30, getWidth()/2, getHeight()/2);&nbsp; //X, Y좌표로 이동후 30도 기울인 곳으로 기준점이동&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; canvas.drawText("Hello", 0, 0, paint);&nbsp; //위에서 이동된 기준점에서 화면에 글씨출력&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; &nbsp; canvas.translate(100, 100);&nbsp; //X, Y좌표(각 100)로 기준점이동&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">* RelativeLayout&nbsp; : res/layouy 폴더내의 main.xml에 정의&nbsp;</span><br style="color: #404040; font-family: 굴림;" /><span style="color: #404040; font-family: 굴림;">&nbsp; - &lt;RelativeLayout&gt;&nbsp; ~&nbsp; &lt;/RelativeLayout&gt; 사이에 있는 객체들을 순서대로 겹쳐서 보이게함</span></p>