✍2021,2022/app(android studio)

앱만들기 4 (패키지구조)

리촬리 2021. 7. 6. 15:06
728x90

추후 추가 공부 후 세부 작성예정


 

패키지 구조에 대한 설명

 

manifest파일 더블클릭

-> AndroidManifest.xml

 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.intentexample">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.IntentExample">
        <activity android:name=".SubActivity"></activity>
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

 

android:icon="@mipmap/ic_launcher" 

 

ctrl+클릭 해보면 png뜸.

들어가보면 우리가 설정한 기본 아이콘이보임

 

저렇게 경로를쓰면 앱 아이콘이  변경되는걸 확인할 수 있음.

android:label="@string/app_name"

ctrl+클릭

<resources>
<string name="app_name">Example</string>
</resources>

원하는 앱 이름 빌드 가능

 

android:roundIcon="@mipmap/ic_launcher_round"

icon과 비슷한개념인데, round는 둥글게 해준다는것 

 

android:theme="@style/Theme.IntentExample"

style태그에서 저 이름으로 명명이 되어있음

컨트롤 +클릭 하게되면 테마 3색깔이 들어가게 되어있음

근데..난 3색이아니라 화려한데..?

(아 내가 설정해놨었음 색깔지정하느라고)

((<item name="colorPrimary">@color/purple_500</item> #난 이렇게 써있는데, 강의에서는))

 

<item name="colorPrimary">@color/colorPrimary</item>

 앱의 심볼 컬러들을 선언하는 구문

 

MainActivity extends AppCompatActivity

액티비티를 익스턴즈 하는것들을 선언할때는 항상 manifest를 와서 activity를 선언해줘야함.

 

 

너ㅓㅓㅓ무졸려..

<action android:name="android.intent.action.MAIN" />
이 엑티비티가 메인이다.
<category android:name="android.intent.category.LAUNCHER" />

LAUNCHER는 앱을 실행시킬때, 처음으로 시작된 액티비티가 어딘지

지정

주로 액티비티나 필요로 하는 컴퓨터 구현가능

 

 

<res>는 리소스폴더 (리소스가 모여있음)

 

drawble은 이미지를 모아둔 폴더

layout은 레이아웃을 모아둔 폴더

mimap

- 기본제공하는 ic_launcher.png

- 앱 아이콘이 모여있다고 생각하면됨

 

dpi는 안드로이드에서의 해상도를 나타내는 단위

 

dpi에 맞춰서 이미지를 분류해야 해상도 대응이 완벽하게 이루어져서 

레이아웃 벗어나지않고 유지

 

 

values폴더에서는

1. colors.xml

컬러설정

2. strings.xml

앱 이름변경가능

app_name이라는 아이디 보유

3. theme

테마들이 모여있는 폴더

 

 

728x90