Study reveals patterns in updating deprecated Android APIs

A Systematic Study of Deprecated Android API Usage Updates

Software Engineering

Summary

Android software changes over time, so developers need to update old programming tools called APIs to newer versions. The authors studied many examples of these updates from real projects to find common ways developers make these changes. They identified six main categories of updates and specific patterns developers use. Using these patterns improved an automatic tool’s ability to update code correctly, showing these insights can help with future migrations.

What this means in practice

  • For mobile app developers: Improve automated code update tools to handle deprecated Android APIs using identified usage patterns and migration categories.
  • For software tool builders: Create smarter migration helpers for Android projects by incorporating common API update patterns discovered in real-world developer changes.

Authors

Tarek Mahmud, Meiru Che, Guowei Yang

Abstract

Android Application Programming Interfaces (APIs) continuously evolve, causing existing APIs to become deprecated and requiring developers to migrate their usages to recommended replacements. Although prior studies have proposed automated migration techniques, their effectiveness is often limited by the diversity and contextual complexity of API changes. This paper presents a systematic study of deprecated Android APIs, their recommended replacements, and real-world usage updates performed by developers. Based on an analysis of 1,000 deprecated APIs and 4,336 migration examples collected from GitHub, we identify six migration categories and derive recurring usage-update patterns involving Android-version checks, parameter adaptation, object initialization, data-type conversion, and changes in API interaction mechanisms. To assess their applicability, we augment the zero-shot GUPPY benchmark prompts with the migration category and corresponding usage-update pattern. On 156 benchmark tasks, the pattern-guided prompt improves correct updates from 139 to 147 and performs better in five of the six categories.