Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Android 11 - Minggu 5 - Bahasa
Android 11 menyertakan investasi besar dalam bahasa dan library, seperti menggabungkan dukungan Kotlin ke dalam beberapa library Jetpack yang paling sering digunakan, menambahkan Java API baru ke platform, dan mengembangkan alat baru untuk mengatasi kerusakan memori dalam kode native. Jalur ini terdiri dari video dan artikel yang mendemonstrasikan update dan mengajarkan Anda cara menerapkannya di aplikasi Android.
Kembali
check_circle
Bahasa modern di Android
ondemand_video
Video
Opsional
Selamat datang di 11 Minggu Android Minggu 5: Bahasa. Tonton teaser pengantar untuk mempersiapkan aktivitas dalam jalur ini.
check_circle
Coroutine <3 Android
ondemand_video
Video
Opsional
Pelajari alasan coroutine adalah solusi yang direkomendasikan untuk kode asinkron
check_circle
Menggunakan coroutine Kotlin di aplikasi Android
emoji_objects
Codelab
Opsional
Dalam codelab ini, Anda akan mempelajari praktik terbaik tentang cara mengintegrasikan coroutine ke dalam UI aplikasi Anda dan cara menguji coroutine.
Kode native dalam bahasa yang tidak aman untuk memori, seperti C dan C++, sering kali rentan terhadap bug kerusakan memori. Hardware-Assisted Address Sanitizer (HWASan) dikembangkan untuk Android guna mengatasi bug kerusakan memori dalam kode native. Baca postingan blog developer Android ini untuk mempelajari bagaimana Android 11 memudahkan Anda untuk menggunakannya di aplikasi.
check_circle
Dependensi native di Android Studio 4.0
Opsional
Plugin Android Gradle versi 4.0 menambahkan dukungan untuk mendistribusikan dan mengekspos library native melalui mekanisme yang sama untuk library Java: Android Archives (AAR). Lihat postingan blog ini untuk mempelajari cara menerapkan update dan library yang tersedia.
check_circle
Dukungan untuk API bahasa Java yang lebih baru
Opsional
Pelajari Android 11 yang menambahkan dukungan untuk sejumlah API hingga OpenJDK versi 13.
check_circle
Memeriksa aktivitas CPU dengan CPU Profiler
subject
Artikel
Opsional
Artikel ini membahas cara menggunakan CPU Profiler untuk memeriksa serta mengoptimalkan aktivitas thread dan penggunaan CPU aplikasi Anda secara real time saat berinteraksi dengan aplikasi Anda.
Dalam codelab ini, Anda akan mempelajari cara mengonversi kode dari Java ke Kotlin. Anda juga akan mempelajari apa itu konvensi bahasa Kotlin dan cara memastikan bahwa kode yang ditulis mengikutinya.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],[],[],[],null,["# Record a system trace\n\nA system trace shows you system-wide activities and resource usage, so you can\nsee how your app processes are scheduled and run. The system trace view in the\nAndroid Studio Profiler is commonly used to investigate the following:\n\n- How app and system processes are distributed across device cores and threads.\n- How smoothly the UI renders.\n- Power usage at both the device and app level.\n\nThis page provides an overview of the most commonly used visuals in the system\ntrace view. See the [chart glossary](/studio/profile/chart-glossary/flame-chart)\nfor more details about visualizations not described here. For more detailed\nexamples of what to use a system trace for, see the other pages in this section.\n\nAfter you [record a system trace](/studio/profile#start-profiling), you see the\nfollowing visualizations displayed over a timeline. You should focus on how\ndifferent system resources are correlated; for example, if you notice a spike in\nthe modem power rail, you should go to the threads section and see what thread\nactivity could be causing the spike at the time.\n\n- **CPU Usage**: Shows CPU usage of your app as a percentage of total available CPU capacity by time. Highlight a section of the timeline to filter to the details for that time period.\n- **Interactions** : Shows user interaction and app lifecycle events along a timeline (requires a [debuggable](/studio/profile#profileable-v-debuggable) app process and a device running API level 26 or higher).\n- **Display** : Shows info related to how smooth your app UI renders. Select **Lifecycle** to inspect how long it takes your app to render each frame on the main thread and `RenderThread`. This info is helpful for [investigating\n bottlenecks that cause UI jank and low\n framerates](/studio/profile/jank-detection).\n- **Threads** : Shows the threads that your app and various system processes run\n on. To learn about how to use system traces to investigate and help reduce UI\n jank, see [Detect UI jank](/studio/profile/jank-detection).\n\n **Tip:** When inspecting the **Threads** timeline, the following shortcuts are available:\n - **Zoom in:** Press \u003ckbd\u003eW\u003c/kbd\u003e or scroll the mouse wheel while holding \u003ckbd\u003eCtrl\u003c/kbd\u003e (\u003ckbd\u003eCommand\u003c/kbd\u003e on macOS).\n - **Zoom out:** Press \u003ckbd\u003eS\u003c/kbd\u003e or scroll the mouse wheel backward while holding \u003ckbd\u003eCtrl\u003c/kbd\u003e (\u003ckbd\u003eCommand\u003c/kbd\u003e on macOS).\n - **Pan left:** Press \u003ckbd\u003eA\u003c/kbd\u003e or drag mouse right while holding \u003ckbd\u003eSpace\u003c/kbd\u003e.\n - **Pan right:** Press \u003ckbd\u003eD\u003c/kbd\u003e or drag mouse left while holding \u003ckbd\u003eSpace\u003c/kbd\u003e.\n - **Expand or collapse a thread:** Double-click the thread name or press \u003ckbd\u003eEnter\u003c/kbd\u003e while a thread is selected.\n- **CPU cores** : Shows the activity on each core in your device. Viewing the\n activity by core might give you an idea of which ones are the [\"big\" or\n \"little\" cores](https://en.wikipedia.org/wiki/ARM_big.LITTLE) in\n modern mobile processors. Hold the pointer over a thread activity to\n see which thread this core is running on at that particular time.\n\n- **Process Memory (RSS)**: Shows the amount of physical memory currently in use\n by the app. For more details, see the chart glossary.\n\n- **Power Rails** : Appears when you profile on a physical device. For more info,\n see [Inspect power usage](/studio/profile/power-profiler).\n\n- **Battery**: Shows your app's battery usage."]]