본문

170612(월) - Android 6.0 APIs

Android 6.0 APIs


Update target API level

- targetsdkversion to "23"

- minsdkversion에서 지원하지 않는 API 실행전에 조건 실행으로 older version API 사용 가능



Fingerprint Authentication

- FingerprintManager.authenticate() 호출

- UI에 standard Android fingerprint icon을 사용해야 한다.



- 여러개의 app을 사용하는 경우 각 app에서 사용자의 지문을 authenticate 해야한다.

- manifest

<uses-permission
       
android:name="android.permission.USE_FINGERPRINT" />


- 사용법

Fingerprint Dialog sample


- 다른 Android API와 사용하는 법

Fingerprint and Payment APIs



Confirm Credential

- App은 최근에 사용자가 마지막으로 unlocked 한 시간을 기준으로 사용자를 인증 가능

- 사용자가 추가 app password를 기억하지 않아도 된다.

- 사용자가 authentication user interface를 implement 하지 않아도 된다.

- public or secret key를 구현하여 같이 사용해야 한다.

- 인증 후 동일한 key를 재사용 할 수 있는 limit time을 설정 가능

KeyGenerator or KeyPairGenrator 설정 시 새로운  setUserAuthenticationValidityDurationSeconds() 를 호출


- re-authentication dialog가 과도하게 표시되지 않게 주의

시간제한이 만료되면 createConfirmDeviceCredentialIntent() 메소드를 사용하여 사용자 다시 인증


Confirm Credential sample



App Linking

- Android intent system의 향상

- web domain과 app을 연결 가능

- 특정 web link를 처리하고, app을 선택하라는 메시지를 건너 뛰는데 사용할 default app을 결정 가능하다.

Handling App Links



Auto Backup for Apps

- System이 full data backup과 restore for apps를 수행

- Android 6.0 (API levels 23)

- user가 google accounts를 지우면, backup data도 지워진다.

Configuring Auto Backup for Apps



Direct Share

- direct share targets that launch a specific activity in your app.

- exposed to users share menu.


- must define a class that extends ChooserTargetService

- manifest

<service android:name=".ChooserTargetService"
       
android:label="@string/service_name"
       
android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
   
<intent-filter>
       
<action android:name="android.service.chooser.ChooserTargetService" />
   
</intent-filter>
</service>


- ChooserTargetService에 expose 하려는 acitivity의 manifest에 다음과 같이 선언

<activity android:name=".MyShareActivity”
        android:label="
@string/share_activity_label">
   
<intent-filter>
       
<action android:name="android.intent.action.SEND" />
   
</intent-filter>
<meta-data
       
android:name="android.service.chooser.chooser_target_service"
       
android:value=".ChooserTargetService" />
</activity>



Void Interactions

- build conversational voice experiences into your app.

Voice Actions developer site



Assist API

- Home button을 길게눌러 assistant를 불러내서 어떤 작업을 하도록 할 수 있다.

- assistant가 context를 사용 가능하게 해야한다.

- FLAG_SECURE flag를 사용하여 context를 공유 안되게 할 수 있다.

- AssistContent calss를 사용하여 standard set 말고도 추가 정보 공유 가능


1. implement the Application.OnProvideAssistDataListener interface

2. Register this listener by using registerOnProvideAssistDataListener()

3. callback : onProvideAssistData(), onProvideAssistContent()



Adoptable Storage Devices

- SD cards 같은 external storage를 adopt 할 수 있다.

- Adopting 되면 internal storage 처럼 encrypts and format 을 지정한다.

- storage에 app과 private data를 저장 가능

- app을 이동할 때, manifest의 android:installLocation Preference를 본다.

- 아래와 같은 API에 접근할 때, path는 dynamically하게 변하므로 이전 경로를 유지하지 말것.



Notifications

INTERRUPTION_FILTER_ALARMS filter는 not disturb mode 에서 alarms이 울리지 않는다.

CATEGORY_REMINDER 는 CATEGORY_EVENT와 CATEGORY_ALARM를 구별하기 위한  category value.

Icon은 setSmallIcon()와 setLargeIcon() method를 사용가능한 class.

getActiveNotifications()는 현재 alive 한 notification 확인 가능



Bluetooth Stylus Support

- stylus 펜과 관련된 release



Improved Bluetooth Low Energy Scanning

- 이전 버전보다 전력 효율이 좋아짐



Hotspot 2.0 Release 1 Support

- add support Hotspot 2.0 Release 1 spec on Nexus 6 and 9



4K Display Mode

compatible harware에서 4K rendering이 가능하다.



Themeable ColorStateLists

- Theme attributes는 Android 6.0 (API level 23) 에서 실행되는 기기의 경우 ColorStateList에서 지원된다.

- Deprecated  Resources.getColorStateList() and Resources.getColor()

- new Context.getColorStateList() or Context.getColor()

- 마찬가지로 ContextCompat 을 통해서도 지원 가능



Audio Features

- MIDI protocol 지원

- new  AudioRecord.Builder and AudioTrack.Builder

- API hook for associating audio and input devices.

getDevices() 는 현재 연결된 모든 audio 장치를 볼 수 있다.



Video Features

- MediaSync 는 audio 및 video stream을 synchronously으로 rendering 하는데 도움이 되는 클래스

EVENT_SESSION_RECLAIMED  event 는 session 이 resource manager에 의해서 reclaimed 된 것을 나타낸다.

ERROR_RECLAIMED error code는 resource manager가 codec에서 사용하는 media resource를  reclaimed 했음을 나타낸다.

getMaxSupportedInstances() interface는 지원되는 concurrent codec instances의 max number의 수를 얻는다.

setPlaybackParams() 는 media의 play 속도를 설정



Camera Features

- Flashlight API

setTorchMode() 를 사용하여 camera 구동 없이도 torch를 사용가능


- Reprocessing API

Camera2 API는 YUV and private opaque image를 reprocessing 하도록 extends 되었다.




공유

댓글