Slide 1

Slide 1 text

What’s New in Android Noh HyeonSeok Android GDE

Slide 2

Slide 2 text

Noh HyeonSeok Pluu Android GDE GDG Korea Android Naver

Slide 3

Slide 3 text

DarkTheme Gesture Navigation Kotlin Jetpack Compose External Storage ViewBindings Location Connectivity SeJings Panel Bubbles External Storage 5th session Live Caption Suggested actions in notiTcations Privacy Accessibility Project Mainline Foldables G networks Digital wellbeing Focus Mode Family Link Audio playback capture New audio and vid n 1.1 and ANGLE al Networks API 1.2 ART optimiza Therma Kotlin 2nd session Privacy 4th session Accessibility 3rd session Background Activity

Slide 4

Slide 4 text

Bubbles

Slide 5

Slide 5 text

• ݽٚ জ ਤী ಴द • RAM, ੹ਗ, ࢿמী ؀ೠ ੉ग • बпೠ ࠁউ Ҋ۰ ࢎ೦ਵ۽ ࠙ܨ • Deprecated SWAs • Android Goীࢲ SAWs Permission ӂೠਸ ࠗৈೞ૑ ঋ਺ System AleX Window Se2ings.canDrawOverlays() == false

Slide 6

Slide 6 text

• SAW੄ ؀উ଼ • NotiCcation ഐ୹ী ੄೧ ֢୹ • ઺ਃೠ ੘সਸ औѱ ੽Ӕೞח ߑߨ • ই੉௑җ Activityܳ ੐߬٣٘ೞח ഋక • ࢸ੿ > জ ߂ ঌܿ > ঌܿ > ঌܿ ೂࢶ (Q Beta4) Bubbles

Slide 7

Slide 7 text

• Collapsed • ই੉௑җ ݫࣁ૑ ֢୹ • Expanded • ಟ୛૓࢚క۽, Window ղࠗ۽ Activity ֢୹ Bubbles Q Beta4ীࢲ ز੘ ࢚੉ ޙઁ (IssueTracker) • NotiCcationਵ۽ Bubble ޷֢୹ • ࠂࣻ Bubble ֢୹

Slide 8

Slide 8 text

extended 1. BubbleActivity in AndroidManifest.xml Required

Slide 9

Slide 9 text

extended 2. BubbleMetadata ࢤࢿ val target = Intent(context, BubbleActivity::class.java) val bubbleIntent = PendingIntent.getActivity(context, 0, target, 0) // Create bubble metadata val bubbleData = NotiCcation.BubbleMetadata.Builder() .setDesiredHeight(600) .setIcon(Icon.createWithResource(context, R.drawable.icon)) .setIntent(bubbleIntent) .build()

Slide 10

Slide 10 text

extended 3. Add BubbleMetadata to NotiTcation val builder = NotiCcation.Builder(context, CHANNEL_ID) .setContentIntent(contentIntent) .setSmallIcon(smallIcon) .setBubbleMetadata(bubbleData)

Slide 11

Slide 11 text

• AutoExpandBubble • DeleteIntent • DesiredHeight • Icon • Intent • SuppressNotiCcation BubbleMetadata

Slide 12

Slide 12 text

Multitasking Overview Picture-in-Picture Bubble Low Interaction High Interaction

Slide 13

Slide 13 text

DARK THEME

Slide 14

Slide 14 text

Light theme Dark Theme

Slide 15

Slide 15 text

extended System theme seJing New in Q Beta 4 ࢸ੿ > ٣झ೒ۨ੉

Slide 16

Slide 16 text

extended ׮௼ ప݃ܳ ࢎਊೞب۾ ӂ੢ Google জ ׮௼ ప݃ ૑ਗ ৘੿ Dark theme: app suppoX

Slide 17

Slide 17 text

extended forceDarkAllowed <item name="android:forceDarkAllowed">true</item>

Slide 18

Slide 18 text

extended AppCompat 1.1.0 ...

Slide 19

Slide 19 text

extended values/themes.xml values-night/themes.xml <style name="Theme.AppCompat.DayNight" parent="Theme.AppCompat"> Theme

Slide 20

Slide 20 text

extended Apply Theme NightMode ࢸ੿ AppCompatDelegate.setDefaultNightMode() getDelegate().setLocalNightMode() ੹୓ ࢸ੿ ౠ੿ Activity

Slide 21

Slide 21 text

extended Modes DAYNIGHT MODE_NIGHT_YES ೦࢚ Dark Theme MODE_NIGHT_NO ೦࢚ Light Theme MODE_NIGHT_FOLLOW_SYSTEM दझమ ࢸ੿ী ٮܲ Theme MODE_NIGHT_AUTO_BATTERY ߓఠܻ ੺੹ ݽ٘ੌ ٸ Dark Theme Add, AppCompat 1.1.0

Slide 22

Slide 22 text

extended दझమ ప݃ܳ ؗযॳח (override) ഋక Options • Light • Dark • System Default Android Q

Slide 23

Slide 23 text

extended ࢎਊ੗о Dark Theme ࢎਊೡ ࣻ ੓ח ߑߨਸ ઁҕ Options • Light • Dark • ੺੹ ݽ٘ Android P ੉ೞ

Slide 24

Slide 24 text

extended • दрҗ ҙ۲ػ MODE_NIGHT_AUTO_TIME deprecated • Dark Themeܳ On/Oc оמೠ ӝמ ഋక • WebView + Force Dark ૑ਗ • Custom Tab ١ ૑ਗ ৘੿ • NotiCcation਷ ੗ز ੸ਊ / ழझథ਷ ࣻ੿ ೙ਃ Dark theme in Q

Slide 25

Slide 25 text

extended Dark-theming your app Option A Theme.AppCompat.DayNight // ੉޷ ࢎਊ ઺ ࣻب ੓׮ Theme.DeviceDefault.DayNight // ٣߄੉झ ࢸ੿ী ٮۄ ThemeOverlay.DeviceDefault.Accent.DayNight Option B android.forceDarkallowed=“true” // AndroidManifest.xml ী ࢸ੿ view.setForceDarkallowed(false); // ForceDarkܳ ઁ৻୊ܻ

Slide 26

Slide 26 text

extended Dark-theming your app Option C Night Modeী ҙ۲ػ -night ܻࣗझ ೠ੿੗৬ ࢸ੿ਵ۽ ੘স Option D OS੄ Night Modeܳ ޖद

Slide 27

Slide 27 text

Gesture Navigation

Slide 28

Slide 28 text

Android P 9.0 New System Navigation

Slide 29

Slide 29 text

Gesture Navigation Android 10.0

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

• ӝࠄ੸ੋ ই੉٣যח दझమ UI ৔৉ਸ ઴੉ח Ѫ • ށੑഋ(Immersive) ੹୓ ചݶীࢲח 
 ઁझ୊۽ ׮ܲ ز੘ਸ ࢎਊ • OEMҗ ഈ۱ೞৈ ױࣽೠ ಴ળਸ ٜ݅ ৘੿ • ࢸ੿ > दझమ > ز੘ > System navigation
 (Q Beta4) Gesture Navigation

Slide 32

Slide 32 text

More Gesture extended

Slide 33

Slide 33 text

• System gestureо о૑ח ৔৉ • ઝ਋ஏ : Back Gesture • ೞױ : Home Gesture System gesture INSETS New in Q

Slide 34

Slide 34 text

• জ੉ ੤੿੄ೡ ࣻ হח ৔৉ • Qীࢲח Home Gesture ਊب۽ ࢎਊ Mandatory System gesture INSETS New in Q

Slide 35

Slide 35 text

Need exclusion

Slide 36

Slide 36 text

Required system gesture New in Q

Slide 37

Slide 37 text

Override gestures View.setSystemGestureExclusionRects(List rects)

Slide 38

Slide 38 text

Consuming insets manually view.setOnApplyWindowInsetsListener() {v, insets -> insets.consumeSystemWindowInsets() ... }

Slide 39

Slide 39 text

Text

Slide 40

Slide 40 text

• Hyphenationо API 23ীࢲ بੑ • Android Qীࢲח Ocо ӝࠄ Text Hyphenation On Hyphenation Od 0 1.25 2.5 3.75 5 Text Measure in ms

Slide 41

Slide 41 text

SystemFonts.getAvailableFonts().forEach { font -> // font.bucer, font.Cle, font.style, font.localeList, etc … } Find systems Fonts

Slide 42

Slide 42 text

#include ASystemFontIterator* iterator = ASystemFontIterator_open(); ASystemFont* font = nullptr; while ((font = ASystemFontIterator_next(iterator)) != nullptr) { const char* path = ASystemFont_getFontFilePath(font); // ... ASystemFont_close(font); } ASystemFontIterator_close(iterator); Native API for system fonts

Slide 43

Slide 43 text

• Suppot • • LineBackgroundSpan Another new feature LineHeightSpan LineBackgroundSpan

Slide 44

Slide 44 text

Kotlin

Slide 45

Slide 45 text

50% # 1 of Pro Android devs use Kotlin faster growing language

Slide 46

Slide 46 text

Pevormance Optimize Debugging suppot API Annotation KTX Coroutines Suppot Jetpack Compose Kotlin plugin for Android Studio Refactoring/Lint Suppot Kotlin Trst

Slide 47

Slide 47 text

• ݆਷ ѐߊ੗ٜ੉ Kotlin ࢎਊ੄ ݅઒ (Survay 25%) Kotlin Trst: Why?

Slide 48

Slide 48 text

• Kotlinਸ ݢ੷ ੽Ӕೞח Ѫ਷ ਤ೷ • Java ঱যח ই૒ ૑ਗ • Java৬ ࢚ഐ ഐജ ୓௼ • Project৬ Team੄ ࢚ടਸ ୓௼ • ౟ۨ੉٘ য়೐ • ࢤ࢑۱, पઁ ݅઒, ۞׬ழ࠳, ࠽٘ ࣘب, APK ௼ӝ Kotlin Trst: should I switch?

Slide 49

Slide 49 text

Java Kotlin Plahorm SDK SuppoX Yes Yes Android Studio SuppoX Yes Yes Lint Yes Yes Guided docs SuppoX Yes Yes API docs SuppoX Yes Yes AndoridX SuppoX Yes Yes AndroidX Kotlin-speciTc APIs (e.g. KTX, coroutines) N/A Yes Online training Best ecot Yes Samples Best ecot Yes Multi-plahorm Project No Yes Jetpack Compose No Yes What’s does Kotlin First mean?

Slide 50

Slide 50 text

• Android Qীࢲ APIח Nullable Annotation ૑ਗ • Qীࢲח Null ೲਊਸ য়ܨ۽ ъઁച • Kotlin 1.3.30ীࢲ
 kapt੄ Incremental annotation processing Kotlin 2nd Kotlin Under the Hood

Slide 51

Slide 51 text

NotiTcation

Slide 52

Slide 52 text

• ૓زҗ ঌܿ ܻࣗী ೖ۽ • ઺ਃೞ૑݅, ૊п ୊ܻೞ૑ ঋইب غח ঌܿ Gentle NotiTcation

Slide 53

Slide 53 text

• OS ৔৉੄ ਋ࢶ ࣽਤ • Prioritized (਋ࢶࣽਤ ૑੿ؽ) • Gentle (ઑਊ൤ ಴दؽ) • Prioritized • ೙ࣻ ੢஖ ӝמ • ழޭפா੉࣌ • ੉߮౟/ঌۈ • ࢎਊ੗ী ੄೧ Proritized/Gentle ੹ജ оמ Interruptions

Slide 54

Slide 54 text

Jetpack Compose

Slide 55

Slide 55 text

History of Android 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 1.0 Android Studio ART Recycler View Constraint
 Layout Kotlin Arch Components

Slide 56

Slide 56 text

View ҙ۲ ௏٘ MyFragment.[kt|java] my_fragment.xml a2rs.xml styles.xml

Slide 57

Slide 57 text

• ରࣁ؀ UI toolkit • Unbundled • ߈਽ഋ • Kotlinਵ۽ ੘ࢿ • React, Litho, View.js, Flu2er • Open Source Jetpack Compose

Slide 58

Slide 58 text

• Jetpack UI Widget • Not View, Not Fragment => ؊ ੘਷ ݽٕ • Kotlin Compiler Plugin ࢎਊ • ӝઓ App/Code৬ ഐജ • Experimental What is Compose?

Slide 59

Slide 59 text

extended @Composable fun Greeting(name: String) { Text("Hello $name") } Hello Jetpack Hello Kotlin Hello Google Hello Android Hello World

Slide 60

Slide 60 text

• Annotation Processorܳ ޷ࢎਊ, Kotlin Compiler Plugin ࢎਊ • ೣࣻ੄ ݽٚ ݒѐ ߸ࣻח ҳࢿ ਃࣗ੄ ݒѐ ߸ࣻ ژח ࣘࢿ • XML ۨ੉ইਓ হ਺ • ؘ੉ఠ ߄ੋ٬ হ਺ @Composable

Slide 61

Slide 61 text

extended BackpoX @Composable @GenerateView fun Greeting(name: String) { /* ... */ } val greeting: GreetingView = CndViewById("R.id.greeting") greeting.setName("Android")

Slide 62

Slide 62 text

ViewBindings

Slide 63

Slide 63 text

• CndViewById()੉ ࠛ೙ਃ • ஹ౵ੌ दী XML੄ ߄ੋ٬ ௏٘ ࢤࢿ • DataBindingҗ ਬࢎೠ ഋక • Null-safe / Type-safe ViewBindings

Slide 64

Slide 64 text

extended @Override fun onCreate(savedInstanceState: Bundle) { super.onCreate(savedInstanceState) binding = SearchItemBinding.inÄate(layoutInÄater) setContentView(binding.rootView) } fun later() { binding.packageName.text = "android" } search_item.xml

Slide 65

Slide 65 text

extended @Override fun onCreate(savedInstanceState: Bundle) { super.onCreate(savedInstanceState) binding = SearchItemBinding.inÄate(layoutInÄater) setContentView(binding.rootView) } fun later() { binding.packageName.text = "android" } search_item.xml

Slide 66

Slide 66 text

extended search_item.xml @Override fun onCreate(savedInstanceState: Bundle) { super.onCreate(savedInstanceState) binding = SearchItemBinding.inÄate(layoutInÄater) setContentView(binding.rootView) } fun later() { binding.packageName.text = "android" }

Slide 67

Slide 67 text

External Storage

Slide 68

Slide 68 text

Common storage Downloads Only accessible via system picker Photo/Video Gated behind storage permission Audio Gated behind storage permission Internal app storage Only accessible to app Scoped Storage Internal Storageח ӝࠄ ࠺ҕѐ, ׮ܲ জ਷ ੽Ӕ ࠛо External Storage ੽Ӕਸ ਤ೧ࢲ
 READ/ WRITE_EXTERNAL_STORAGE ӂ ೠ ೙ਃ MediaStore Queryܳ ా೧ /sdcard ইې ੄ ޷٣যܳ Ѩ࢝ оמ

Slide 69

Slide 69 text

targetSdk = P : ߸ز হ਺ targetSdk = Q ੉࢚ / opt-in • Sandbox : ೧׼ জীࢲ݅ ੽Ӕ оמ • Media Cles: MediaStore API৬ Storage Permission ೙ਃ • Photo Metadata : Storage/MediaLocation Permission ೙ਃ • MediaStore੄ ਤب/҃بח Qীࢲ deprecated, ExifIntevace ୶ୌ • ݽٚ ౵ੌ : AndroidManifestী ࢸ੿ ೙ਃ Scoped Storage 5th What’s New in Shared Storage

Slide 70

Slide 70 text

Android R Scoped Storage will be 
 required in next year’s 
 major plaÅorm release for all apps, independent of target SDK level, so we recommend you add suppot to your app well in advance.

Slide 71

Slide 71 text

Location, Location

Slide 72

Slide 72 text

ࢎਊ੗ ೐ۄ੉ߡद ъച, ࢿמ ੷ೞܳ ࠁ৮ • ೦࢚ ೲਊ / জ ࢎਊ ઺ / Ѣࠗ Permission ୶о • ACCESS_FINE_LOCATION / ACCESS_COARSE_LOCATION / ACCESS_BACKGROUND_LOCATION Location

Slide 73

Slide 73 text

extended // ੌ߈੸ੋ ਤ஖ ਃ୒ ActivityCompat.requestPermissions(this, arrayOf(ACCESS_COARSE_LOCATION), requestCode) RequestPermission

Slide 74

Slide 74 text

extended // Backgroundীࢲ ਤ஖ ਃ୒द ActivityCompat.requestPermissions(this, arrayOf(ACCESS_COARSE_LOCATION, ACCESS_BACKGROUND_LOCATION), requestCode) RequestPermission

Slide 75

Slide 75 text

extended Foreground Service extended

Slide 76

Slide 76 text

extended AndroidManifest.xml targetSdk : Q

Slide 77

Slide 77 text

extended AndroidManifest.xml targetSdk : P ੉ೞ

Slide 78

Slide 78 text

extended AndroidManifest.xml targetSdk : P ੉ೞ Auto Include

Slide 79

Slide 79 text

٣߄੉झܳ Q সӒۨ੉٘ द ӂೠ ߸҃ Target 
 SDK Coarse or Cne permission granted? Background permission deCned in manifest? Updated default 
 permission state Q Yes Yes Foreground and background access Q Yes No Foreground access only Q No (Ignored by system) No access 9 ੉ೞ Yes Automatically added by the system at device upgrade time Foreground and background access 9 ੉ೞ No (Ignored by system) No access

Slide 80

Slide 80 text

Location best practices • ೙ਃೠ ӂೠ݅ ਃ୒ • Foreground ݅ ਤ஖о ೙ਃೠ ҃਋ ACCESS_BACKGROUND_LOCATION ח ࢤۚ • ForegroundServiceীࢲ ೡ ҃਋ “location” ServiceType ੉ਊ • TargetSdkо Q޷݅ੋ ҃਋, 
 ACCESS_BACKGROUND_LOCATION੉ ੗زਵ۽ ୶о

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

Background Activity

Slide 83

Slide 83 text

• Backgroundীࢲ statActivity() ઁೠ • Activity द੘ ઑѤ • Foreground জ • System, Broadcastীࢲ PendingIntent ࢎਊ • Foreground NotiCcation ࢎਊ • Android Qীࢲ प೯غח ݽٚ জী ੸ਊ Background Activity staXs 4th Privacy Change in Android Q

Slide 84

Slide 84 text

extended Warning Message

Slide 85

Slide 85 text

extended val fullScreenIntent = Intent(this, CallActivity::class.java) val fullScreenPendingIntent = PendingIntent.getActivity(this, 0, fullScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT) val notiCcationBuilder = NotiCcationCompat.Builder(this, CHANNEL_ID) .setSmallIcon(R.drawable.notiCcation_icon) .setContentTitle("Incoming call") .setContentText("(919) 555-1234") .setPriority(NotiCcationCompat.PRIORITY_HIGH) .setCategory(NotiCcationCompat.CATEGORY_CALL) .setFullScreenIntent(fullScreenPendingIntent, true) val incomingCallNotiCcation = notiCcationBuilder.build()

Slide 86

Slide 86 text

• ঌۈ, ੹ച৬ э਷ ӟәೠ ࢎਊ੗ ߈਽ ਃҳ • FullScreenIntent • Foreground Service + NotiCcation Need to user's attention urgently

Slide 87

Slide 87 text

Connectivity

Slide 88

Slide 88 text

Disconnect

Slide 89

Slide 89 text

• ࢸ੿ ߸҃ਸ ೡ ࣻ ੓ח ചݶ ઁҕ • ੋఠ֔ োѾ, WiFi, NFC, Volume • AndroidX۽ ઁҕ ৘੿ • Android 9 (API 23) ੉ೞীࢲח ੸੺ೠ ചݶ੉ য়೑ SeJings Panel val panelIntent = Intent(Se2ings.Panel.se2ings_panel_type) statActivityForResult(panelIntent)

Slide 90

Slide 90 text

ACTION_INTERNET_CONNECTIVITY ࠺೯ӝ ݽ٘, Wi-Fi, ݽ߄ੌ ؘ੉ఠ ࠺೯ӝ ݽ٘, Wi-Fi, ݽ߄ੌ ؘ੉ఠ ACTION_WIFI Only Wi-Fi ACTION_NFC NFC ҙ۲ ࢸ੿ ACTION_VOLUME ࠅܬ ҙ۲ ࢸ੿ seJings_panel_type

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

Summary

Slide 93

Slide 93 text

Android Q Beta 4 and Final APIs! 2019.06.06

Slide 94

Slide 94 text

MAC address randomization Unbundle package installer Updatable privacy policies and handle Ad library dependency Camera metadat Foreground Service APIs for use cases Limit background activity launches C Unbundle Restrict Screen Reading Call screening Restrictions on phone, Call logs and Device identifier lockdown Location remind Remove contacts affinity Indicate location usage in the status bar TLSv3 ermissions for OEMs and carriers Strongly typed storage Hide USB serial number until app has permission Restrict access SMS receiver verification A Shadow call stack - Kernel and user space Scudo hardened Execute-only memory Security key me permissions for all apps Opportunistic location access nted Location gency Location sharing with other apps ess cricPrompt Consent for Device Admin efactor accessibility service capabilities rivacy-sensitive WiFi scanning Restrict app icon hiding Increased protection for Serial Number access ion Media Stack is updatable Conscrypt is updatable WPA3 Adiantum Key replacement for ne Encryption for entry-level devices

Slide 95

Slide 95 text

• Update non-SDK inteuace restrictions • Permissions changes for fullscreen intents • Privacy (Scope storage, Location, Background activity, Hardware identiCers) • android.preference ۄ੉࠳۞ܻ ૑ਗ ઺ױ • Suppot for foldables • CameraX, ViewPager2 • etc.. etc… Android Q Checklist

Slide 96

Slide 96 text

What’s New in Android What's New in the Android OS User Inteuace Dark Theme & Gesture Navigation Recommend Overview of Privacy Changes in Android Q ѐߊ੗ܳ ਤೠ উ٘۽੉٘ Q ੿ܻ by নଲࢳ

Slide 97

Slide 97 text

THAN YOU