শর্টকাটগুলিতে ক্ষমতা যুক্ত করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
shortcuts.xml
এর ক্ষমতা আপনাকে ব্যবহারকারীরা আপনার অ্যাপ চালু করতে এবং সরাসরি একটি নির্দিষ্ট কাজ সম্পাদন করতে কী ধরনের পদক্ষেপ নিতে পারে তা ঘোষণা করতে দেয়।
উদাহরণস্বরূপ, Google অ্যাসিস্ট্যান্ট অ্যাপ অ্যাকশনগুলি বিকাশকারীদের অ্যাপ-মধ্যস্থ বৈশিষ্ট্যগুলিকে অন্তর্নির্মিত অভিপ্রায়ে (BIIs) প্রসারিত করতে দেয়, ব্যবহারকারীদের কথ্য কমান্ড ব্যবহার করে সেই বৈশিষ্ট্যগুলিকে সক্রিয় এবং নিয়ন্ত্রণ করতে দেয়। একটি ক্ষমতার মধ্যে কর্মের নাম এবং আপনার অ্যাপে গন্তব্যকে লক্ষ্য করে একটি intent
থাকে যা ব্যবহারকারীর অভিপ্রায় সমাধান করে।
Shortcuts.xml-এ ক্ষমতা সংজ্ঞায়িত করুন
আপনি আপনার অ্যান্ড্রয়েড অ্যাপ ডেভেলপমেন্ট প্রজেক্টে একটি shortcuts.xml
রিসোর্স ফাইলে capability
উপাদান সংজ্ঞায়িত করেন। একটি capability
উপাদান সংজ্ঞায়িত করতে, নিম্নলিখিত করুন:
- স্ট্যাটিক শর্টকাট তৈরি করুন-এ নির্দেশাবলী অনুসরণ করে একটি
shortcuts.xml
সংস্থান তৈরি করুন। আপনার ক্ষমতার মধ্যে নিম্নলিখিত প্রয়োজনীয় তথ্য অন্তর্ভুক্ত করুন:
ক্ষমতার নাম: আপনি যে কাজটি আপনার অ্যাপকে সমর্থন করতে চান। বৈশিষ্ট্যের জন্য কম্পোনেন্ট ডকুমেন্টেশন পড়ুন যার জন্য সক্ষমতার সংজ্ঞা প্রয়োজন। অ্যাপ অ্যাকশন ভয়েস-সক্ষম কমান্ডগুলি ক্ষমতার নামের জন্য BII Action ID
ব্যবহার করে, যা আপনি BII রেফারেন্সে খুঁজে পেতে পারেন। উদাহরণস্বরূপ, GET_THING
BII তার Action ID
actions.intent.GET_THING
হিসাবে তালিকাভুক্ত করে।
অ্যাপের গন্তব্য: ব্যবহারকারীর অনুরোধ পূরণ করার জন্য আপনার অ্যাপে যে গন্তব্য অ্যাকশন চালু হয়। capability
মধ্যে নেস্ট করা intent
উপাদানগুলি ব্যবহার করে অ্যাপের গন্তব্যগুলিকে সংজ্ঞায়িত করুন৷
প্যারামিটার ম্যাপিং: প্রতিটি intent
অভিপ্রায়ের extra
ডেটা হিসাবে পাস করার পরামিতি থাকতে পারে। উদাহরণ স্বরূপ, প্রতিটি অ্যাপ অ্যাকশন BII-তে এমন ক্ষেত্র রয়েছে যা ব্যবহারকারীরা প্রায়শই BII কে ট্রিগার করে এমন প্রশ্নে প্রদান করে এমন তথ্য উপস্থাপন করে।
নিম্নলিখিত উদাহরণটি actions.intent.START_EXERCISE
জন্য shortcuts.xml
এ একটি সক্ষমতার সংজ্ঞা প্রদর্শন করে।
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<capability android:name="actions.intent.START_EXERCISE">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.example.sampleApp"
android:targetClass="com.example.sampleApp.ExerciseActivity">
<parameter
android:name="exercise.name"
android:key="exerciseType"/>
</intent>
</capability>
</shortcuts>
পূর্ববর্তী উদাহরণে, <capability>
android:name
বৈশিষ্ট্যটি START_EXERCISE
BII কে নির্দেশ করে। যদি কোনও ব্যবহারকারী এই BII-কে সহকারীকে জিজ্ঞাসা করে, "Hey Google, ExampleApp-এ একটি দৌড় শুরু করুন," তাহলে সহকারী নেস্টেড intent
এলিমেন্টে দেওয়া তথ্য ব্যবহার করে ব্যবহারকারীর অনুরোধ পূরণ করে। এই নমুনার intent
নিম্নলিখিত বিবরণ সংজ্ঞায়িত করে:
-
android:targetPackage
এই উদ্দেশ্যের জন্য লক্ষ্য অ্যাপ্লিকেশন প্যাকেজ সেট করে। -
android:targetClass
ক্ষেত্রটি গন্তব্য কার্যকলাপ নির্দিষ্ট করে: com.example.sampleApp.ExerciseActivity
। - ইন্টেন্ট
parameter
একটি BII প্যারামিটার exercise.name
জন্য সমর্থন ঘোষণা করে এবং intent
অতিরিক্ত ডেটা হিসাবে ব্যবহারকারীর কাছ থেকে সংগৃহীত প্যারামিটার মান কীভাবে পাস করতে হয়।
একটি ক্ষমতা সহ শর্টকাট সংযুক্ত করুন
একবার আপনি একটি ক্ষমতা সংজ্ঞায়িত করলে, আপনি এটির সাথে স্ট্যাটিক বা ডাইনামিক শর্টকাট যুক্ত করে এর কার্যকারিতা প্রসারিত করতে পারেন। শর্টকাটগুলি কীভাবে একটি capability
সাথে সংযুক্ত করা হয় তা নির্ভর করে বৈশিষ্ট্যটি বাস্তবায়িত হচ্ছে এবং ব্যবহারকারীর অনুরোধে অন্তর্ভুক্ত প্রকৃত শব্দগুলির উপর৷ উদাহরণ স্বরূপ, যখন একজন ব্যবহারকারী আপনার ফিটনেস ট্র্যাকিং অ্যাপে দৌড় শুরু করেন, তখন অ্যাসিস্ট্যান্টকে জিজ্ঞেস করে, "Hey Google, ExampleApp-এ দৌড় শুরু করুন।" অ্যাসিস্ট্যান্ট একটি শর্টকাট ব্যবহার করতে পারে এমন একটি capability
একটি দৃষ্টান্ত চালু করতে যা exercise.name
প্যারামিটারের জন্য "রান" এর একটি বৈধ ব্যায়াম সত্তাকে সংজ্ঞায়িত করে।
অ্যাপ অ্যাকশনের সাথে শর্টকাট যুক্ত করার বিষয়ে আরও তথ্যের জন্য, অ্যাপ অ্যাকশন ওভারভিউ দেখুন।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-27 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-08-27 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["Capabilities in `shortcuts.xml` let you declare the types of actions users can\ntake to launch your app and directly perform a specific task.\n\nFor example, Google Assistant App Actions use capabilities to let developers\nextend in-app features to [built-in intents](//developers.google.com/assistant/app/intents) (BIIs), letting users activate\nand control those features using spoken commands. A capability consists of the\nname of the action and an `intent` targeting the destination in your app that\nresolves the user intent.\n\nDefine capabilities in shortcuts.xml\n\nYou define `capability` elements in a `shortcuts.xml` resource file in your\nAndroid app development project. To define a `capability` element, do the\nfollowing:\n\n1. Create a `shortcuts.xml` resource by following the instructions in [Create\n static shortcuts](//develop/ui/views/launch/shortcuts/creating-shortcuts#static).\n2. Include the following required information in your capability:\n\n - **Capability name:** the action you want your app to support. Refer to\n the component documentation for the feature that requires capability\n definitions. App Actions voice-enabled commands use the BII `Action ID`\n for capability names, which you can find in [BII reference](//developers.google.com/assistant/app/reference/built-in-intents). For example,\n the [`GET_THING`](//developers.google.com/assistant/app/reference/built-in-intents/common/get-thing) BII lists its `Action ID` as `actions.intent.GET_THING`.\n\n - **App destination:** the destination in your app the action launches to\n fulfill the user request. Define app destinations using `intent` elements\n nested within the `capability`.\n\n - **Parameter mappings:** each `intent` might contain parameters to be\n passed as `extra` data of the intent. For example, each App Actions BII\n includes fields representing information users often provide in queries that\n trigger the BII.\n\nThe following example demonstrates a capability definition in `shortcuts.xml`\nfor [`actions.intent.START_EXERCISE`](//developers.google.com/assistant/app/reference/built-in-intents/health-and-fitness/start-exercise), a BII that lets users use spoken\ncommands with Assistant to begin a workout in a fitness app: \n\n \u003cshortcuts xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n \u003ccapability android:name=\"actions.intent.START_EXERCISE\"\u003e\n \u003cintent\n android:action=\"android.intent.action.VIEW\"\n android:targetPackage=\"com.example.sampleApp\"\n android:targetClass=\"com.example.sampleApp.ExerciseActivity\"\u003e\n \u003cparameter\n android:name=\"exercise.name\"\n android:key=\"exerciseType\"/\u003e\n \u003c/intent\u003e\n \u003c/capability\u003e\n \u003c/shortcuts\u003e\n\nIn the preceding example, the `\u003ccapability\u003e` `android:name` attribute refers to\nthe `START_EXERCISE` BII. If a user invokes this BII by asking Assistant, *\"Hey\nGoogle, start a run in ExampleApp,\"* Assistant fulfills the user request using\ninformation provided in the nested `intent` element. The `intent` in this sample\ndefines the following details:\n\n- The `android:targetPackage` sets the target application package for this intent.\n- The `android:targetClass` field specifies the destination activity: `com.example.sampleApp.ExerciseActivity`.\n- The intent `parameter` declares support for a BII parameter [`exercise.name`](//developers.google.com/assistant/app/reference/built-in-intents/health-and-fitness/start-exercise#recommended-fields) and how to pass the parameter value---collected from the user---as extra data in the `intent`.\n\nAssociate shortcuts with a capability\n\nOnce you define a capability, you can extend its functionality by associating\nstatic or dynamic shortcuts with it. How shortcuts are linked to a `capability`\ndepends on the feature being implemented and the actual words included in a\nuser's request. For example, when a user begins a run in your fitness tracking\napp by asking Assistant, *\"Hey Google, start a run in ExampleApp.\"* Assistant\ncan use a shortcut to launch an instance of a `capability` that defines a valid\nexercise entity of \"run\" for the `exercise.name` parameter.\n\nFor more information about associating shortcuts to App Actions, see [App\nActions overview](//developers.google.com/assistant/app)."]]