Skip to content

Instantly share code, notes, and snippets.

@BoxResin
Last active October 13, 2019 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BoxResin/c3fd99a5d822ecd246d2096aec4ac9a1 to your computer and use it in GitHub Desktop.
Save BoxResin/c3fd99a5d822ecd246d2096aec4ac9a1 to your computer and use it in GitHub Desktop.
Android Startup Non-Stable
<!-- 메인 액티비티 레이아웃 -->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
tools:context = ".MainActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- 안드로이드 매니페스트 -->
<manifest
package = "boxresin.app.barcodescanner"
xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools">
<application
android:allowBackup = "false"
android:icon = "@mipmap/ic_launcher"
android:label = "@string/app_name"
android:roundIcon = "@mipmap/ic_launcher_round"
android:supportsRtl = "false"
android:theme = "@style/AppTheme"
tools:ignore = "GoogleAppIndexingWarning">
<!-- 메인 액티비티 -->
<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>
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
// 안드로이드 설정
android {
compileSdkVersion 28
defaultConfig {
applicationId 'boxresin.app.barcodescanner'
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName '1.0.0'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
}
buildTypes {
// 디버그 APK 옵션
debug {
applicationIdSuffix '.debug'
}
// 릴리즈 APK 옵션
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
// 의존성
dependencies {
// 로컬 JAR
implementation fileTree(dir: 'libs', include: ['*.jar'])
// 코틀린
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// AndroidX
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
// Android KTX
implementation 'androidx.core:core-ktx:1.0.0'
// 테스트
testImplementation 'junit:junit:4.12'
// 안드로이드 테스트
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02'
}
# 빌드 파일
build/
buildscript {
ext.kotlin_version = '1.3.11'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha13'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
<!-- 색상 리소스 -->
<resources>
<!-- 앱 색상 -->
<color name = "colorPrimary">#008577</color>
<color name = "colorPrimaryDark">#00574B</color>
<color name = "colorAccent">#D81B60</color>
</resources>
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
package boxresin.app.barcodescanner
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
/** 메인 액티비티 */
class MainActivity : AppCompatActivity()
{
/** 메인 액티비티가 생성될 때 호출된다. */
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
# 빌드 파일
build/
# 프로젝트 설정 파일
.idea/
*.iml
local.properties
# Gradle 바이너리 파일
.gradle/
# OS 관련 파일
.DS_Store
Thumbs.db
<!-- 문자열 리소스 -->
<resources>
<!-- 앱 이름 -->
<string name = "app_name">바코드 스캐너</string>
</resources>
<!-- 스타일 리소스 -->
<resources>
<!-- 앱 테마 -->
<style name = "AppTheme" parent = "Theme.AppCompat.Light.NoActionBar">
<item name = "colorPrimary">@color/colorPrimary</item>
<item name = "colorPrimaryDark">@color/colorPrimaryDark</item>
<item name = "colorAccent">@color/colorAccent</item>
</style>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment