দ্রষ্টব্য: Android 9.0 (API স্তর 28) প্রকাশের সাথে AndroidX নামে একটি সমর্থন লাইব্রেরির একটি নতুন সংস্করণ রয়েছে যা জেটপ্যাকের অংশ। অ্যান্ড্রয়েডএক্স লাইব্রেরিতে বিদ্যমান সমর্থন লাইব্রেরি রয়েছে এবং সর্বশেষ জেটপ্যাক উপাদানগুলিও রয়েছে৷
আপনি সমর্থন লাইব্রেরি ব্যবহার চালিয়ে যেতে পারেন. ঐতিহাসিক নিদর্শন (যার সংস্করণ 27 এবং তার আগের, এবং android.support.*
) Google Maven-এ উপলব্ধ থাকবে। যাইহোক, সমস্ত নতুন লাইব্রেরি উন্নয়ন AndroidX লাইব্রেরিতে ঘটবে।
আমরা সমস্ত নতুন প্রকল্পে AndroidX লাইব্রেরি ব্যবহার করার পরামর্শ দিই। আপনার বিদ্যমান প্রকল্পগুলিকে AndroidX এ স্থানান্তরিত করার বিষয়টিও বিবেচনা করা উচিত।
আপনি আপনার ডেভেলপমেন্ট প্রজেক্টে Android সাপোর্ট লাইব্রেরিগুলি কীভাবে সেটআপ করবেন তা নির্ভর করে আপনি কোন বৈশিষ্ট্যগুলি ব্যবহার করতে চান এবং আপনার অ্যাপ্লিকেশনের সাথে আপনি Android প্ল্যাটফর্মের সংস্করণগুলির কোন পরিসর সমর্থন করতে চান তার উপর।
এই নথিটি আপনাকে সহায়তা লাইব্রেরি প্যাকেজ ডাউনলোড করার এবং আপনার বিকাশের পরিবেশে লাইব্রেরি যোগ করার মাধ্যমে গাইড করে।
সমর্থন লাইব্রেরিগুলি এখন Google এর Maven সংগ্রহস্থলের মাধ্যমে উপলব্ধ। আমরা আর SDK ম্যানেজারের মাধ্যমে লাইব্রেরি ডাউনলোড করা সমর্থন করি না, এবং সেই কার্যকারিতা শীঘ্রই সরানো হবে..
সমর্থন লাইব্রেরি নির্বাচন
আপনার অ্যাপ্লিকেশনে একটি সমর্থন লাইব্রেরি যোগ করার আগে, আপনি কোন বৈশিষ্ট্যগুলি অন্তর্ভুক্ত করতে চান এবং সর্বনিম্ন Android সংস্করণগুলিকে সমর্থন করতে চান তা নির্ধারণ করুন৷ বিভিন্ন লাইব্রেরি দ্বারা প্রদত্ত বৈশিষ্ট্য সম্পর্কে আরও তথ্যের জন্য, সমর্থন লাইব্রেরি বৈশিষ্ট্যগুলি দেখুন।
সমর্থন লাইব্রেরি যোগ করা হচ্ছে
একটি সাপোর্ট লাইব্রেরি ব্যবহার করার জন্য, আপনাকে অবশ্যই আপনার ডেভেলপমেন্ট এনভায়রনমেন্টের মধ্যে আপনার অ্যাপ্লিকেশনের প্রকল্পের ক্লাসপাথ নির্ভরতা পরিবর্তন করতে হবে। আপনি ব্যবহার করতে চান এমন প্রতিটি সমর্থন লাইব্রেরির জন্য আপনাকে অবশ্যই এই পদ্ধতিটি সম্পাদন করতে হবে।
আপনার অ্যাপ্লিকেশন প্রকল্পে একটি সমর্থন লাইব্রেরি যোগ করতে:
- আপনার প্রকল্পের
settings.gradle
ফাইলে Google এর Maven সংগ্রহস্থল অন্তর্ভুক্ত করুন। dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must
// instead use:
//
// maven {
// url 'https://maven.google.com'
// }
}
}
- প্রতিটি মডিউলের জন্য যেখানে আপনি একটি সমর্থন লাইব্রেরি ব্যবহার করতে চান, মডিউলের
build.gradle
ফাইলের dependencies
ব্লকে লাইব্রেরি যোগ করুন। উদাহরণস্বরূপ, v4 core-utils লাইব্রেরি যোগ করতে, নিম্নলিখিত যোগ করুন: dependencies {
...
implementation "com.android.support:support-core-utils:28.0.0"
}
সতর্কতা: গতিশীল নির্ভরতা ব্যবহার করা (উদাহরণস্বরূপ, palette-v7:23.0.+
) অপ্রত্যাশিত সংস্করণ আপডেট এবং রিগ্রেশন অসঙ্গতি সৃষ্টি করতে পারে। আমরা সুপারিশ করি যে আপনি স্পষ্টভাবে একটি লাইব্রেরি সংস্করণ নির্দিষ্ট করুন (উদাহরণস্বরূপ, palette-v7:28.0.0
)।
সমর্থন লাইব্রেরি API ব্যবহার করে
সাপোর্ট লাইব্রেরি ক্লাস যেগুলি বিদ্যমান ফ্রেমওয়ার্ক API-গুলির জন্য সমর্থন প্রদান করে সেগুলির সাধারণত ফ্রেমওয়ার্ক ক্লাসের মতো একই নাম থাকে তবে android.support
ক্লাস প্যাকেজে অবস্থিত, বা একটি *Compat
প্রত্যয় রয়েছে।
সতর্কতা: সমর্থন লাইব্রেরি থেকে ক্লাস ব্যবহার করার সময়, নিশ্চিত হন যে আপনি উপযুক্ত প্যাকেজ থেকে ক্লাস আমদানি করেছেন। উদাহরণস্বরূপ, ActionBar
ক্লাস প্রয়োগ করার সময়:
- সাপোর্ট লাইব্রেরি ব্যবহার করার সময়
android.support.v7.app.ActionBar
। -
android.app.ActionBar
শুধুমাত্র API স্তর 11 বা উচ্চতর জন্য বিকাশ করার সময়।
দ্রষ্টব্য: আপনার অ্যাপ্লিকেশন প্রকল্পে সহায়তা লাইব্রেরি অন্তর্ভুক্ত করার পরে, আমরা দৃঢ়ভাবে সুপারিশ করি যে আপনি প্রকাশের জন্য আপনার অ্যাপটিকে সঙ্কুচিত করুন, অস্পষ্ট করুন এবং অপ্টিমাইজ করুন । অস্পষ্টতার সাথে আপনার সোর্স কোড সুরক্ষিত করার পাশাপাশি, সঙ্কুচিত করা আপনার অ্যাপ্লিকেশনে অন্তর্ভুক্ত যেকোন লাইব্রেরি থেকে অব্যবহৃত ক্লাসগুলি সরিয়ে দেয়, যা আপনার অ্যাপ্লিকেশনটির ডাউনলোড আকারকে যতটা সম্ভব ছোট রাখে।
কিছু সমর্থন লাইব্রেরি বৈশিষ্ট্য ব্যবহার করার জন্য আরও নির্দেশিকা Android বিকাশকারী প্রশিক্ষণ ক্লাস , গাইড এবং নমুনাগুলিতে সরবরাহ করা হয়েছে। স্বতন্ত্র সমর্থন লাইব্রেরি ক্লাস এবং পদ্ধতি সম্পর্কে আরও তথ্যের জন্য, API রেফারেন্সে android.support
প্যাকেজগুলি দেখুন।
ম্যানিফেস্ট ঘোষণা পরিবর্তন
আপনি যদি সমর্থন লাইব্রেরির সাথে Android API-এর পূর্ববর্তী সংস্করণে আপনার বিদ্যমান অ্যাপ্লিকেশনটির পশ্চাদমুখী সামঞ্জস্যতা বাড়ান, তাহলে আপনার অ্যাপ্লিকেশনের ম্যানিফেস্ট আপডেট করতে ভুলবেন না। বিশেষভাবে, আপনাকে ম্যানিফেস্টে <uses-sdk>
ট্যাগের android:minSdkVersion
উপাদানটি নতুন, নিম্ন সংস্করণ নম্বরে আপডেট করতে হবে, যেমনটি নীচে দেখানো হয়েছে:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
ম্যানিফেস্ট সেটিং Google Play কে বলে যে আপনার অ্যাপ্লিকেশানটি Android 4.0 (API লেভেল 14) এবং উচ্চতর ডিভাইসে ইনস্টল করা যেতে পারে।
আপনি যদি Gradle বিল্ড ফাইল ব্যবহার করেন, বিল্ড ফাইলের minSdkVersion
সেটিংস ম্যানিফেস্ট সেটিংসকে ওভাররাইড করে।
plugins {
id 'com.android.application'
}
android {
...
defaultConfig {
minSdkVersion 16
...
}
...
}
এই ক্ষেত্রে, বিল্ড ফাইল সেটিং Google Play কে বলে যে আপনার অ্যাপ্লিকেশনের ডিফল্ট বিল্ড ভেরিয়েন্ট Android 4.1 (API স্তর 16) এবং উচ্চতর ডিভাইসগুলিতে ইনস্টল করা যেতে পারে। বিল্ড ভেরিয়েন্ট সম্পর্কে আরও তথ্যের জন্য, বিল্ড সিস্টেম ওভারভিউ দেখুন।
দ্রষ্টব্য: আপনি যদি বেশ কয়েকটি সমর্থন লাইব্রেরি অন্তর্ভুক্ত করে থাকেন, তবে ন্যূনতম SDK সংস্করণটি অবশ্যই নির্দিষ্ট লাইব্রেরির যেকোনটির জন্য প্রয়োজনীয় সর্বোচ্চ সংস্করণ হতে হবে৷ উদাহরণস্বরূপ, যদি আপনার অ্যাপে v14 পছন্দ সমর্থন লাইব্রেরি এবং v17 Leanback লাইব্রেরি উভয়ই অন্তর্ভুক্ত থাকে, তাহলে আপনার ন্যূনতম SDK সংস্করণ 17 বা তার বেশি হতে হবে।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-27 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-27 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["**Note:** With the release of Android 9.0 (API level 28) there is\na new version of the support library called\n[AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack).\nThe AndroidX library\ncontains the existing support library and also includes the latest Jetpack components.\n\n\u003cbr /\u003e\n\n\nYou can continue to use the support library.\nHistorical artifacts (those versioned 27 and earlier, and packaged as `android.support.*`) will\nremain available on Google Maven. However, all new library development\nwill occur in the [AndroidX](/jetpack/androidx) library.\n\n\u003cbr /\u003e\n\n\nWe recommend using the AndroidX libraries in all new projects. You should also consider\n[migrating](/jetpack/androidx/migrate) existing projects to AndroidX as well.\n\nHow you setup the Android Support Libraries in your development project depends on what features\nyou want to use and what range of Android platform versions you want to support with your\napplication.\n\nThis document guides you through downloading the Support Library package and adding libraries\nto your development environment.\n\nThe support libraries are now available through Google's Maven\nrepository. We no longer support downloading the libraries through the SDK\nManager, and that functionality will be removed soon..\n\nChoosing Support Libraries\n\nBefore adding a Support Library to your application, decide what features you want to include\nand the lowest Android versions you want to support. For more information on the features\nprovided by the different libraries, see\n[Support Library Features](/tools/support-library/features).\n\nAdding Support Libraries\n\nIn order to use a Support Library, you must modify your application's project's\nclasspath dependencies within your development environment. You must perform this procedure for\neach Support Library you want to use.\n\nTo add a Support Library to your application project:\n\n1. Include Google's Maven repository in your project's `settings.gradle` file. \n\n ```groovy\n dependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n google()\n\n // If you're using a version of Gradle lower than 4.1, you must\n // instead use:\n //\n // maven {\n // url 'https://maven.google.com'\n // }\n }\n }\n ```\n2. For each module in which you want to use a Support Library, add the library in the `dependencies` block of the module's `build.gradle` file. For example, to add the v4 core-utils library, add the following: \n\n ```groovy\n dependencies {\n ...\n implementation \"com.android.support:support-core-utils:28.0.0\"\n }\n ```\n\n\n**Caution:** Using dynamic dependencies (for example,\n`palette-v7:23.0.+`) can cause unexpected version updates and\nregression incompatibilities. We recommend that you explicitly specify a\nlibrary version (for example, `palette-v7:28.0.0`).\n\nUsing Support Library APIs\n\nSupport Library classes that provide support for existing framework APIs typically have the\nsame name as framework class but are located in the `android.support` class packages,\nor have a `*Compat` suffix. \n**Caution:** When using classes from the Support Library, be certain you import\nthe class from the appropriate package. For example, when applying the `ActionBar`\nclass:\n\n- `android.support.v7.app.ActionBar` when using the Support Library.\n- `android.app.ActionBar` when developing only for API level 11 or higher.\n\n\n**Note:** After including the Support Library in your application project, we\nstrongly recommend that you [shrink, obfuscate, and optimize\nyour app](/studio/build/shrink-code) for release. In addition to protecting your source code with obfuscation, shrinking\nremoves unused classes from any libraries you include in your application, which keeps the\ndownload size of your application as small as possible.\n\nFurther guidance for using some Support Library features is provided in the Android developer\n[training classes](/training),\n[guides](/guide/components)\nand samples. For more information about the individual Support Library classes and methods, see\nthe [android.support](/reference/android/support/v4/app/package-summary) packages in the API reference.\n\nManifest Declaration Changes\n\nIf you are increasing the backward compatibility of your existing application to an earlier\nversion of the Android API with the Support Library, make sure to update your application's\nmanifest. Specifically, you should update the `android:minSdkVersion`\nelement of the [`\u003cuses-sdk\u003e`](/guide/topics/manifest/uses-sdk-element) tag in the manifest to the new, lower version number, as\nshown below: \n\n```xml\n \u003cuses-sdk\n android:minSdkVersion=\"14\"\n android:targetSdkVersion=\"23\" /\u003e\n```\n\nThe manifest setting tells Google Play that your application can be installed on devices with Android\n4.0 (API level 14) and higher.\n\nIf you are using Gradle build files, the `minSdkVersion` setting in the build file\noverrides the manifest settings. \n\n```groovy\nplugins {\n id 'com.android.application'\n}\n\nandroid {\n ...\n\n defaultConfig {\n minSdkVersion 16\n ...\n }\n ...\n}\n```\n\nIn this case, the build file setting tells Google Play that the default build variant of your\napplication can be installed on devices with Android 4.1 (API level 16) and higher. For more\ninformation about build variants, see\n[Build System Overview](/studio/build).\n\n\n**Note:** If you are including several support libraries, the\nminimum SDK version must be the *highest* version required by any of\nthe specified libraries. For example, if your app includes both the [v14 Preference Support library](/topic/libraries/support-library/features#v14-preference) and the\n[v17 Leanback library](/topic/libraries/support-library/features#v17-leanback), your minimum\nSDK version must be 17 or higher."]]