$30 off During Our Annual Pro Sale. View Details »

キャッチアップ Android 13 / Catch up Android 13

キャッチアップ Android 13 / Catch up Android 13

Yuki Anzai

May 14, 2022
Tweet

More Decks by Yuki Anzai

Other Decks in Technology

Transcript

  1. ͋Μ͍͟Ώ͖ !ZBO[N  (PPHMF%FWFMPQFS&YQFSUTGPS"OESPJE גࣜձࣾ΢ϑΟΧ  ΩϟονΞοϓ"OESPJE

  2.  ϦϦʔεεέʔδϡʔϧ /PX#FUB IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTPWFSWJFX

  3. "OESPJEΛࢼ͢ w ΤϛϡϨʔλͰࢼ͢ w 5JSBNJTV w ࣮ػͰࢼ͢ w ରԠσόΠεIUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOT EFWJDFT

    
  4. "OESPJEͷػೳΛΞϓϦͰࢼ͢  IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTTFUVQTEL android { compileSdkPreview "Tiramisu " defaultConfig {

    … targetSdkPreview "Tiramisu " … } … }
  5. ͢΂ͯͷΞϓϦʹӨڹ͢Δมߋ w 'PSFHSPVOE4FSWJDFT '(4 5BTL.BOBHFS w +PC4DIFEVMFSͷQSFGFUDIࢦఆ w #BUUFSZ3FTPVSDF6UJMJ[BUJPO w

    /PUJ fi DBUJPO༻ͷSVOUJNFQFSNJTTJPO w ʜ 
  6. 'PSFHSPVOE4FSWJDFT '(4 5BTL.BOBHFS  IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTDIBOHFTGHTNBOBHFS

  7. /PUJGJDBUJPO༻ͷSVOUJNFQFSNJTTJPO w /PUJ fi DBUJPOΛૹΔͷʹQFSNJTTJPO͕ඞཁʹ w ΞϓϦΛΠϯετʔϧ͢Δͱ w "OESPJE·ͰσϑΥϧτͰ/PUJ fi

    DBUJPOΛૹΕΔ w "OESPJE͔ΒσϑΥϧτͰ͸/PUJ fi DBUJPOΛૹΕͳ͍ʢ1FSNJTTJPO ͕ڐՄ͞Ε͍ͯͳ͍ʣ 
  8. /PUJGJDBUJPO༻ͷSVOUJNFQFSNJTTJPO w UBSHFU4EL7FSTJPO"OESPJE w "OESPJE.BOJGFTUʹ BOESPJEQFSNJTTJPO1045@/05*'*$"5*0/4Λએ ݴ͠ͳ͍ͱɺઃఆΞϓϦ͔Β௨஌Λ༗ޮʹ͢Δ͜ͱ ͕Ͱ͖ͳ͍  EJTBCMFE

    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" / >
  9. /PUJGJDBUJPO༻ͷSVOUJNFQFSNJTTJPO w UBSHFU4EL7FSTJPO"OESPJE w ೚ҙͷλΠϛϯάͰSVOUJNFQFSNJTTJPOΛϦΫΤ ετͰ͖Δ  requestPermissions(arrayOf(Manifest.permission.POST_NOTIFICATIONS),REQUEST_CODE )

  10. /PUJGJDBUJPO༻ͷSVOUJNFQFSNJTTJPO w UBSHFU4EL7FSTJPO"OESPJE w ৽͘͠ΠϯετʔϧɺΠϯετʔϧ͞Εͨঢ়ଶͰ ʹ04Ξοϓσʔτ w /PUJ fi DBUJPODIBOOFM͕࡞ΒΕͨ͋ͱͰ࠷ॳͷ

    "DUJWJUZ͕։࢝͞ΕΔͱ͖PS"DUJWJUZΛ։࢝͠ ͯ࠷ॳͷ/PUJ fi DBUJPODIBOOFMΛ࡞ͬͨͱ͖ʹ 1FSNJTTJPOμΠΞϩά͕දࣔ͞ΕΔ 
  11. /PUJGJDBUJPO༻ͷSVOUJNFQFSNJTTJPO w UBSHFU4EL7FSTJPO"OESPJE w Πϯετʔϧ͞Εͨঢ়ଶͰʹ04Ξοϓσʔτ w Ξοϓσʔτલʹ௨஌͕ڐՄ͞Ε͍ͯΔ৔߹ w 1FSNJTTJPOμΠΞϩά͕දࣔ͞ΕΔ·ͰҰ࣌తڐՄঢ়ଶʹͳΔ w

    1FSNJTTJPOμΠΞϩάͰϢʔβʔ͕ڐՄɾڋ൱Λબ୒͠ͳ͍ͰμΠΞ ϩάΛดͨ͡৔߹Ұ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TF͔ΒEFWFMPQFSPQUJPOΛ༗ ޮʹ͢Δͱ࢖͑Δ w "OESPJEҎ߱ͷ࣍ͷNBKPSWFSTJPO·ͰʹରԠ͕ඞ ཁ 

    IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTGFBUVSFTQSFEJDUJWFCBDLHFTUVSF
  18. 5IFNFEBQQJDPOT w ୯৭༻ͷΞϓϦΞΠίϯ  IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTGFBUVSFTUIFNFEBQQJDPOT <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android" > <background android:drawable="…"

    / > <foreground android:drawable="…" / > <monochrome android:drawable="@drawable/ic_launcher_monochrome" / > </adaptive-icon>
  19. ৽͍͠1IPUP1JDLFS  private val photoPickerLauncher = registerForActivityResult ( object :

    ActivityResultContract<String, Uri?>() { @CallSupe r override fun createIntent(context: Context, input: String): Intent { return Intent(MediaStore.ACTION_PICK_IMAGES ) .setType(input ) } override fun parseResult(resultCode: Int, intent: Intent?): Uri? { return intent.takeIf { resultCode == Activity.RESULT_OK }?.dat a } } ) { // .. . } IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTGFBUVSFTQIPUPQJDLFS
  20. <manifest …> <applicatio n … android:localeConfig="@xml/locales_config" > … </application> </manifest>

    <?xml version="1.0" encoding="utf-8"? > <locale-config xmlns:android="http://schemas.android.com/apk/res/android" > <locale android:name="ja"/ > <locale android:name="fr"/ > <locale android:name="en"/ > </locale-config> SFTYNMMPDBMT@DPO fi HYNM ΞϓϦ͝ͱͷݴޠઃఆ  "OESPJE.BOJGFTUYNM
  21. ೔ຊޠͷંΓฦ͠Ґஔͷվળ w ೔ຊޠͷվߦҐஔΛจઅʹ߹ΘͤΔઃఆ  IUUQTEFWFMPQFSBOESPJEDPNBCPVUWFSTJPOTGFBUVSFTKBQBOFTFXSBQQJOH <TextVie w … android:lineBreakWordStyle="phrase" /

    >
  22. ·ͱΊ w "OESPJEͰࣗ෼ͷΞϓϦΛ࣮ߦͯ͠໰୊͕ͳ͍͔֬ೝ͠Α͏ w όάΛݟ͚ͭͨΒIUUQTJTTVFUSBDLFSHPPHMFDPN΁ w "OESPJEͷ৽͍͠ػೳΛࢼͯ͠ΈΑ͏