একটি মিডিয়া অ্যাপে বিজ্ঞপ্তি যোগ করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
অডিও বা ভিডিও প্রক্রিয়া করে এমন একটি মিডিয়া অ্যাপ তৈরি করার সময়, সঠিক বিজ্ঞপ্তি এবং বিজ্ঞপ্তি চ্যানেলগুলি ব্যবহার করা গুরুত্বপূর্ণ৷ এটি নিশ্চিত করে যে বিজ্ঞপ্তিগুলিতে নিম্নলিখিত মূল্যবান বৈশিষ্ট্যগুলি রয়েছে:
- বিজ্ঞপ্তি অগ্রাধিকার আছে
- অ বরখাস্ত হয়
- রিংটোনগুলির জন্য অডিও বৈশিষ্ট্যগুলি ব্যবহার করুন৷
দুটি বিজ্ঞপ্তি চ্যানেল সেট আপ করতে NotificationChannel.Builder
ব্যবহার করুন: একটি ইনকামিং কলের জন্য এবং অন্যটি সক্রিয় কলগুলির জন্য৷
internal companion object {
const val TELECOM_NOTIFICATION_ID = 200
const val TELECOM_NOTIFICATION_ACTION = "telecom_action"
const val TELECOM_NOTIFICATION_INCOMING_CHANNEL_ID = "telecom_incoming_channel"
const val TELECOM_NOTIFICATION_ONGOING_CHANNEL_ID = "telecom_ongoing_channel"
private val ringToneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
}
বিজ্ঞপ্তিটি সর্বত্র প্রদর্শন করতে এবং রিংটোনের জন্য অডিও চালানোর অনুমতি দিতে, ইনকামিং বিজ্ঞপ্তি চ্যানেলের গুরুত্ব উচ্চে সেট করুন।
val incomingChannel = NotificationChannelCompat.Builder(
TELECOM_NOTIFICATION_INCOMING_CHANNEL_ID,
NotificationManagerCompat.IMPORTANCE_HIGH,
).setName("Incoming calls")
.setDescription("Handles the notifications when receiving a call")
.setVibrationEnabled(true).setSound(
ringToneUri,
AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setLegacyStreamType(AudioManager.STREAM_RING)
.setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE).build(),
).build()
শুধুমাত্র সক্রিয় কলের জন্য ডিফল্টে সেট করা গুরুত্ব প্রয়োজন। ইনকামিং কলগুলির জন্য বিজ্ঞপ্তিগুলিকে অ-খারিজ করার অনুমতি দিতে নিম্নলিখিত ইনকামিং কল স্টাইলটি ব্যবহার করুন৷
val ongoingChannel = NotificationChannelCompat.Builder(
TELECOM_NOTIFICATION_ONGOING_CHANNEL_ID,
NotificationManagerCompat.IMPORTANCE_DEFAULT,
)
.setName("Ongoing calls")
.setDescription("Displays the ongoing call notifications")
.build()
একটি ইনকামিং কলের সময় ব্যবহারকারীর ডিভাইসটি লক থাকা অবস্থায় ব্যবহারের ক্ষেত্রে সমাধান করতে, ব্যবহারকারীকে কলটির উত্তর দেওয়ার জন্য একটি কার্যকলাপ প্রদর্শন করতে একটি পূর্ণ-স্ক্রীন বিজ্ঞপ্তি ব্যবহার করুন৷
// on the notification
val contentIntent = PendingIntent.getActivity(
/* context = */ context,
/* requestCode = */ 0,
/* intent = */ Intent(context, TelecomCallActivity::class.java),
/* flags = */ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
)
কল CallStyle
ব্যবহার করার নির্দেশাবলীর জন্য কল অ্যাপ্লিকেশানগুলির জন্য একটি কল স্টাইল বিজ্ঞপ্তি তৈরি করুন পড়ুন অন্য ধরনের বিজ্ঞপ্তিগুলি থেকে কল বিজ্ঞপ্তিগুলিকে আলাদা করতে৷
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Add notifications to a media app\n\nWhen building a media app that processes audio or video, it's important to use\nthe correct notifications and notification channels. This\nensures that notifications have the following valuable features:\n\n- Have notification priority\n- Are non-dismissable\n- Use audio attributes for ringtones\n\nUse `NotificationChannel.Builder` to set up two notification channels: one for\nincoming calls and the other for active calls. \n\n internal companion object {\n const val TELECOM_NOTIFICATION_ID = 200\n const val TELECOM_NOTIFICATION_ACTION = \"telecom_action\"\n const val TELECOM_NOTIFICATION_INCOMING_CHANNEL_ID = \"telecom_incoming_channel\"\n const val TELECOM_NOTIFICATION_ONGOING_CHANNEL_ID = \"telecom_ongoing_channel\"\n\n private val ringToneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)\n }\n\nTo display the notification everywhere and allow it to play audio for the\nringtone, set the importance of the incoming notification channel to high. \n\n val incomingChannel = NotificationChannelCompat.Builder(\n TELECOM_NOTIFICATION_INCOMING_CHANNEL_ID,\n NotificationManagerCompat.IMPORTANCE_HIGH,\n ).setName(\"Incoming calls\")\n .setDescription(\"Handles the notifications when receiving a call\")\n .setVibrationEnabled(true).setSound(\n ringToneUri,\n AudioAttributes.Builder()\n .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)\n .setLegacyStreamType(AudioManager.STREAM_RING)\n .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE).build(),\n ).build()\n\nOnly active calls requires the importance to be set to default. Use the\nfollowing incoming call style to allow notifications for incoming calls to be\nnon-dismissable. \n\n val ongoingChannel = NotificationChannelCompat.Builder(\n TELECOM_NOTIFICATION_ONGOING_CHANNEL_ID,\n NotificationManagerCompat.IMPORTANCE_DEFAULT,\n )\n .setName(\"Ongoing calls\")\n .setDescription(\"Displays the ongoing call notifications\")\n .build()\n\nTo address use cases where the user's device is locked during an incoming call,\nuse a full-screen notification to display an activity to allow the user to\nanswer the call. \n\n // on the notification\n val contentIntent = PendingIntent.getActivity(\n /* context = */ context,\n /* requestCode = */ 0,\n /* intent = */ Intent(context, TelecomCallActivity::class.java),\n /* flags = */ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,\n )\n\nRead [Create a call style notification for call apps](/develop/ui/views/notifications/call-style) for instructions on\nusing [`CallStyle`](/reference/android/app/Notification.CallStyle) to distinguishing call notifications from other types of\nnotifications."]]