Skip to content

๐Ÿ‘ฉโ€๐Ÿฆฐ prof.M ์˜ Module ์ƒ์„ฑ๋ฒ•

Kim Hyo Rim edited this page Apr 21, 2022 · 2 revisions

๐Ÿ‘ฉโ€๐Ÿฆฐ prof.M ์˜ module ์ƒ์„ฑ๋ฒ•

๋‹ค๋ฅธ ๋ชจ๋“ˆ๋“ค์€ ์ด๋ฏธ ์ƒ์„ฑ๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ,
์ฐฝํ™˜๊ณผ ๋‚˜๋Š” (์•„๋งˆ) feature ์•ˆ์— ๋“ค์–ด๊ฐ€๋Š” module๋งŒ ์ƒ์„ฑํ•˜๊ฒŒ ๋  ์˜ˆ์ •์ž„


image


  1. ์ขŒ์ธก project ํƒญ์—์„œ new > Module ์„ ํƒ
  2. ์ขŒ์ธก์—์„œ Android Library ์„ ํƒ
  3. Java or Kotlin Library -> domain ๋ชจ๋“ˆ ๊ฐ™์€๊ฑฐ
  4. res ํŒŒ์ผ์ด ๋งŒ๋“ค์–ด์ง€์ง€ ์•Š์•˜๋‹ค๋ฉด ๋‹นํ™ฉํ•˜์ง€ ์•Š๊ณ  activity ๋งŒ๋“ค๊ธฐ
  5. (๊ถŒ์žฅ) 3๋ฒˆ์—์„œ activity๋ฅผ ๋งŒ๋“ค๋ฉด, ํ•ด๋‹น ๋ชจ๋“ˆ์˜ Manifest์— application ํƒœ๊ทธ์™€ ํ•จ๊ป˜ activity ํƒœ๊ทธ๊ฐ€ ์ƒ์„ฑ๋จ. Activity ํƒœ๊ทธ๋ฅผ app ๋ชจ๋“ˆ์˜ menifest๋กœ ์ด๋™.
  6. Build(:app)์˜ dependencies ์— ์ถ”๊ฐ€ํ•œ ๋ชจ๋“ˆ implementation ํ•ด์คŒ
  7. settings.gradle์€ ์ž๋™์œผ๋กœ ์ฒ˜๋ฆฌ๋œ๋‹ค
  8. ํ•„์š”ํ•œ ๋ชจ๋“ˆ์žˆ์œผ๋ฉด ๋‚ด๊ฐ€ ๋งŒ๋“  module implementation(project(":resource")) ๊ฐ™์ด ์ถ”๊ฐ€

image



๐Ÿ“Œ ๋ชจ๋“ˆ์—์„œ ๋งŒ๋“  Activity๋ฅผ Edit Configuration - Specified Activity๋กœ ์ง€์ •ํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ

โ€‹ โžก App ๋ชจ๋“ˆ์— ์žˆ๋Š” AndroidMenifest.xml ์— ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋จ

๐Ÿ“Œ Firebase Service ๊ฐ์ฒด๋Š” App ๋ชจ๋“ˆ์—์„œ ์ •์˜ํ•œ๋‹ค

๐Ÿ“Œ ๋„๋ฉ”์ธ๋ชจ๋“ˆ์€ java-library ์•„๋ž˜์— ์žˆ์–ด์„œ common.gradel์ด ์˜ํ–ฅ์ด ์•ˆ๋ฏธ์นจ

image

Clone this wiki locally