728x90
2021.08.12 - [๊ฐ๋ฐ/์๋๋ก์ด๋] - [์๋๋ก์ด๋] AAR(Android Archive) ๋ง๋ค๊ธฐ ... 1
์ด์ ์ฅ์์ ์ด์ด์ ๊ณ์...
1. ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ ์ ํ๋ก์ ํธ๋ฅผ ์์ฑ
2. setting.gradle์ ์ด์ ์ฅ์์ ์์ฑํ ๋ชจ๋์ ์ถ๊ฐ
๊ธฐ์กด setting.gradle (AARTest)
rootProject.name = "AARTest"
include ':app'
์์ ํ setting.gradle (AARTest)
rootProject.name = "AARTest"
include ':app', ':aarlib'
project(':aarlib').projectDir = new File("D:/AARLib")
3. build.gradle (:app) ์ dependencies ์ implementation project(":aarlib") ์ถ๊ฐ
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.devshin93.aartest"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// ์ฌ๊ธฐ!
implementation project(":aarlib")
}
4. Sync Now ํด๋ฆญ!
์ด๋ ๊ฒ aarlib ๋ชจ๋์ด ์ถ๊ฐ ๋๋ค. →
5. ํ ์คํธ
MainActivity.java ์์ ๋ชจ๋์ ์๋ Calculate ํด๋์ค์ add ๋ฉ์๋๋ฅผ ํธ์ถ
package com.devshin93.aartest;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.devshin93.aarlib.Calculate;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Calculate calculate = new Calculate();
System.out.println( calculate.add(1, 2) );
}
}
'๐ ๊ฐ๋ฐ > ์๋๋ก์ด๋' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์๋๋ก์ด๋] java.net.SocketException: socket failed: EACCES (Permission denied) (0) | 2021.09.14 |
---|---|
[์๋๋ก์ด๋] AsyncTask ์ HttpURLConnection ...(1) Android Sample Code (2) | 2021.08.26 |
[์๋๋ก์ด๋] AAR(Android Archive) ๋ง๋ค๊ธฐ ... 1 (0) | 2021.08.12 |
[์๋๋ก์ด๋] Java to Kotlin, Kotlin to Java (0) | 2021.07.30 |
[์๋๋ก์ด๋] apk ํ์ผ ๋ฆฌํจํค์ง ๋ฐฉ๋ฒ (0) | 2021.07.29 |
๋๊ธ