2026년 1월 14일 수요일

Android Studio (Kotlin tutorial)

 

https://www.youtube.com/watch?v=Ik4wJoETjw4

1.이미지 아무거나 복사
Android Studio로 들어가서
res >> drawable에 우클릭 >> paste

Gradle Scripts >> build.gradle.kts(Module :app)
>> 코드상에서 dependencies로 가서 코드 추가할것


●MainActivity.kt :: This is a Kotline file and is used to code in Kotlin language
●activity_main.xml :: This is a xml file and is used for layout of our main activity


https://www.geeksforgeeks.org/kotlin/kotlin-android-tutorial/

==============================================================

https://www.youtube.com/watch?v=wedWi2Rcs8Q&t=6s
layout 폴더에 activity.xml 추가하기
★원래 layout폴더와 그밑의 activity_main.xml은 없던건데 내가 생성함


MainActivity.xml이 처음에 안보이는 경우가 있다.
프로젝트 생성할때 empty view activity를 선택해주면 MainActivity.xml이 보인다.

이렇게 해야 비로소
빨간 네모처럼 Java class, Kotlin class 아니콘이 합쳐진 형태로 된다.



============================================================

https://www.geeksforgeeks.org/android/button-in-kotlin/
Button is a user interface that is used to perform some action
...
Step2: activity_main.xml file
Add a button wiget in the layout of the activity.
Below is the code of the activity_main.xml

==========================================================



xml 파일을 비활성화 시키는 방법
폴더를 따로 생성해서 거기로 잠시 옮겨두는걸 추천함
옮기려는 xml파일 선택후 F6누르고 이동시키려는 Directory를 설정하면 된다.

댓글 없음:

댓글 쓰기