목록안드로이드 스튜디오 (7)
기루 기룩 기록

이번 시간에는 동영상 파일을 출력하는것을 알아보겠습니다. 필요한 준비물 - test용 mp4 파일 - 시간 activity_test.xml 파일에 VideoView 태그를 사용해 비디오가 들어갈 영역을 만들어 주겠습니다. id를 testVideo로 해서 입력해주세요. app - res안에 raw 폴더를 생성 후 준비물로 챙겨온 test.mp4 파일을 넣어주세요. Test.java에 다음과 같이 작성해 주세요. 실행 화면입니다.

android:maxHeight: 최대 높이 android:maxWidth: 최대 폭 android:src: 출력할 이미지 android:background: 배경

New Activity 생성하기 app - 마우스 우클릭 - New - Activity - Empty Activity 클릭 Activity Name을 설정해 주고 Finish 버튼을 클릭하도록 합니다. mainLayout와 생성된 Layout을 다음과 같이 만들어주세요 activity_main.xml에는 버튼을 만들어 id를 "@+id/moveButton" 으로 작성해 주세요. MainActivity.java를 열어 다음과 같이 작성해주세요. findViewById를 사용해 activity_main.xml에 있는 moveButton을 불러오겠습니다. 아래와 같이 작성해 activity_main.xml에 있는 moveButton에 새로운 액티비티로 이동할 수 있도록 만들어 주겠습니다. moveButton...

- 버튼 생성하는 2가지 방법 1.activity_main.xml 에서 아래 코드처럼 Text에 직접 Button을 생성하기 2. Design에서 Common - Button을 끌어다 생성하기 - 버튼 클릭 이벤트 추가하기 버튼을 생성한 후 속성에 Android:onClick("")를 통해 클릭 시 실행할 이벤트를 추가할 수 있습니다. 이번 글에서는 클릭 시 메시지를 띄어주는 이벤트를 추가해 보겠습니다. 우선 버튼 코드에 Android:onClick("btnClick")를 작성해 줍니다. 처음 작성 시 빨간 줄이 뜨는데 이는 btnClick라는 이벤트가 생성돼 있지 않아서 나타나는 오류입니다. 우선 넘어가셔도 괜찮습니다. MainActivity.java 파일을 열어 onCreate( ) 함수 및에 btn..

프로젝트 생성 후 나타나는 화면에 대한 설명과 AVD 설정을 진행하겠습니다. 1 프로젝트 파일 목록 2 코드 작성 및 Activity 확인 3 Build, Terminar, Logcat... 확인 - manifests 1. 앱이 실행됐을때 가장 먼저 실행되는 Activity - AVD 설정하기 Tools - AVD Manager 실행 - Create Vitual Device... 클릭 Pixel 2 - Next 클릭 프로젝트 생성 시 설정한 API Level 선택 후 Download 다운로드 완료 후 해당 API Level 선택 후 Next Finish - AVD 실행화면

- Android Studio 실행 - Start a new Android Studio project 선택 - Basic Activity: 기본적인 Activity 생성하기 - Empty Activity: 빈 Activity 생성하기 - Nottom Navigation Activity: 버튼 navigation activity 생성하기 - Fragment + ViewModel: fragment with view model activity 생성하기 - Fullscreen Activity - Master/Detail Flow - Navigation Drawer Activity 이 중 Empty Activity를 생성하도록 하겠습니다. - hello world 프로그램 생성 1. Language 같은 경우는 ..