Android

Android Performance and Monitoring

Android performance and monitoring: profiling, memory, ANR, optimization, and diagnostic tools

13 câu hỏi phỏng vấn·
Senior
1

What is Android Profiler and what are its 4 modules?

Câu trả lời

Android Profiler is a tool integrated into Android Studio that analyzes your app's real-time performance. It helps detect CPU, memory, network, and battery issues to optimize your app. Its 4 modules are: CPU Profiler (CPU usage and call traces), Memory Profiler (heap and allocations tracking), Network Profiler (network requests and bandwidth usage), and Energy Profiler (battery consumption and wake locks).

2

How does LeakCanary detect and report memory leaks in Android?

Câu trả lời

LeakCanary is a library that automatically monitors objects expected to be garbage-collected (like a destroyed Activity or Fragment). If an object remains in memory when it shouldn't, LeakCanary detects the leak, analyzes the retention chain, and displays a notification with likely causes and the stack trace.

3

What is StrictMode in Android and what is it used for?

Câu trả lời

StrictMode is a detection tool used to identify bad practices that might block the main thread, such as disk or network operations on the UI thread. It's usually enabled in development with StrictMode.setThreadPolicy() and StrictMode.setVmPolicy(), often wrapped in BuildConfig.DEBUG. When a violation is detected, it can log warnings, throw exceptions, or show alerts to help fix the issue before production.

4

What is the Layout Inspector in Android Studio and what is it used for?

5

What is Systrace in Android and what is it used for?

+10 câu hỏi phỏng vấn

Nắm vững Android cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí