Framework
- 안드로이드 스튜디오
- 개발을 하기위해 지켜야하는 틀
Library (외부의 도움)
- 개발을 하기 위해 필요한 도구들이 미리 구현되어 있는 것
- 함수나, 클래스로 구현이 되어있다.
- 프레임워크에 없다.
특징
프레임워크에서 하기 힘든 것들을 쉽게 사용할 수 있도록 만들어 놨다!
프레임워크에서 제공 하지 않는 기능을 사용할 수 있도록 만들어 놨다!
Glide
Glide 라이브러리. 깃허브주소. 구글에 glide 검색.
https://github.com/bumptech/glide
bumptech/glide
An image loading and caching library for Android focused on smooth scrolling - bumptech/glide
github.com
build.gradle에서 수정 추가 하고 sync now 클릭.
allprojects {
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
}
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LibraryActivity">
<ImageView
android:id="@+id/glide"
android:layout_width="300dp"
android:layout_height="300dp"
/>
<ImageView
android:id="@+id/glide2"
android:layout_width="300dp"
android:layout_height="300dp"
/>
</LinearLayout>
activity
package com.example.myapplication
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_library.*
class LibraryActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_library)
Glide.with(this@LibraryActivity)
.load("https://images.kbench.com/kbench/article/2018_03/k186172p1n1-s.jpg")
.centerCrop()
.into(glide)
Glide.with(this@LibraryActivity)
.load("https://images.kbench.com/kbench/article/2018_03/k186172p1n1-s.jpg")
.fitCenter()
.into(glide2)
}
}
처음시작하는 분들중 missing INTERNET permisson?오류가 뜰것이다.
이유는 앱에 인터넷 활용을 동의 해줘야 하기때문이다.
매니페스트xml에 가서 application 위에 다음과 같은 코드를 추가한다.
<uses-permission android:name="android.permission.INTERNET" />
'Before > Android' 카테고리의 다른 글
Tablayout, Pager (0) | 2020.03.16 |
---|---|
RecyclerView (0) | 2020.03.13 |
Context , Thread (0) | 2020.03.12 |
Android UI (0) | 2020.03.11 |
Resource (0) | 2020.03.11 |
Framework
- 안드로이드 스튜디오
- 개발을 하기위해 지켜야하는 틀
Library (외부의 도움)
- 개발을 하기 위해 필요한 도구들이 미리 구현되어 있는 것
- 함수나, 클래스로 구현이 되어있다.
- 프레임워크에 없다.
특징
프레임워크에서 하기 힘든 것들을 쉽게 사용할 수 있도록 만들어 놨다!
프레임워크에서 제공 하지 않는 기능을 사용할 수 있도록 만들어 놨다!
Glide
Glide 라이브러리. 깃허브주소. 구글에 glide 검색.
https://github.com/bumptech/glide
bumptech/glide
An image loading and caching library for Android focused on smooth scrolling - bumptech/glide
github.com
build.gradle에서 수정 추가 하고 sync now 클릭.
allprojects {
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
}
}
dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}
xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LibraryActivity">
<ImageView
android:id="@+id/glide"
android:layout_width="300dp"
android:layout_height="300dp"
/>
<ImageView
android:id="@+id/glide2"
android:layout_width="300dp"
android:layout_height="300dp"
/>
</LinearLayout>
activity
package com.example.myapplication
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.activity_library.*
class LibraryActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_library)
Glide.with(this@LibraryActivity)
.load("https://images.kbench.com/kbench/article/2018_03/k186172p1n1-s.jpg")
.centerCrop()
.into(glide)
Glide.with(this@LibraryActivity)
.load("https://images.kbench.com/kbench/article/2018_03/k186172p1n1-s.jpg")
.fitCenter()
.into(glide2)
}
}
처음시작하는 분들중 missing INTERNET permisson?오류가 뜰것이다.
이유는 앱에 인터넷 활용을 동의 해줘야 하기때문이다.
매니페스트xml에 가서 application 위에 다음과 같은 코드를 추가한다.
<uses-permission android:name="android.permission.INTERNET" />
'Before > Android' 카테고리의 다른 글
Tablayout, Pager (0) | 2020.03.16 |
---|---|
RecyclerView (0) | 2020.03.13 |
Context , Thread (0) | 2020.03.12 |
Android UI (0) | 2020.03.11 |
Resource (0) | 2020.03.11 |