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를 통해 사용자가 가장 사용할만한 앱을 제안하게 됨.

+ Recent posts