Google for Mobile I/O RECAP 2018 (09)

09. AI & Cloud. 모바일 개발자를 위한 TensorFlow Lite 소개

  • 발표자 : Kaz Sato (Staff Developer Advocate, Cloud Platform, Google)
  • 세션설명 : TensorFlow Lite는 모바일과 임베디드 디바이스에 최적화된 머신러닝 프레임워크로, 낮은 지연시간과 작은 바이너리 크기로 디바이스 상에서의 머신러닝 추론이 가능하며 안드로이드 신경망 API를 사용한 하드웨어 가속화도 지원합니다. TensorFlow Lite를 통해 최신 AI 기술을 모바일에 적용하는 법을 알아보세요.

TensorFlow

참고 : https://www.tensorflow.org/get_started/

AI, ML, Neural Networks

최근의 AI 서비스는 모바일에서 1차 가공된 데이터를 추출해 서버에 보내 처리함.

모바일에서 이미지 처리시 클라이언트에서 이미지 라벨을 서버로 보내 처리함. 모션 캡쳐의 경우도.

TensorFlow는 Open Source S/W임.

모바일에서도 모델 학습이 가능하나 느려서 GPU가 필요함.

TensorFlow 모델을 모바일에서 사용 가능함.

모바일에서 Machine Learning 의 문제 : Memory, CPU Power, Battery 등

모바일에서 TensorFlow 사용시 처리

  • Freeze Graph : 변수를 상수화
  • Quantization : 32bit float -> 8bit int
  • Compression the Binary with Selective Registration : 12MB -> 1.5MB (for Inception v3)

TensorFlow Lite

참고 : https://www.tensorflow.org/mobile/tflite/

TensorFlow Lite의 빠르고 작은 설계

TensorFlow Lite의 core interpreter는 75KB 크기임. (TensorFlow의 경우 1.1MB)

TensorFlow Lite & ML Kit

참고 : https://developers.google.com/ml-kit/

ML Kit의 Base API 사용이 편함.

use case에 따라 custom models 사용함. (TensorFlow Lite)

TensorFlow Lite Development Flow

참고 : https://www.tensorflow.org/versions/master/mobile/tflite/devguide

Get a model -> Convert -> write ops -> write app

한계점으로는 추론 연산에만 집중되는 문제와 현재 inference 제한있음. (최대 50개의 operators 제공)

적용 사례

참고 :

https://developers-kr.googleblog.com/2017/12/on-device-conversational-modeling-with-tensorflow-lite.htmlhttps://developers-kr.googleblog.com/2017/10/how-machine-learning-with-tensorflow-enabled-mobile-proof-of-purchase-at-coca-cola.html?refer=gaerae.com

Google Assistant, Android Wear의 Smart Reply 기능에 적용. 코카콜라 앱 병뚜껑 번호 인식에도 적용됨.

TensorFlow Lite는 이미 Production App에 적용되고 있음.

Q&A

Q : TensorFlow Lite가 PC에서도 되나?

A : 리눅스라면 됨. Android IOT나 라즈베리파이도 됨.

Google for Mobile I/O RECAP 2018 (08)

08. AI & Cloud. Dialogflow와 ML API를 활용한 챗봇 개발

  • 발표자 : 정명훈 (Customer Engineer, Google Cloud)
  • 세션설명 : 빠르고 효율적으로 구축이 가능하면서도 똑똑한 챗봇을 개발하고 싶다면 꼭 주목해야 할 기술, Dialogflow를 소개합니다! Dialogflow의 강력하고 손쉬운 기능과 머신러닝 API를 사용하여 매력적인 챗봇을 개발하는 방법을 알아보세요.

메신저 사용률이 SNS를 추월함.

참고 : http://www.kinews.net/news/articleView.html?idxno=71223

스마트 디바이스 증가와 대기업들의 참여도 증가로 챗봇 급성장.

참고 : http://gobooki.net/archives/1324

주요 사용 사례 :

  • Customer support
  • Transactions
  • Getting things done

영단어 암기 프로그램

구성 : Chatbot + ML API + Google Assistant

Dialogflow

참고 : https://dialogflow.com/docs/getting-started

Dialogflow에 Topic에 대한 샘플 문장들 입력

규칙기반은 규칙에 대한 모든 정보 입력 필요. (사실상 불가능)

머신러닝 신경망에서 시맨틱 구문 분석으로 학습할 경우 규칙기반 대비 40% 정도 정확도 높음.

Google ML API

참고 : https://cloud.google.com/products/machine-learning/

ML on Google Cloud

  • Translate API : 데이터가 많아 성능이 높음.
  • Natural Language API : 자연어 처리
  • Speech API : 음성인식, 구문힌트나 인식모드로 정확도 향상
  • Vision API : 사진분석, 텍스트 인식
  • Video Intelligence API : 비디오 분석 기술

Q&A

시간 관계상 생략

Google for Mobile I/O RECAP 2018 (07)

07. Developer. Kotlin으로 코딩 시작하기

  • 발표자 : Hadi Hariri (VP of Developer Advocacy, Jetbrains)
  • 세션설명 : 한 번도 사용해보지 않은 개발자는 있어도, 한 번만 사용해 본 개발자는 없다! 사용해본 개발자의 95%가 높은 만족도를 보였다는 Kotlin! 작년 안드로이드 공식 언어로 채택된 이후 매년 빠르게 성장하고 있는 Kotlin을 시작해보세요. Google I/O에서 Kotlin을 발표했던 Jetbrain의 Hadi Hariri가 한국 개발자를 위해 직접 소개합니다.

코틀린 지식이 없는 상태에서 단편적인 키워드들로 정리한 세션이라 샘플코드 등 임의로 넣은 부분이 많습니다.

Kotlin 시작시 Android Studio의 Java to Kotlin 메뉴에 의존하지 말 것.

Property & Field

Kotlin은 필드는 없고 프로퍼티만 사용함.

참고 : https://kotlinlang.org/docs/reference/properties.html#backing-fields

Fields cannot be declared directly in Kotlin classes.

  • field: A data member of a class. Unless specified otherwise, a field is not static. - 클래스의 데이터 멤버. 특별히 언급되지 않았다면 field는 정적이지 않다.
  • property: Characteristics of an object that users can set, such as the color of a window - 윈도우의 색과 같이, 사용자가 설정할 수 있는 객체의 특성

Delegated Properties

참고 : https://kotlinlang.org/docs/reference/delegated-properties.html

  • lazy properties : 첫 번째 액세스시에만 값이 계산되어 저장됨.

    val lazyValue: String by lazy {
        println("computed!")
        "Hello"
    }
    
    fun main(args: Array<String>) {
        println(lazyValue)
        println(lazyValue)
    }
    This example prints:
    
    computed!
    Hello
    Hello
  • observable properties : 리스너는 속성 변경에 대해 알림을 받음.

    import kotlin.properties.Delegates
    
    class User {
        var name: String by Delegates.observable("<no name>") {
            prop, old, new ->
            println("$old -> $new")
        }
    }
    
    fun main(args: Array<String>) {
        val user = User()
        user.name = "first"
        user.name = "second"
    }
    This example prints:
    
    <no name> -> first
    first -> second
  • 맵에 여러 필드를 대신해 프로퍼티를 저장함.

    class User(val map: Map<String, Any?>) {
        val name: String by map
        val age: Int     by map
    }
    ...
    val user = User(mapOf(
        "name" to "John Doe",
        "age"  to 25
    ))
    ...
    println(user.name) // Prints "John Doe"
    println(user.age)  // Prints 25

Standard Library (Built-in)

lazy, vetoable 등 제공함.

funtion expression

참고 : https://kotlinlang.org/docs/reference/basic-syntax.html#defining-functions

// basic
fun sum(a: Int, b: Int): Int {
    return a + b
}

// expression
fun sum(a: Int, b: Int) = a + b

when expression

참고 : https://kotlinlang.org/docs/reference/basic-syntax.html#using-when-expression

https://kotlinlang.org/docs/reference/control-flow.html#when-expression

fun describe(obj: Any): String =
when (obj) {
    1          -> "One"
    "Hello"    -> "Greeting"
    is Long    -> "Long"
    !is String -> "Not a string"
    else       -> "Unknown"
}

exception expression

참고 : https://kotlinlang.org/docs/reference/exceptions.html

// basic
try {
    // some code
}
catch (e: SomeException) {
    // handler
}
finally {
    // optional finally block
}

// expression
val a: Int? = try { parseInt(input) } catch (e: NumberFormatException) { null }

Elvis operator

참고 : https://kotlinlang.org/docs/reference/null-safety.html

// basic
val l: Int = if (b != null) b.length else -1

// Elvis operator
val l = b?.length ?: -1

// Elvis operator (Exception)
val name = node.getName() ?: throw IllegalArgumentException("name expected")

Collections

sortWith

참고 : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sort-with.html?q=sortwithc&p=0

data class Product(val name: String, val price: Double /*USD*/)
...
fun main(args : Array<String>){
	val products = arrayOf(Product("iPhone 8 Plus 64G", 850.00),
							Product("iPhone 8 Plus 256G", 1100.00),
							Product("Apple iPod touch 16GB", 246.00),
							Product("Apple iPod Nano 16GB", 234.75),
							Product("iPad Pro 9.7-inch 32 GB", 474.98),
							Product("iPad Pro 9.7-inch 128G", 574.99),
							Product("Apple 42mm Smart Watch", 284.93))
		
	products.sortWith(object: Comparator<Product>{
								override fun compare(p1: Product, p2: Product): Int = when {
													p1.price > p2.price -> 1
													p1.price == p2.price -> 0
													else -> -1
												}
					  })
}

map

참고 : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/map.html

var strCustList = customerList.map { it -> if(it!=null) "${it.name} lives at street ${it.address.street}" else null }
strCustList.forEach{println(it)}

mapNotNull

참고 : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/map-not-null.html

publicp  inline fun <T, R : Any> Iterable<T>.mapNotNull(transform: (T) -> R?): List<R>

Null declare (?) 하지 말 것.

참고 : https://kotlinlang.org/docs/reference/basic-syntax.html#using-nullable-values-and-checking-for-null

Java를 위해서 만들어진 것.

In Kotlin, the type system distinguishes between references that can hold null (nullable references) and those that can not (non-null references). For example, a regular variable of type String can not hold null:

https://kotlinlang.org/docs/reference/null-safety.html

To perform a certain operation only for non-null values, you can use the safe call operator together with let:

If you have a collection of elements of a nullable type and want to filter non-null elements, you can do so by using filterNotNull:

Semicolons

참고 : http://kotlinlang.org/docs/reference/grammar.html#semicolons

Kotlin provides "semicolon inference": syntactically, subsentences (e.g., statements, declarations etc) are separated by the pseudo-token SEMI, which stands for "semicolon or newline". In most cases, there's no need for semicolons in Kotlin code.

Inline Functions

참고 : https://kotlinlang.org/docs/reference/inline-functions.html

https://blog.uzuki.live/advanced-kotlin-inline-functions-1-basic/

https://blog.uzuki.live/inline-functions-2-local-return/

고차 함수(higher-order functions) 사용시 특정 런타임에서 패널티가 부과되며, 메모리 할당과 가상 호출은 런타임 오버헤드를 초래한다고 함.

이런 종류의 오버헤드는 람다 식을 inlining 함으로써 제거될 수 있음.

람다 사용시에만 inline 사용이 가능하며 퍼포먼스 개선이 가능하다.

Local Return 문에도 사용됨.

Functional Programming

return 타입을 명시해야 함.

fun Division(a: Int, b: Int): Int {
    return DivisionVaild(result)
    //return DivisionInvaild(result)
}

fun DivisionVaild(val result: Int)
fun DivisionInvaild(val result: String)

Sealed Classes

참고 : https://kotlinlang.org/docs/reference/sealed-classes.html

Sealed Class와 서브클래스는 같은 파일에 선언되어야 함.

Sealed Class는 abstract Class임. 직접 인스턴스화 할수 없고 abstract 멤버는 가질수 있음.

non-private constructors를 가지면 안됨.

주로 when 표현식에서 유용함.

sealed class Expr {
    data class Const(val number: Double) : Expr()
    data class Sum(val e1: Expr, val e2: Expr) : Expr()
	object NotANumber : Expr()
}
fun eval(expr: Expr): Double = when(expr) {
    is Const -> expr.number
    is Sum -> eval(expr.e1) + eval(expr.e2)
    NotANumber -> Double.NaN
    // the `else` clause is not required because we've covered all the cases
}

Q&A

시간 관계상 생략

Google for Mobile I/O RECAP 2018 (06)

06. Developer. 빠르고 세련된 Android 개발 - Android Jetpack & Android Studio

  • 발표자 : 김태호 (Mobile Apps Technical Specialist, Online Partnership Group, Google)

  • 세션설명 : 견고하고 현대적인 안드로이드 애플리케이션을 만드려면 어떻게 해야할까요? 세련되고 빠른 Android 앱을 만들기 위한 컴포넌트, 도구 및 지침들을 담고 있는 Android Jetpack과 Android Studio를 소개합니다.

Android Studio

Layout Inspector

참고 : https://developer.android.com/studio/debug/layout-inspector?hl=ko

Profile

참고 :

​ CPU : https://developer.android.com/studio/profile/cpu-profiler?hl=ko

​ Memory : https://developer.android.com/studio/profile/memory-profiler?hl=ko

​ Network : https://developer.android.com/studio/profile/network-profiler?hl=ko

Runtime

  • Dalvik : 앱 Size가 중요하고, Heap Fragment 등의 이슈가 있음.
  • ART : Performance 에 최적화

Language

Java, Kotlin 사용하며, 부분적인 Kotlin 개발이 가능함. Kotlin Lint 체크 지원.

Library & API

  • AbsoluteLayout : 사용하지 말 것. 강조. 또 강조. 또 또 강조.
  • LinearLayout : 간단한 경우 사용.
  • FameLayout : 역시 간단히 사용.
  • GridLayout : 권장하지 않음.
  • RelativeLayout : 사용에 대한 비용이 비쌈.
  • ConstraintLayout : 권장하며 2.0 버전 나올 예정.

AdapterView

기존 ListView, GridView는 뷰홀더 패턴 직접 작성 등 처리 복잡하고 어려움.

RecyclerView가 다양한 레이아웃을 제공하며 사용하기 좋음.

Fragment

참고 : https://developer.android.com/reference/android/app/Fragment

This class was deprecated in API level 28. Use the Support Library Fragment for consistent behavior across all devices and access to Lifecycle.

Support Library에 있는 Fragment 사용 권장

  • android.app.Fragment
  • android.support.v4.app.Fragment (권장)

Activities

가능하다면 싱글 액티비티 권장

Architecture

참고 : https://developer.android.com/topic/libraries/architecture/

기존에는 권장하는 부분이 없었음. 현재는 AAC(Android Architecture Components) 로 가이드 제공함.(필수는 아님)

Life Cycle

참고 : https://developer.android.com/topic/libraries/architecture/lifecycle

Callback 처리 등으로 액티비티나 프래그먼트가 heavy 해짐. AAC 에서 액티비티와 독립적으로 Life Cycle을 제공함.

Views and Data

참고 : https://developer.android.com/topic/libraries/architecture/viewmodel

ViewModel이 처리하며, 인스턴스만 Activity에서 관리

Data

참고 : https://developer.android.com/topic/libraries/architecture/room

Room 등에서 지원함.

Android Jetpack

참고 :

https://developer.android.com/jetpack/

https://android-developers.googleblog.com/2018/05/use-android-jetpack-to-accelerate-your.html

Guidance

Android X

참고 :

https://developer.android.com/topic/libraries/support-library/refactor

https://android-developers.googleblog.com/2018/05/hello-world-androidx.html

기존 Support Library (android.support.*)와 AAC(android.arch.*)를 AndroidX(androidx.*)로 패키지명 교체.

버전은 1.0.0으로 리셋되며 -v4, -v7 같은 네이밍 제거됨.

OldNew
android.support.**androidx.@
android.databinding.**androidx.databinding.@
android.design.**com.google.android.material.@
android.support.test.**(in a future release) androidx.test.@
android.arch.**androidx.@
android.arch.persistence.room.**androidx.room.@
android.arch.persistence.**androidx.sqlite.@

Migration to Android X

Android Studio Canary 14 버전으로 Refactor 메뉴의 Refactor to AndroidX... 메뉴로 실행

그 외

Q&A

시간 관계상 생략

Google for Mobile I/O RECAP 2018 (05)

05. Developer. 새로운 모듈 Android App Bundle로 앱 개발하기

  • 발표자 :

    Phil Adams (Senior UX Researcher) Tom Dobek (Software Engineer, Google)

  • 세션설명 : Android App Bundle은 크기가 작은 앱으로도 우수한 사용 환경을 간편하게 제공할 수 있도록 도와주는 새로운 앱 모델입니다. 앱 크기를 대폭 줄이고 Dynamic Delivery를 통해 유저들이 앱을 더 빠르게 다운로드할 수 있도록 하는 방법을 소개합니다.

참고 : https://developer.android.com/guide/app-bundle/

https://medium.com/mindorks/android-app-bundle-aab-98de6dad8ba8

https://medium.com/mindorks/android-app-bundle-part-2-bundletool-6705b50bea4c

App Bundle이 가능하게 하는 2가지 기능

  • Dynamic delivery system
  • Modular App development

.aab 내부

  • AndroidManifest.xml가 apk에서는 바이너리 형식이지만 aab에서는 프로토콜 버퍼 형식.

  • aab는 내부에 dex 폴더가 따로 있음.

  • aab의 resources.pb는 apk의 resources.arac에 해당하는 파일로 역시 프로토콜 버퍼 형식.

  • resources table, assets table은 앱의 File Targeting을 설명함.

    예) assets/<name>#<key>_#<value>/...

Dynamic Delivery 의 기본 구성요소는 Split APK 매커니즘. (Android 5.0 Lollipop 이상)

Split APK는 일반 APK와 유사하지만 Android 플랫폼은 설치된 여러 개의 분리된 APK를 하나의 앱으로 취급할 수 있음.

App Bundle을 위한 Split 기능은 아래와 같이 사용 가능함.

Split APK의 종류

Base APK

모든 APK가 액세스할 수 있는 코드와 리소스 포함하여 앱의 기본기능 제공. 앱 다운로드시 설치되는 첫 번째 APK

Configuration APKs

각 APK에는 특정 화면 밀도, CPU 아키텍처, 언어에 대한 기본 라이브러리 및 리소스를 포함. 기기가 Base APK 또는 Dynamic feature APK 다운로드시 필요한 라이브러리와 리소스만 다운로드 됨.

Dynamic feature APKs

각 APK에는 앱 설치시 필요하지 않지만 나중에 다운로드하여 설치할 수 있는 코드와 리소스가 포함되어 있음.

Average Savings

App Bundle을 통해서 평균 20% 이상의 앱 용량을 절감함.

Publishing App Bundle

App Bundle을 만든 후 signing 하여 Google Play에 업로드.

App Bundle은 기기에 APK를 배포할 수 없는 대신 하나의 빌드 아티팩트에 모든 앱의 컴파일된 코드와 리소스를 포함하는 새로운 업로드 형태임.

signing된 App Bundle을 업로드하면 Google Play는 앱의 APK를 만들고 서명한 후 Dynamic Delivery를 통해 사용자에게 제공하는 데 필요한 모든 것을 제공함.

Publishing API에서도 App Bundle 지원함.

Internal Test Track을 사용하여 테스트.

bundletool

참고 : https://github.com/google/bundletool

App Bundle 을 로컬에서 테스트할 때 사용.

  • Android App Bundle 빌드
  • APK archive 생성
  • APK 추출
  • APK 설치
  • 장치 사양 추출

SplitInstallManager

참고 : https://developer.android.com/guide/app-bundle/playcore

Q&A

Q : 사용자가 설치 후 언어 변경시 앱을 재설치해야 하나?

A : Split App만 설치하면 됨.

Q : assets 타켓팅시 불필요한 파일 포함되는데 개선 여부는?

A : 타켓팅을 상세히 해서 하면 됨.

Q : 앱 수정시 앱 번들 모두 업데이트해야 하나?

A : 그렇다.

Q : 베이스 외 모듈 배포 가능하나?

A : On Demand 버전은 따로 배포가 안됨.

Q : 앱번들을 위한 최소 버전은?

A : Pre L도 지원함으로 따로 최소 버전은 없음.

Q : 모듈화에 대해 자세한 설명이나 사례는?

A : 게임에서 레벨에 따라 별도 다운로드 제공.

Q : 앱 번들 기기 지원 관련 이슈는?

A : 현재는 없음.



Google for Mobile I/O RECAP 2018 (04)

04. Developer. Android P 최신 기능 소개

  • 발표자 : 양찬석 (Developer Advocate, Google)
  • 세션설명 : 빠르고 간결하면서도 보안성이 강화된 Android P의 새롭고 중요한 기능과 개발자가 주의해야 하는 점을 소개합니다.

구글에서는 많은 서비스에 AI 접목하는 것을 고려 중임.

  • Adaptive Battery
  • Adaptive Action
  • Slices

Adaptive Battery

참고링크 : https://developer.android.com/preview/features/power

  • 기존 : Doze, Battery Saver 등
  • P : Background Restrictions, App Standby Buckets 등

App Standby Buckets

총 4가지로 분류

  • Active : App이 현재 사용 중.
  • Working set : 앱이 정기적으로 사용 중.
  • Frequent : 앱이 자주 사용하지만 매일은 아님.
  • Rare : 앱이 자주 사용되지 않음.

Rare 의 경우 제약이 생기며, FCM 같은 기능도 등급 조정이 가능함.

예를 들어 High Priority FCM 메시지도 하향 조정이 가능함.

Background Restrictions

유저가 Background Restrictions 기능 켤 경우 Android Vitals에서 Bad behavior로 판단된 앱은 백그라운드에서 처리 가능한 기능이 거의 없음.

심지어 foreground 서비스도 안됨.

Android Vitals가 중요하며, wake lock으로 자주 디바이스를 깨우는 경우 Bad behavior로 판단될 가능성 커짐.

참고 : https://developer.android.com/topic/performance/vitals/wakelock

App Actions

디바이스 내 딥링크로 생각하면 됨. 사용자 행동 학습 후 여러 서비스에서 제공함.

Google 검색 앱, Play Store, Google 어시스턴트, 런처 등의 구글 앱이나 시간대 별 폰 wake시 등.

구글은 사용자 니즈를 알 수가 있지만 그걸 할 수 있는 앱은 알 수가 없음.

그래서 앱에서 Built-in Intents를 사용해야 함. 이는 actions.xml에 정의해야 함.

(Built-in Intents는 향후 더 늘어날 예정)

참고 : https://developers.google.com/actions/reference/built-in-intents/

NameAction IDDescription
Get fortuneactions.intent.GET_FORTUNEGet your fortune from a fortune teller
Get horoscopeactions.intent.GET_HOROSCOPEGet a horoscope by date of birth or sign
Get jokeactions.intent.GET_JOKEGet a joke about a topic or from a creative work
Get a quotationactions.intent.GET_QUOTATIONGet a quotation from a particular author or creative work
Get credit scoreactions.intent.GET_CREDIT_SCOREGet credit score from a credit agency
Get cryptocurrency pricesactions.intent.GET_CRYPTOCURRENCY_PRICEGet prices for a particular cryptocurrency
Play gameactions.intent.PLAY_GAMEPlay a game.
Check watersports conditionsactions.intent.CHECK_WATERSPORTS_CONDITIONSCheck watersports conditions at a given location
Check air qualityactions.intent.CHECK_AIR_QUALITYCheck air quality at a place
Check water conditionsactions.intent.CHECK_WATER_CONDITIONSCheck water conditions at a time or place
Start calming activityactions.intent.START_CALMING_ACTIVITYHelp user engage in a calming, meditative activity

Slices

참고 : https://developer.android.com/guide/slices/getting-started

앱 일부를 앱 외에 다른 앱 등에서 사용.

위젯이 비슷하나 위젯은 자유도가 너무 높고 범용성이 떨어졌었음.

Slices는 템플릿을 제공함. (Notification 처럼 Builder 로 구현)

action와, toggle, slider 등 제공

support 라이브러리 형태로 지원함으로 하위지원 및 최신 패치 적용 가능함.

SliceProvider 생성해야 함.

App Actions와 연결성 있게 서비스 가능할 것으로 보임.

Notification

참고 : https://developer.android.com/preview/features?hl=ko#notifications

  • Messaging Style.

  • Image 지원함.

  • SmartReply 기능 지원.

  • Notification Blocking : 사용자가 빈번히 Notification을 dismiss할 경우 시스템에서 Blocking을 제안하게 됨. 이 경우 Notification Channel 단위로 처리되므로, 앱에서 Channel 관리가 필요할 것으로 보임.

Display Cutout

참고 : https://developer.android.com/preview/features?hl=ko#cutout

시장에 지원하는 디바이스가 늘어남으로 플랫폼 차원에서 지원하게 됨.

Status Bar 높이를 하드코딩한 경우 문제가 됨. (기존은 24dp로 알려져 있지만 Cutout의 경우 약 57dp? 정도임)

기존 AppBar는 자동으로 높이 조절하므로 상관이 없으나, 풀스크린 앱이 문제가 됨.

View.OnApplyWindowInsetsListener의 WindowInsets 로 Cutout 사이즈 확인이 가능함.

Private API

참고 : https://developer.android.com/preview/restrictions-non-sdk-interfaces

비 SDK 인터페이스를 참조하거나 리플렉션 또는 JNI를 사용하려할 경우 제한 사항 적용.

ETC - Google Play Target SDK Rules

참고 : https://developer.android.com/distribute/best-practices/develop/target-sdk

ETC - Android Emulator

참고 : https://androidstudio.googleblog.com/2018/04/emulator-2727-canary.html

속도개선됨.

ETC - Chrome OS용 Android Studio

참고 : https://developer.android.com/topic/arc/studio

Q&A

Q : App Actions의 앱 우선순위는 어떻게 결정되나? (사실 질문이 기억안남)

A : 앱 순위는 AI를 통해 사용자가 가장 사용할만한 앱을 제안하게 됨.

Google for Mobile I/O RECAP 2018 (03)

03. Keynote. 모바일 개발자를 위한 I/O 2018: Android의 새로운 기능 소개

  • 발표자 :

    Sean McQuillan (Developer Advocate Android, Google) Hadi Hariri (VP of Developer Advocacy, Jetbrains) Benjamin Frenkel (Product Manager, Google)

  • 발표자료 :

    Andrioid에서 개발자들은 무엇을 더 할 수 있을까요? 개발자에게 더욱 많은 것들을 가능하게 하는 Android 플랫폼의 새롭고 흥미진진한 최신 기능을 총정리해드립니다.

Android App Bundle

App Size를 줄이는 것은 중요함. (100 MB 이상의 앱의 설치율은 30% 정도 떨어짐)

Android App Bundle을 사용하여 동적 기능 모듈(dynamic feature modules)을 앱에 추가함.

Android Studio에서 개발자가 임의의 기기에 대해 앱에 필요한 모든 것, 즉 모든 언어, 모든 기기 화면 크기, 모든 하드웨어 아키텍처가 들어 있는 App Bundle 빌드

사용자가 해당 앱을 다운로드하는 시점에 Dynamic Delivery로 사용자의 기기와 일치하는 코드와 리소스만 전달

Kotlin

Most importantly, 95% of developers tell us they are very happy with using Kotlin for their Android development. And, the more developers use it, the more that number rises. The number of Play Store apps using Kotlin grew 6x in the last year. 35% of pro developers use it, and that number is growing each month.

https://android-developers.googleblog.com/2018/05/google-io-2018-whats-new-in-android.html

Kotlin 사용자 95%가 매우 만족한다는 응답을 했으며, 프로 개발자의 35%가 Kotlin을 사용 중이라고 함.

추가로 미국, 중국, 인도 순으로 Kotlin을 많이 사용 중임.

Kotlin 사용자 절반은 다른 언어에서 넘어왔으며, 중기업 이상 20% 이상은 Kotlin으로 전환하였다고 함.

Kotlin은 Mobile, Web Backend, PC 등 다양하게 사용되고 있음.

속도 개선, 지원 툴, 언어(coroutine), 멀티플랫폼(Kotlin JVM/JS/Native) 등으로 진행 중.

Innovative distribution

App Bundle

최근의 앱들은 글로벌 서비스 지원을 위한 언어팩이나 다양한 기능 지원으로 앱 사이즈가 커지고 있음.

하지만 앱 사이즈가 커질수록 앱 설치율은 떨어짐.

이에 App Bundle로 Dynamic Delivery 지원할 예정.

Google Play Instant

게임도 모두 지원하며, 게임의 경우 비교 분석에 적합함.

게임의 경우 미니게임, 튜토리얼보다 난이도 있는 체험, 경험 못한 레벨 체험 등을 지원할 수도 있음.

Google Play, SNS, 배너 등에서도 체험 가능함.

적용 사례로는 캔디크러시와 배틀로얄 등.

지원
  • 4MB 제한 -> 10MB 제한
  • 다운로드 프로그레시브 지원
  • 유니티 라이브러리 지원 (10MB 제한과 별도로)
  • 코코스 지원 예정
  • Record -> Refactor 메뉴로 지원

Develop Faster

Android Architecture Components

Android Jetpack (하위호환 가능, 95% 기기 지원)
  • Backwards compatibility
  • Less Boilerplate
  • 등등

Android Studio 3.2 Canary

Emulator 스냅샷 지원으로 구동속도 개선 등등

Increasing Engagement

Android Slices

앱의 일부 인터페이스만 안드로이드 인터페이스 어디에든 나타나게 함.

App Actions

Google 검색 앱, Play Store, Google 어시스턴트, 런처와 같은 여러 Google 및 Android 화면에서 사용 현황과 관련성을 기준으로 App Actions가 사용자에게 표시

actions.xml에 내용 추가하면 됨.

Q&A

Q : RPG 게임에도 Instant App이 도움이 될까?

A : Yes. 사전등록, 미니게임 또는 친구추가, 길드초대 등 유저 경험을 제공할 수 있음.

Q: 인디 게임도 Instant App이 도움이 될까?

A : Yes. 인디게임에 더 필요할 듯. 무료나 프리미엄 등 모든 게임 지원함.

Q : Kotlin 사용으로 얻을 수 있는 이득은?

A : boiler pate 코드가 안 생김. 약 40% 코드 줄어듬. 효율적이고 스마트하게 행복하게 일할 수 있음. 진짜임.

Q : 안드로이드 제트팩이 코틀린과 100% 호환 가능한가?

A : 완벽히 지원함.

Q : HTML 5 에도 Instant App 지원이 가능한가?

A : Instant App의 원래 취지는 네이티브 요소를 웹의 편리함으로 가져오자는 취지였음. 취지에는 안맞을 듯.



Google for Mobile I/O RECAP 2018 (02)

02. Keynote. Google I/O 2018 최신 기술 총정리

  • 발표자 : Tian Lim (VP of UX & Product for Play, Google)

  • 세션설명 :

    매년 5월, Google I/O에서는 세상을 깜짝 놀라게 하는 기술들이 발표됩니다. 한층 더 진화한 인공지능 Duplex부터 Google Lens까지, 올해 발표된 Google의 따끈따끈한 최신 기술을 한국의 개발자분을 위해 소개합니다.

AI for everyone

Digital Well-Being

AI

Useful more

구글 포토 등의 서비스에 다양한 AI 서비스 제공.

Adaptive Battery 기술 등에서도 AI가 사용됨.

Help innovation

ML Kit 등으로 서비스에 AI 기술 적용하도록 지원.

TPU 3.0 등 개발 진행으로 AI Cloud 서비스를 위한 부분도 진행 중.

Solution

AI로 의료정보 등을 제공하여 기존 의사들을 돕거나 사람보다 정확한 진단을 할 수도 있음.

Digital Well-being

Dash board

앱 사용 성향 등을 분석하여

App Timer

앱 사용 시간 등을 설정 후

Wind Down

시간이 다 되면 흑백화면 등으로 전환하여 사용자에게 알려줌

Standout well-being App

Google Play Award에 카테고리 추가



Google for Mobile I/O RECAP 2018 (01)

현장


전리품

기본 : 출입태그, 티셔츠, 텀블러 (얼리버드 이벤트로 못받음 ㅠㅠ), #IMakeApps 스티커

그리고 도시락


01. Keynote. 환영사

  • 발표자 : 민경환 (Head of Korea Android Apps and Games Business Development, Google)
  • 세션설명 :

환영함.

Google I/O Extended Seoul 2018

링크 : https://io-extended-seoul-18.firebaseapp.com/

일시 : 2018.06.10 11:00 ~ 17:25

장소 : 세종대학교 광개토관 컨벤션홀 (B2)

간단하게 들었던 섹션 정리입니다.

01. KeyNote

  • 발표자 : David MacLaunghim(Google/Global Programs Lead)
  • 발표자료 :

GDG 현황 및 활성화를 위한 노력?

번역 자막이나 동시 통역 없이 영어로 진행되서 내용은 잘 모름.

걍 들리거나 눈에 보이는 대로 정리하자면은...

구글에서도 Open Source의 중요성이 높아지고 Third-Party Storage 도 마찬가지

그리고 개발자 커뮤니티의 활성화를 장려한다는 듯

기존 GDG의 경우 Local / Tech / Special 로 주제를 가지고 진행한다고 함.

그리고 GDE(Google Developer Experts)도 있고 Women Techmakers도 있음.

GDG Korea 조은 님 추가

GDG Korea에서는 주로 Meet up을 이용하며, slack.gdg.kr로 GDG Korea의 정보를 얻을 수 있음.

  • Track A : Android / Design
  • Track B : Machine Learning
  • Track C : Flutter, Web

02. Track A. What's new in Android P

  • 발표자 : 전병권 (Riot Games)
  • 발표자료 :

Android P 이야기. Compiler 관련 D8/R8 변화. App Bundle 추가. Jetpack은 중요하므로 직접 봐야할 것.

Android P 릴리즈 일정

  • 현재 DP3 (API 28) 까지 나왔으며, API 추가는 이제 없음.

주요 기능

  • Battery

    App Stanby Buckets (사용빈도 대비 전력사용 고려하여 관리)

  • Background Limit

    Voice Recoding, Camera Capture, Sensor 등 제한됨.

  • Location : 구글 맵 실내측위 지원, Wi-Fi RTT 이용.

  • Accessibility : View 속성 추가

    • android:accessibilityPaneTitle
    • android:accessibilityHeading
    • android:screenReaderFocusable
  • Security : 시스템이 앱을 대신해 지문 인증 대화상자 제공 등

  • Display cut (notch) : 개발자 옵션 - Drawing 섹션 -> Simulate a display with a cutout 메뉴로 확인 가능.

  • Actions : deep links

  • Notifications

    • 이미지 지원
    • 단순화된 대화 참가자 지원 (Notification.Person 클래스)
    • 회신을 초안으로 저장
    • 그룹대화 여부 식별
    • 인텐트의 문맥적 액션 설정
    • SmartReply (제안 회신 지원)
    • 채널 그룹 차단
    • 알림 채널과 채널 그룹의 차단 상태 변경시 브로드캐스트 인텐트 보냄.
    • 새로운 알림 일시중지 우선순위 범주 추가
  • Deprecation Policy (targetApiVersion 등)

별첨

  • FLAG_ACTIVITY_NEW_TASK : 비 액티비티 컨텍스트에서 액티비티 시작시 인텐트 플래그에 전달해야 함.

Android P Runtime

  • Kotlin 지원 향상
  • Dex 구조 변경(dex 내 data 공유 형식으로)
  • Profile Guided Optimizations
    • Cloud Profiles 형식으로 개인 정보 제외하여 Play Store에 전달됨. 보통 15명 정보면 최적화됨.
  • 기존 1 : Start -> Javac/Kotlinc -> Proguard -> dex -> APK
  • 기존 2 : Start -> Javac/Kotlinc -> Proguard -> class별 dex -> dex merge -> APK
  • D8 : Start -> Javac/Kotlinc -> Proguard -> D8(gradle 3.2부터 지원) -> APK
  • R8(개발 중) : Start -> Javac/Kotlinc -> R8 -> APK

Android App Bundle

기존 Multiple APK에 대한 지원으로 하나의 APK로 생성됨

Android Studio 의 Build Bundles/APK 메뉴에서 사용 가능 (결과물은 aab 확장자 형식)

앱 모듈 부분 설치 등 가능(Instant App 같이 처리 가능)

Jetpack (직접 확인 필요)


03. Track A. 새로운 안드로이드 개발 툴

  • 발표자 : 정승욱 (Grab)
  • 발표자료 :

Android Studio 3.2 Canary 이야기 + Jetpack 이야기. Navigation, Work Manager 사용 이야기.

Android Studio 3.2 Canary

  • Navigation (단일 액티비티, 다중 프래그먼트 지원)
  • Android X Refactoring 지원
    • Android Support Library 를 Android extension library (AndroidX) 네임스페이스로 리펙터링
    • Refactor -> Refactor to AndroidX 메뉴 추가
  • Sample Data : 레이아웃 편집기의 샘플 데이터로 미리 뷰를 채워볼 수 있음.
  • Slice : Android OS System의 UI에 앱 콘텐츠의 일부를 삽입하는 방법.
  • App Bundle : Google Play에서 특정기기에 필요한 APK 만 제공하는 동적 전송 플랫폼용.
  • D8 (기존 컴파일러 대체)
  • R8 (컴파일러 + Proguard)
    • gradle에서 android.enableR8 속성으로 사용 가능하나, R8은 아직 테스트 단계임.
  • CMakeList : C/C++ 코드를 위해 CMake Build Scripts 지원
  • Profiler
    • 에너지 프로파일
    • 시스템 트레이스 (기존 DDMS 대체)
    • 프로파일 세션
    • 코드 레벨 CPU 동작 기록
    • JNI 참조 추적

Jetpack

Android 앱을 빠르고 쉽게 만들 수 있도록 도와주는 라이브러리, 도구, 아키텍처 지침 모음.

공통 인프라 코드를 제공함.

  • AppCompack
  • Android KTX
  • Paging
  • Room
  • ViewModel

Navigation

1개 액티비티에 다중 프래그먼트 사용하기 위함.

  • Up and Back 지원
  • Bundle 참조 지원
  • Navigation 리소스에서 프래그먼트 액션 정의.
  • Activity 리소스에서 NavHostFragment 사용
  • AppCompactActivity의 onSupportNavigationUp() 사용
  • Navigation Controller 에서 네비게이션 리소스 파싱 및 관리
  • 모든 동작은 Runtime에 동작하므로 빌드 걱정 X

Work Manager

Android 백그라운드 작업을 관리.

  • intentService, JobScheduler, JobDispatcher, AlarmManager 대체
  • 디바이스 상태나 충전 상태 등에 대한 옵션 처리 가능
  • Status는 LiveData 형식이며 Room 사용
  • WorkService, WorkManager 클래스 사용
  • Background(스케쥴러) -> Worker -> Success -> sqlite

04. Track B. Something about TPU

  • 발표자 : 이진원 (삼성전자)
  • 발표 자료 :

Tensor Processing Unit 이야기

S/W 이야기 X

Micro-processor 방향성도 Domain 기반으로 변화해감.

y = f(wx + b)

보통 머신 러닝에 쓰이는 공식을 보면 결국 곱하기와 더하기 연산이 중요함.

  • Matrix Multiply Unit
  • Accumulators

TPU 처리속도 진화

TPU v1 (92 tera ops) -> Cloud TPU -> TPU Pod -> TPU v2 Pod -> TPU v3 (100 peta flops) Pod

모바일 용은 보통 1 tera ops 정도 필요

TPU 구성을 보면 Control 로직 비중은 2%

Systolic Array 연산이 중요함.

TPU의 원래 목표는 GPU의 10배의 성능이었으나 실제 대부분 지표에서 10배 이상의 성능이 나오고 있음.

Google Cloud TPU 서비스 베타 상태임.

아래 것들 사용 가능한 듯 (Tensor Board)... 아닐수도 있음;;

  • Image Recognition & Object Detection
  • Transformer
  • Speech Recognition

05. Track B. ML Kit 모바일 개발자를 위한 머신러닝

  • 발표자 : 남상균 (NBT)
  • 발표 자료 :

Firebase ML Kit 이야기. 결국은 GCP Vision API 사용. 결론은 유료.

Google I/O Keynote 에서도 AI에 대한 중요성 강조함.

  • 2017년 : Mobile first to AI first
  • 2018년 : Solving problems with AI for everyone
    • Mobile에는 ML Kit, TF Lite for Mobile

캐시슬라이드의 경우 광고 타켓에 대해서 visioning 사용 (구글 API 사용)

기존에는 client에서 data를 server에 전달 후 연산하는 구조가 주로 쓰임.

on-device ML 도 가능해짐

  • 장점

    • 오프라인 가능
    • 데이터 디바이스 보관
  • 단점

    • 메모리 사용
    • 배터리 소모
    • 낮은 컴퓨팅 파워

Tensor Flow Lite는 아직 실사용에는 어려운 점이 많음. 그래서 ML Kit이 나온 듯.

Google의 ML Kit & AR Core 와

Apple의 Core ML & ARKit 의

네이밍이 가져다 주는 개발자의 작명센스란..

ML Kit은 파이어베이스에서 지원함. Google Cloud Platform API로 지원됨.

  • 기본 API : 주로 이미지 관련
    • 이미지 라벨
    • 텍스트
    • 얼굴 감지
    • 바코드 스캔
    • 랜드마크 인식
    • 스마트 회신(자동완성) 제공 예정
  • 커스텀 모델
    • 동적 모델 다운로드
    • 파이어베이스 원격설정을 통한 A/B 테스트 지원
    • 모델 변환과 압축 제공 예정

Google Codelabs에서 관련 튜토리얼 확인 가능 : https://codelabs.developers.google.com/

Firebase ML Kit

  • Cloud/on-device(기기별) 지원
  • Firebase는 브릿지 역할이라 GCP API를 실제 사용하게 됨.(유료임)
  • on-device일 경우 앱 설치 후 모델 다운로드를 권장함
  • Text Detector 등의 경우 Cloud/on-device에 따라 처리 갯수 차이가 남
  • 커스텀 모델은 model interpreter 사용
  • Firebase 모델 매니저에서 Local/Cloud 모델 소스 관리

visioning API 사용시 주의점 : 이미지 Rotation 값을 잘 설정해야 함.

ML Kit 사용시 고려할만한 서비스들

  • Firebase A/B Testing
  • Cloud Firestore
  • Firebase Performance
  • Google Analytics

Google Cloud Vision API 가격


06. Track A. New Google News & Material Design

  • 발표자 : 안태완 (Google)
  • 발표 자료 :

앱 프로덕트 디자인에 대한 내용 + Material Design Theming 이야기

개발 이야기 X

Google AI 모토는 Human Intelligence 를 support 하는 것

Fake New가 많아 Trust에 대한 부분 필요.

AI 를 통해 paragraph를 뽑아 리스트 배치도 함.

Google Material Theme

Open source 기반 높은 수준의 디지털 경험을 제공하는 것이 목적

Material Theming

기존 Material 은 Product 차별점이 없음.

좀 더 flexible하게 확장된 개념.

주요 개념

  • Centerable
  • more white space
  • product (brand) color
  • 컨텐츠 중심

적용 사례

  • Gmail
  • Google News
  • Google Play
  • Google Home

전리품

기본 : 출입태그, 구글백(신발주머니 같은..), 티셔츠, 선글라스

GDG : 스피너

레진코믹스, 오픈서베이 : 스티커?

참고자료

https://io-extended-seoul-18.firebaseapp.com

+ Recent posts