How would you adapt an Android app to different hardware capabilities?
Instruction: Describe a capability and performance strategy for a document viewer across supported devices, including optional features, memory limits, fallbacks and verification.
Updated
Official answer
Define supported configurations and essential tasks first, using the product's audience and measured requirements. A generic RAM/core-count threshold does not prove an app will run well: CPU architecture, GPU, thermal state, storage, OS version and workload all matter.
Use AndroidX compatibility libraries where appropriate, and check both API availability and optional hardware capabilities before calling a feature. Declare truly required hardware deliberately; mark optional capabilities accordingly and offer a usable fallback. Do not hide a core task silently because the device is less powerful.
Adapt to the current window, input methods and accessibility settings. Use appropriately sized images, bounded caches and paging so a long list does not decode every full-resolution asset. Keep blocking work off the main thread and reduce optional visual/detail costs only with a defined policy that preserves important information.
For a document viewer, a lower-resource device might render one page at a time and keep a small cache instead of pre-rendering the entire document. The user should still be able to read, search and recover from a loading failure. Preserve selection and position while the window changes.
Test a representative device matrix, including low-memory and thermal-pressure conditions, long sessions and interrupted work. Report measured startup/frame/memory limits per supported class. The goal is a usable and consistent task, not an unsupported promise of identical appearance or speed everywhere.