Accueil / Apps & Logiciels / A more reliable way to add and edit contacts on Android

A more reliable way to add and edit contacts on Android

Apps that target the upcoming Android release will no longer be able to directly write to contacts with the WRITE_CONTACTS permission. Instead, you can use the standard contact intents (ACTION_INSERT, ACTION_EDIT, and ACTION_INSERT_OR_EDIT). For a complete reference implementation, see the developer guide on how to modify contacts using intents.

On devices running the upcoming Android release, these three contact intents will behave consistently and need no permission at all. If your app targets the upcoming Android release or later and attempts to write to contacts directly, those writes will be rejected and result in a SecurityException or permission denial. For the small set of apps which require broad access to create and modify contacts, a new special app access permission, MANAGE_CONTACTS, arrives in Android 17 QPR2 (Q4 2026). Google Play is publishing updated guidelines for contact access, including MANAGE_CONTACTS, today.

Currently, if your app needs to save even one contact, you might be requesting WRITE_CONTACTS. But that permission grants broad access, allowing an app to make widespread changes to contacts across the device in the background, even without user interaction. Most apps don’t need such broad permission.

While alternatives exist, we've heard from you that they need to be more standardized across the ecosystem. Previously, the contact intents behaved differently from one device to the next. Some editors dropped the data you passed in, like a contact photo. On some devices, the back button saved the contact without the user meaning to or the "create new contact" option was hard to find. So asking for permission was the rational choice. We're fixing all these issues in the upcoming Android version and requiring devices running it to follow the same standards.

When you use these intents – ACTION_INSERT, ACTION_EDIT, and ACTION_INSERT_OR_EDIT – the system handles the heavy lifting by presenting a clean, standardized contact editor experience. It opens a quick half-sheet form for new entries, or allows the user to easily search and add information to an existing contact. Users can seamlessly expand this into a full-page editor to fill out more details, all without your app ever needing direct write permissions. View the tentative UX mocks below:

Figure 1: Create a New Contact *UX not Final*

Figure 2: Add Info to an Existing Contact *UX not Final*

Note: Different device manufacturers may modify the user experience to match their OS style but the behaviour will remain consistent.

You can further streamline the creation process by passing optional data payloads, known as Extras, alongside your intent:

Before: writing directly with WRITE_CONTACTS (Results in a SecurityException or permission denial once your app targets the upcoming Android release.)

After: opening the contact editor (No permission needed.)

Before: updating an existing contact directly

After: letting the user choose a contact to update, or create a new one

If you already know which contact to update, use ACTION_EDIT with that contact's URI:

If you only need to read contacts the user chooses, use the Contact Picker, available since Android 17. It needs no permission.

Some apps add "Call with…" or "Message with…" actions to contacts so people can start a call or chat from the Phone or Contacts app. If your app does this today by writing extra entries into the user's contacts, move to People Directory, arriving in Android QPR2 (Q4 2026). It's a new system directory where your app publishes how people can reach each other in your app, without editing the user's contacts.

To see how these alternatives work in practice, here are a few examples of how different types of apps can approach contact access:

Probably not. If your app saves or edits contacts because a user asked it to, the intents above cover you, with no permission and no Play Console declaration.

MANAGE_CONTACTS is for apps whose core purpose is managing contacts, where the intents aren't enough. For example:

At Google I/O 2026, we introduced Android’s shift from an operating system to an intelligence system. We also demonstrated how you can build intelligent experiences natively with the system and bring the power of Google’s AI into your apps.

This year at Google I/O we are going beyond iterative changes, towards a fundamental shift in how apps are built. Our newest tools are built for the agentic era with features that boost productivity for you as an Android developer AND supercharge the AI agents you deploy in your codebase.

Announced today during The Android Show, Android is transitioning from an operating system to an intelligence system, creating more opportunities for engagement with your apps.

Get the latest Android development insights delivered to your inbox weekly.

Origine de l’article : lire l’article original

Traduction