Company
Date Published
Author
Arpad Borsos
Word count
1302
Language
English
Hacker News points
None

Summary

The Android SDK has improved its support for loading native libraries from APKs, allowing developers to avoid modifying their application's configuration flags. This change supports an important concept in modular programming: dynamic libraries, which can be updated without affecting the application itself. The new feature enables better disk space usage and reduces friction for new customers. To achieve this, the Android SDK uses memory mapping information from `/proc/XXX/maps` to find loaded library mappings. However, some cases require special handling, such as non-contiguous mappings and gaps in between them. A developer has implemented a solution to track readable mappings, their file offsets, and gaps in between them, using process_vm_readv to improve safety. Despite challenges, this improvement is necessary for Android adoption to save space for users and reduce stress on developers.