๊ด€๋ฆฌ ๋ฉ”๋‰ด

JiYoung Dev ๐Ÿ–ฅ

[Android] Button, TextView, xml์—์„œ์˜ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ (2023.07.05) ๋ณธ๋ฌธ

full stack/์•ˆ๋“œ๋กœ์ด๋“œ

[Android] Button, TextView, xml์—์„œ์˜ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ (2023.07.05)

Shinjio 2023. 7. 6. 09:01

์ •๋ฆฌ

1๋‹จ๊ณ„

Android 4๋Œ€ View :  Button, TextView, EditText, ImageView

Layout(ํ™”๋ฉด ๋ฐฐ์น˜) : LinearLayout, ContraintLayout(view๋“ค๊ฐ„์— ์ œ์•ฝ์กฐ๊ฑด์„ ์คŒ - ํ•ด์ƒ๋„๊ฐ€ ๋‹ฌ๋ผ์ ธ๋„ ๋˜‘๊ฐ™์€ ํ™”๋ฉด์„ ๋ณผ ์ˆ˜ ์žˆ์Œ)

Event์ฒ˜๋ฆฌ : xml์—์„œ ์ฃผ๋Š” ๋ฐฉ๋ฒ•, kt ํŒŒ์ผ์—์„œ ์ฃผ๋Š” ๋ฐฉ๋ฒ•

 

2๋‹จ๊ณ„

Intent(ํ™”๋ฉด์ „ํ™˜) - activity, context

RecyclerView (๋ชฉ๋กํ˜• ๋ทฐ) (๊ตฌ ListView)

 

3๋‹จ๊ณ„ - ํ†ต์‹ 

์„œ๋ฒ„์™€์˜ ํ†ต์‹  (Volley)

๊ตฌ๊ธ€ ํด๋ผ์šฐ๋“œ ์„œ๋ฒ„ (FireBase)

Fragment ๊ตฌํ˜„ 

Thread/Handler (ํ”„๋กœ์„ธ์Šค ๋ณ‘๋ ฌ ์ฒ˜๋ฆฌ)

 


 

xml + kt = activity

- MainActivity.xml : UI (ํ™”๋ฉด) 

- R : xml๊ณผ kt ์‚ฌ์ด, ๋ชจ๋“  resource ๋‹ด๋‹น, id๋กœ ๋“ฑ๋ก

- MainActivity.kt : ๋กœ์ง, xml์— ๋ฐ”๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์—†์Œ. RํŒŒ์ผ์— ๋“ฑ๋ก๋œ id๊ฐ’์„ ๊ฐ€์ง€๊ณ  xml์˜ view๋ฅผ ์‚ฌ์šฉ(์ฐธ์กฐ) (R.id.id์ด๋ฆ„)

 

 

์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

 

 

 

name : ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ด๋ฆ„, ๋ณ€๊ฒฝ๊ฐ€๋Šฅ

package : ์–ดํ”Œ์„ ๊ตฌ๋ถ„ํ•˜๋Š” ์œ ์ผํ•œ ์ฝ”๋“œ๊ฐ’, ๋ณ€๊ฒฝ ๋ถˆ๊ฐ€๋Šฅ > ๋ฒ„์ ผ์ด ์—…๋ฐ์ดํŠธ๋˜์—ˆ์„ ๋•Œ๋„ ๋™์ผ. ๊ฐ€์šด๋ฐ๊ฐ€ example์ด๋ฉด ํ”Œ๋ ˆ์ด์Šคํ† ์–ด์— ์—…๋กœ๋“œ ๋˜์ง€ ์•Š์Œ

 

 

ํ™”๋ฉด๊ตฌ์„ฑ

 

 

 

๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด TextView์— ์žˆ๋Š” ํ…์ŠคํŠธ๋ฅผ ๋ณ€๊ฒฝ

1. ๋ฒ„ํŠผ์— ํด๋ฆญ ์ด๋ฒคํŠธ ๋ถ€์—ฌ 

2. ํด๋ฆญํ•˜๋ฉด TextView์— ์žˆ๋Š” text ์†์„ฑ ๋ณ€๊ฒฝ

 

์—๋Ÿฌ ํ•ด๊ฒฐ 

์ปค์„œ ๋‘๊ณ  alt + Enter

'full stack > ์•ˆ๋“œ๋กœ์ด๋“œ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Android] ๊ฐ€๋กœ ํ™”๋ฉด ์„ค์ • (2023.07.12)  (0) 2023.07.12
[Android] constraint layout (2023.07.11)  (0) 2023.07.11
[Android] ImageView (2023.07.07)  (0) 2023.07.07
[Android] EditText (2023.07.06)  (0) 2023.07.06
[Android] layout (2023.07.04)  (0) 2023.07.04