- সিনট্যাক্স:
<receiver android:directBootAware=["true" | "false"] android:enabled=["true" | "false"] android:exported=["true" | "false"] android:icon="drawable resource" android:label="string resource" android:name="string" android:permission="string" android:process="string" > ... </receiver>
- এর মধ্যে রয়েছে:
-
<application>
- থাকতে পারে:
-
<intent-filter>
<meta-data>
- বর্ণনা:
- একটি ব্রডকাস্ট রিসিভার, একটি
BroadcastReceiver
সাবক্লাস, অ্যাপ্লিকেশানের একটি উপাদান হিসাবে ঘোষণা করে৷ ব্রডকাস্ট রিসিভারগুলি অ্যাপ্লিকেশনগুলিকে ইন্টেন্টগুলি গ্রহণ করতে সক্ষম করে যা সিস্টেম বা অন্যান্য অ্যাপ্লিকেশন দ্বারা সম্প্রচারিত হয়, এমনকি অ্যাপ্লিকেশনের অন্যান্য উপাদানগুলি চলমান না থাকলেও৷একটি ব্রডকাস্ট রিসিভার সিস্টেমে পরিচিত করার দুটি উপায় আছে। একটি হল এই উপাদানটির সাথে ম্যানিফেস্ট ফাইলে এটি ঘোষণা করা। অন্যটি হল কোডে গতিশীলভাবে রিসিভার তৈরি করা এবং এটিকে
Context.registerReceiver()
পদ্ধতি বা এর ওভারলোডেড সংস্করণগুলির একটি দিয়ে নিবন্ধন করা।কিভাবে গতিশীলভাবে রিসিভার তৈরি করতে হয় সে সম্পর্কে আরও তথ্যের জন্য,
BroadcastReceiver
ক্লাসের বিবরণ দেখুন।যদি এই রিসিভারটি অ-সিস্টেম সম্প্রচার পরিচালনা করে, তাহলে
android:exported
এর জন্য একটি মান নির্দিষ্ট করুন। এই মানটিকে"true"
তে সেট করুন যদি আপনি চান যে আপনার রিসিভার অন্য অ্যাপ্লিকেশন থেকে সম্প্রচার গ্রহণ করতে সক্ষম হোক বা"false"
যদি আপনি চান যে আপনার রিসিভার আপনার নিজের অ্যাপ থেকে সম্প্রচার গ্রহণ করতে সক্ষম হোক।আপনি যদি ইতিমধ্যে এটি ঘোষণা করে থাকেন তবে আপনাকে
android:permission
বৈশিষ্ট্যটি সরাতে হবে না।সতর্কতা: আপনি আপনার অ্যাপে কতগুলি ব্রডকাস্ট রিসিভার সেট করেছেন তা সীমিত করুন। অনেক বেশি ব্রডকাস্ট রিসিভার থাকা আপনার অ্যাপের কর্মক্ষমতা এবং ব্যবহারকারীদের ডিভাইসের ব্যাটারি লাইফকে প্রভাবিত করতে পারে। এপিআই সম্পর্কে আরও তথ্যের জন্য আপনি ব্যাকগ্রাউন্ড কাজের সময় নির্ধারণের জন্য
BroadcastReceiver
ক্লাসের পরিবর্তে ব্যবহার করতে পারেন, পটভূমি অপ্টিমাইজেশান দেখুন। - গুণাবলী:
-
android:directBootAware
ব্রডকাস্ট রিসিভার ডাইরেক্ট-বুট সচেতন কিনা, অর্থাৎ, ব্যবহারকারী ডিভাইসটি আনলক করার আগে এটি চলতে পারে কিনা।
দ্রষ্টব্য: ডাইরেক্ট বুট চলাকালীন, আপনার অ্যাপ্লিকেশনের একটি সম্প্রচার রিসিভার শুধুমাত্র ডিভাইস সুরক্ষিত স্টোরেজে সংরক্ষিত ডেটা অ্যাক্সেস করতে পারে।
ডিফল্ট মান হল
"false"
।-
android:enabled
- ব্রডকাস্ট রিসিভার সিস্টেম দ্বারা তাত্ক্ষণিক করা যাবে কিনা। এটা হতে পারে
"true"
এবং না হলে"false"
। ডিফল্ট মান হল"true"
।<application>
উপাদানটির নিজস্বenabled
বৈশিষ্ট্য রয়েছে যা সম্প্রচার রিসিভার সহ সমস্ত অ্যাপ্লিকেশন উপাদানগুলিতে প্রযোজ্য। সম্প্রচার রিসিভার সক্ষম করার জন্য<application>
এবং<receiver>
বৈশিষ্ট্য উভয়ই"true"
হতে হবে। যদি উভয়টি"false"
হয়, তবে এটি অক্ষম এবং তাৎক্ষণিক করা যাবে না। -
android:exported
- ব্রডকাস্ট রিসিভার তার অ্যাপ্লিকেশনের বাইরে অ-সিস্টেম উত্স থেকে বার্তা গ্রহণ করতে পারে কিনা। এটা করতে পারলে
"true"
এবং না হলে"false"
। যদি"false"
, তবে সম্প্রচার গ্রহণকারী শুধুমাত্র যে বার্তাগুলি গ্রহণ করে তা হল সিস্টেম, একই অ্যাপ্লিকেশনের উপাদান, বা একই ব্যবহারকারী আইডি সহ অ্যাপ্লিকেশনগুলি দ্বারা প্রেরিত৷অনির্দিষ্ট থাকলে, ডিফল্ট মান নির্ভর করে সম্প্রচার রিসিভারে উদ্দেশ্য ফিল্টার আছে কিনা তার উপর। যদি রিসিভারে অন্তত একটি অভিপ্রায় ফিল্টার থাকে, তাহলে ডিফল্ট মানটি
"true"
। অন্যথায়, ডিফল্ট মান"false"
।এই বৈশিষ্ট্যটি একটি সম্প্রচার রিসিভারের বাহ্যিক এক্সপোজার সীমাবদ্ধ করার একমাত্র উপায় নয়। আপনি এটিকে বার্তা পাঠাতে পারে এমন বাহ্যিক সত্তাগুলিকে সীমাবদ্ধ করার জন্য একটি অনুমতিও ব্যবহার করতে পারেন৷
permission
বৈশিষ্ট্য দেখুন. -
android:icon
- ব্রডকাস্ট রিসিভারের প্রতিনিধিত্বকারী একটি আইকন। এই বৈশিষ্ট্যটি চিত্র সংজ্ঞা ধারণকারী একটি অঙ্কনযোগ্য সম্পদের একটি রেফারেন্স হিসাবে সেট করা হয়েছে। যদি এটি সেট করা না থাকে, তবে সম্পূর্ণরূপে অ্যাপ্লিকেশনটির জন্য নির্দিষ্ট আইকনটি পরিবর্তে ব্যবহার করা হয়৷
<application>
উপাদানেরicon
বৈশিষ্ট্য দেখুন।ব্রডকাস্ট রিসিভারের আইকন, এখানে সেট করা হোক বা
<application>
উপাদান দ্বারা, সমস্ত রিসিভারের অভিপ্রায় ফিল্টারের জন্য ডিফল্ট আইকন।<intent-filter>
> এলিমেন্টেরicon
অ্যাট্রিবিউট দেখুন। -
android:label
- ব্রডকাস্ট রিসিভারের জন্য একটি ব্যবহারকারী-পাঠযোগ্য লেবেল। যদি এই অ্যাট্রিবিউট সেট করা না থাকে, তাহলে সম্পূর্ণরূপে অ্যাপ্লিকেশানের জন্য সেট করা লেবেল পরিবর্তে ব্যবহার করা হয়।
<application>
উপাদানেরlabel
বৈশিষ্ট্য দেখুন।ব্রডকাস্ট রিসিভারের লেবেল, এখানে সেট করা হোক বা
<application>
উপাদান দ্বারা, সমস্ত রিসিভারের অভিপ্রায় ফিল্টারের জন্যও ডিফল্ট লেবেল।<intent-filter>
এলিমেন্টেরlabel
অ্যাট্রিবিউট দেখুন।লেবেলটি একটি স্ট্রিং রিসোর্সের রেফারেন্স হিসাবে সেট করা হয়েছে, যাতে এটি ব্যবহারকারী ইন্টারফেসের অন্যান্য স্ট্রিংগুলির মতো স্থানীয়করণ করা যায়। যাইহোক, আপনি অ্যাপ্লিকেশনটি বিকাশ করার সময় সুবিধা হিসাবে, এটি একটি কাঁচা স্ট্রিং হিসাবেও সেট করা যেতে পারে।
-
android:name
- ব্রডকাস্ট রিসিভার,
BroadcastReceiver
একটি সাবক্লাস প্রয়োগ করে এমন ক্লাসের নাম। এটি একটি সম্পূর্ণ যোগ্য শ্রেণীর নাম, যেমন"com.example.project.ReportReceiver"
। যাইহোক, শর্টহ্যান্ড হিসাবে, যদি নামের প্রথম অক্ষরটি একটি পিরিয়ড হয়, উদাহরণস্বরূপ,".ReportReceiver"
, এটি<manifest>
উপাদানে নির্দিষ্ট করা প্যাকেজের নামের সাথে যুক্ত করা হয়।একবার আপনি আপনার অ্যাপ্লিকেশন প্রকাশ করলে, এই নামটি পরিবর্তন করবেন না , যদি না আপনি
android:exported ="false"
সেট করেন।কোন ডিফল্ট নেই. নাম উল্লেখ করতে হবে।
-
android:permission
- একটি অনুমতির নাম যা সম্প্রচারকারীদের ব্রডকাস্ট রিসিভারকে একটি বার্তা পাঠানোর জন্য প্রয়োজন৷ এই অ্যাট্রিবিউট সেট না থাকলে,
<application>
এলিমেন্টেরpermission
অ্যাট্রিবিউট দ্বারা সেট করা অনুমতি সম্প্রচার রিসিভারের জন্য প্রযোজ্য। যদি কোনো বৈশিষ্ট্যই সেট করা না থাকে, তাহলে রিসিভার অনুমতি দ্বারা সুরক্ষিত নয়।অনুমতি সম্পর্কে আরও তথ্যের জন্য, অ্যাপ ম্যানিফেস্ট ওভারভিউ এবং নিরাপত্তা টিপসের অনুমতি বিভাগটি দেখুন।
-
android:process
- ব্রডকাস্ট রিসিভার চালানোর প্রক্রিয়ার নাম। সাধারণত, একটি অ্যাপ্লিকেশনের সমস্ত উপাদান অ্যাপ্লিকেশনের জন্য তৈরি ডিফল্ট প্রক্রিয়ায় চলে। এটি অ্যাপ্লিকেশন প্যাকেজ হিসাবে একই নাম আছে.
<application>
উপাদানেরprocess
বৈশিষ্ট্য সমস্ত উপাদানের জন্য একটি ভিন্ন ডিফল্ট সেট করতে পারে। কিন্তু প্রতিটি কম্পোনেন্ট তার নিজস্বprocess
অ্যাট্রিবিউট দিয়ে ডিফল্টটিকে ওভাররাইড করতে পারে, আপনাকে একাধিক প্রক্রিয়ায় আপনার অ্যাপ্লিকেশন ছড়িয়ে দিতে দেয়।যদি এই অ্যাট্রিবিউটের জন্য বরাদ্দ করা নামটি একটি কোলন (
:
) দিয়ে শুরু হয়, একটি নতুন প্রক্রিয়া, অ্যাপ্লিকেশনটির জন্য ব্যক্তিগত, যখন এটি প্রয়োজন হয় তখন তৈরি করা হয় এবং সম্প্রচার রিসিভার সেই প্রক্রিয়ায় চলে৷যদি প্রক্রিয়ার নামটি একটি ছোট হাতের অক্ষর দিয়ে শুরু হয়, তবে রিসিভার সেই নামের একটি বিশ্বব্যাপী প্রক্রিয়ায় চলে, তবে এটি করার অনুমতি থাকলে। এটি বিভিন্ন অ্যাপ্লিকেশনের উপাদানগুলিকে একটি প্রক্রিয়া ভাগ করতে দেয়, সম্পদের ব্যবহার হ্রাস করে।
-
- প্রবর্তিত:
- API স্তর 1
<রিসিভার>
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি 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,["# <receiver\u003e\n\nsyntax:\n:\n\n ```xml\n \u003creceiver android:directBootAware=[\"true\" | \"false\"]\n android:enabled=[\"true\" | \"false\"]\n android:exported=[\"true\" | \"false\"]\n android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\"\n android:permission=\"string\"\n android:process=\"string\" \u003e\n ...\n \u003c/receiver\u003e\n ```\n\ncontained in:\n: [\u003capplication\u003e](/guide/topics/manifest/application-element)\n\ncan contain:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n\n [\u003cmeta-data\u003e](/guide/topics/manifest/meta-data-element)\n\ndescription:\n: Declares a broadcast receiver, a [BroadcastReceiver](/reference/android/content/BroadcastReceiver)\n subclass, as one of the application's components. Broadcast receivers enable\n applications to receive intents that are broadcast by the system or by other\n applications, even when other components of the application aren't running.\n\n\n There are two ways to make a broadcast receiver known to the system. One is to\n declare it in the manifest file with this element. The other is to create\n the receiver dynamically in code and register it with the\n [Context.registerReceiver()](/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter))\n method or one of its overloaded versions.\n\n\n For more information about how to dynamically create receivers, see the\n [BroadcastReceiver](/reference/android/content/BroadcastReceiver) class\n description.\n\n\n If this receiver handles non-system broadcasts, specify a value for `android:exported`.\n Set this value to `\"true\"` if you want your receiver to be able to\n receiver broadcasts from other applications or `\"false\"` if you only\n want your receiver to be able to receive broadcasts from your own app.\n\n\n You don't have to remove the `android:permission` attribute if you\n already declared it.\n\n\n **Warning:** Limit how many broadcast\n receivers you set in your app. Having too many broadcast receivers can\n affect your app's performance and the battery life of users' devices.\n For more information about APIs you can use instead of the\n `BroadcastReceiver` class for scheduling background work, see\n [Background optimization](/topic/performance/background-optimization).\n\nattributes:\n:\n\n `android:directBootAware`\n\n : Whether the broadcast receiver is *Direct-Boot aware*, that\n is, whether it can run before the user unlocks the device.\n\n **Note:** During\n [Direct Boot](/training/articles/direct-boot), a broadcast\n receiver in your application can only access the data that is stored in\n *device protected* storage.\n\n The default value is `\"false\"`.\n\n `android:enabled`\n : Whether the broadcast receiver can be instantiated by the system. It's\n `\"true\"` if it can be, and `\"false\"` if not. The default value\n is `\"true\"`.\n\n\n The [\u003capplication\u003e](/guide/topics/manifest/application-element) element has its own\n [enabled](/guide/topics/manifest/application-element#enabled) attribute that applies to all\n application components, including broadcast receivers. The\n `\u003capplication\u003e` and\n `\u003creceiver\u003e` attributes must both be `\"true\"` for\n the broadcast receiver to be enabled. If either is `\"false\"`, it's\n disabled and can't be instantiated.\n\n `android:exported`\n : Whether the broadcast receiver can receive messages from non-system sources\n outside its application. It's `\"true\"` if it can, and `\"false\"`\n if not. If `\"false\"`, the only messages the broadcast receiver\n receives are those sent by the system, components of the same application, or applications\n with the same user ID.\n\n\n If unspecified, the default value depends on whether the broadcast receiver contains intent\n filters. If the receiver contains at least one intent filter, then the default value is\n `\"true\"`. Otherwise, the default value is `\"false\"`.\n\n\n This attribute is not the only way to limit a broadcast receiver's external exposure.\n You can also use a permission to limit the external entities that can send it messages.\n See the [permission](/guide/topics/manifest/receiver-element#prmsn) attribute.\n\n `android:icon`\n : An icon representing the broadcast receiver. This attribute is set\n as a reference to a drawable resource containing the image definition.\n If it isn't set, the icon specified for the application as a whole is used\n instead. See the [\u003capplication\u003e](/guide/topics/manifest/application-element)\n element's [icon](/guide/topics/manifest/application-element#icon) attribute.\n\n\n The broadcast receiver's icon, whether set here or by the\n `\u003capplication\u003e` element, is also the\n default icon for all the receiver's intent filters. See the\n [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element) element's\n [icon](/guide/topics/manifest/intent-filter-element#icon) attribute.\n\n `android:label`\n : A user-readable label for the broadcast receiver. If this attribute isn't\n set, the label set for the application as a whole is\n used instead. See the [\u003capplication\u003e](/guide/topics/manifest/application-element) element's\n [label](/guide/topics/manifest/application-element#label) attribute.\n\n\n The broadcast receiver's label, whether set here or by the\n `\u003capplication\u003e` element, is also the\n default label for all the receiver's intent filters. See the\n [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element) element's\n [label](/guide/topics/manifest/intent-filter-element#label) attribute.\n\n\n The label is set as a reference to a string resource, so that\n it can be localized like other strings in the user interface.\n However, as a convenience while you're developing the application,\n it can also be set as a raw string.\n\n `android:name`\n : The name of the class that implements the broadcast receiver, a subclass of\n [BroadcastReceiver](/reference/android/content/BroadcastReceiver). This is a fully qualified\n class name, such as `\"com.example.project.ReportReceiver\"`. However,\n as a shorthand, if the first character of the name is a period, for example,\n `\".ReportReceiver\"`, it is appended to the package name specified in\n the [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element) element.\n\n Once you publish your application, [don't\n change this name](http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html), unless you set [android:exported](#exported)`=\"false\"`.\n\n\n There is no default. The name must be specified.\n\n `android:permission`\n : The name of a permission that broadcasters need in order to send a\n message to the broadcast receiver.\n If this attribute isn't set, the permission set by the\n [\u003capplication\u003e](/guide/topics/manifest/application-element) element's\n [permission](/guide/topics/manifest/application-element#prmsn) attribute applies\n to the broadcast receiver. If neither attribute is set, the receiver\n isn't protected by a permission.\n\n\n For more information about permissions, see the\n [Permissions](/guide/topics/manifest/manifest-intro#perms)\n section in the app manifest overview and\n [Security tips](/guide/topics/security/security).\n\n `android:process`\n\n : The name of the process in which the broadcast receiver runs. Normally, all components of an application run in the default process created for the application. It has the same name as the application package.\u003cbr /\u003e\n\n The\n [\u003capplication\u003e](/guide/topics/manifest/application-element) element's\n [process](/guide/topics/manifest/application-element#proc) attribute can set a different\n default for all components. But each component can override the default\n with its own `process` attribute, letting you spread your\n application across multiple processes.\n\n\n If the name assigned to this attribute begins with a colon (`:`), a new\n process, private to the application, is created when it's needed, and\n the broadcast receiver runs in that process.\n\n\n If the process name begins with a lowercase character, the receiver runs\n in a global process of that name, provided that it has permission to do so.\n This lets components in different applications share a process, reducing\n resource usage.\n\nintroduced in:\n: API level 1"]]