Android at IO 19 Recap

Android at IO 19 Recap

Android at IO 19 Recap

Transcript

  1. 5.
  2. 6.
  3. 7.
  4. 8.

    Kotlin First? Java Language Kotlin Platform SDK support Yes Yes

    Android Studio support Yes Yes Lint Yes Yes Guided docs support Yes Yes API docs support Yes Yes AndroidX support Yes Yes AndroidX Kotlin-specific APIs (e.g. KTX, coroutines) N/A Yes Online training Best effort Yes Samples Best effort Yes Multi-platform Projects No Yes Jetpack Compose No Yes
  5. 9.
  6. 16.
  7. 17.

    Foldable Live Caption Dark theme New location controls Android Q

    Scoped storage Bubbles Gestual Navigation And more..
  8. 18.
  9. 34.

    Scoped Storage ファイル場所 権限取得 アクセス方法 アンインストール時に削除 アプリ領域 - getExternalFilesDir() Yes

    メディア (写真, 動画, 音声) READ_EXTERNAL_STORAGE (他アプリのファイルを参照時) MediaStore No ダウンロード (書類など) - Storage Access Framework (システムピッカー) No
  10. 35.
  11. 37.

    Bubbles "// Create bubble intent val target = Intent(context, BubbleActivity"::class.java)

    val bubbleIntent = PendingIntent.getActivity(context, 0, target, flags) "// Create bubble metadata val bubbleData = Notification.BubbleMetadata.Builder() .setIcon(drawable) .setIntent(bubbleIntent) .build() "// Create notification val chatBot = Person.Builder() .setBot(true) .setName("BubbleBot") .setImportant(true) .build() val builder = Notification.Builder(context, CHANNEL_ID) .setContentIntent(contentIntent) .setSmallIcon(smallIcon) .setBubbleMetadata(bubbleData) .addPerson(chatBot)
  12. 40.
  13. 41.

    Jetpack compose CameraX Benchmark Security SavedState (ViewModel) ViewBinding New/Updated Jetpack

    libraries LiveData/Lifecycle Coroutines ViewPager2 Biometrics Prompt Enterprise Android for Cars ConstraintLayout 2.0
  14. 45.
  15. 46.
  16. 50.
  17. 52.

    Benchmark @RunWith(AndroidJUnit4"::class) class MyBenchmark { @get:Rule val benchmarkRule = BenchmarkRule()

    @Test fun benchmarkSomeWork() = benchmarkRule.measureRepeated { doSomeWork() } }
  18. 53.
  19. 54.
  20. 56.

    Security val encryptedFile = EncryptedFile.Builder( File(context.getFilesDir(), "my_other_sensitive_data.txt"), context, masterKeyAlias, EncryptedFileKeyset.FileEncryptionScheme.AES256_GCM_HKDF_4KB

    ).build() "// Write to a file. try { val outputStream: FileOutputStream? = encryptedFile.openFileOutput() outputStream"?.apply { write("MY SUPER SECRET INFORMATION".toByteArray(Charset.forName("UTF-8"))) flush() close() } } catch (ex: IOException) { ""... }
  21. 59.

    SavedState (ViewModel) val vm = ViewModelProvider(this, SavedStateVMFactory(this)) .get(SavedStateViewModel"::class.java) class SavedStateViewModel(

    private val state: SavedStateHandle ) : ViewModel() { "// ""... } SavedStateVMFactory を使い、SavedStateHandle をもらうだけ
  22. 61.

    Data binding に似ている Android Gradle plugin (3.6+) レイアウトに <layout> タグを追加しない

    Annotation processors を使用しない 双方向バインディングは出来ない ViewBinding
  23. 68.

    Biometric Prompt BiometricPrompt(this, executor, object : BiometricPrompt.AuthenticationCallback() { override fun

    onAuthenticationError(errorCode: Int, errString: CharSequence) { super.onAuthenticationError(errorCode, errString) "//todo } override fun onAuthenticationSucceeded(result: AuthenticationResult) { super.onAuthenticationSucceeded(result) "// todo } override fun onAuthenticationFailed() { super.onAuthenticationFailed() "// todo } }).authenticate(promptInfo)