Bu kılavuzlarda, artık güncellenmeyen MediaCompat API'ler ele alınmaktadır. Bunun yerine Jetpack Media3 kitaplığını kullanmanızı önemle tavsiye ederiz.
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Ses uygulamalarında tercih edilen mimari, istemci/sunucu tasarımıdır. İstemci, uygulamanızda MediaBrowser, medya denetleyici ve kullanıcı arayüzü içeren bir etkinliktir. Sunucu, oynatıcıyı ve medya oturumunu içeren bir MediaBrowserService'dir.
MediaBrowserService iki temel özellik sağlar:
MediaBrowserService kullandığınızda, MediaBrowser içeren diğer bileşen ve uygulamalar hizmetinizi keşfedebilir, kendi medya denetleyicisini oluşturabilir, medya oturumunuza bağlanabilir ve oynatıcıyı kontrol edebilir. Wear OS ve Android Auto Uygulamaları medya uygulamanıza bu şekilde erişir.
Ayrıca isteğe bağlı bir Tarama API'sı da sağlar. Uygulamaların bu özelliği kullanması gerekmez. Tarama API'si, istemcilerin hizmeti sorgulamasına ve içerik hiyerarşisinin bir temsilini oluşturmasına olanak tanır. Bu temsil, oynatma listelerini, medya kitaplığını veya başka tür bir koleksiyonu temsil edebilir.
Kullanıcı arayüzü ve medya denetleyicisi içeren bir medya tarayıcısı istemci etkinliği oluşturma ve bir medya tarayıcı hizmetiyle bağlantı ve iletişim kurma.
Medya oturumu geri çağırma yöntemlerinin medya oturumunu, medya tarayıcı hizmetini ve bildirimler ile yayın alıcıları gibi diğer uygulama bileşenlerini nasıl yönettiğini açıklar.
Bu GitHub örneğinde, sesin arka planda oynatılmasına izin veren ve diğer uygulamaların kullanılabildiği bir medya kitaplığı sunan medya uygulamasının nasıl uygulanacağı gösterilmektedir.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[],[],null,["# Audio app overview\n\nThe preferred architecture for an audio app is a client/server design. The client is an Activity in your app that includes a `MediaBrowser`, media controller, and the UI. The server is a `MediaBrowserService` containing the player and a media session.\n\nA `MediaBrowserService` provides two main features:\n\n- When you use a `MediaBrowserService`, other components and applications with a `MediaBrowser` can discover your service, create their own media controller, connect to your media session, and control the player. This is how Wear OS and Android Auto Applications gain access to your media application.\n- It also provides an optional *browsing API*. Applications don't have to use this feature. The browsing API lets clients query the service and build out a representation of its content hierarchy, which might represent playlists, a media library, or some other kind of collection.\n\n| **Note:** As is the case with media session and media controller, the recommended implementation of media browser services and media browsers are the classes `MediaBrowserServiceCompat` and `MediaBrowserCompat`, which are defined in the [media-compat support library](https://developer.android.com/topic/libraries/support-library/features.html#v4-media-compat). They replace earlier versions of the classes `MediaBrowserService` and `MediaBrowser` that were introduced in API 21. For brevity, the terms \"MediaBrowserService\" and \"MediaBrowser\" refer to instances of `MediaBrowserServiceCompat` and `MediaBrowserCompat` respectively.\n\n**[Building a media browser service](/guide/topics/media-apps/audio-app/building-a-mediabrowserservice)**\n: How to create a media browser service that contains a media session, manage client connections, and become a foreground service while playing audio.\n\n**[Building a media browser client](/guide/topics/media-apps/audio-app/building-a-mediabrowser-client)**\n: How to create a media browser client activity that contains a UI and media controller, and connect and communicate with a media browser service.\n\n**[Media session callbacks](/guide/topics/media-apps/audio-app/mediasession-callbacks)**\n: Describes how the media session callback methods manage the media session, media browser service, and other app components like notifications and broadcast receivers.\n\n**[Universal Android Music Player Sample](https://github.com/android/uamp)**\n: This GitHub sample shows how to implement a media app that allows background playback of audio, and provides a media library that is exposed to other apps."]]