갤러리 앱 연동하기
- 갤러리 앱에서 이미지를 사용할 때 고려해야할 사항
- 안드로이드에서 이미지는 Drawable(주로 리소스 이미지), Bitmap 객체로 표현한다.
- Bitmap 객체는 BitmapFactory로 생성한다.
- BitmapFactory로 이미지를 생성할 때는 OOM 을 고려해야한다.
- Glide 나 Picasso 같은 이미지 처리 라이브러리를 사용하는 것이 효율적일 수 있다.
- 이미지를 그대로 가져올 때 ( OOM 오류가 발생할 수 있다.)
val bitmap = BitmapFactory.decodeStream(inputStream)
val option = BitmapFactory.Options()
option.inSampleSize = 4
val bitmap = BitmapFactory.decodeStream(inputStream, null, option)
지도 앱 연동하기
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("geo:37.5662952, 126.9779451"))
startActivity(intent)
전화 앱 연동하기
<uses-permission android:name="android.permission.CALL_PHONE"/>
val intent = Intent(Intent.ACTION_CALL, Uri.parse("tel:02-120"))
startActivity(intent)
- Uri.parse() 의 tel: 뒤에 전화번호를 입력하면 자동으로 해당 전화번호로 전화를 건다.