স্ক্রীন কল
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
যে ডিভাইসগুলি Android 10 (API স্তর 29) বা উচ্চতর চালায় সেগুলি আপনার অ্যাপটিকে সম্ভাব্য স্প্যাম কল হিসাবে ব্যবহারকারীর ঠিকানা বইতে নেই এমন নম্বরগুলি থেকে কলগুলি সনাক্ত করতে দেয়৷ ব্যবহারকারীরা স্প্যাম কলগুলি নিঃশব্দে প্রত্যাখ্যান করা বেছে নিতে পারেন। ব্যবহারকারীরা কল মিস করলে তাদের আরও স্বচ্ছতা প্রদান করতে, এই ব্লক করা কলগুলির তথ্য কল লগে লগ করা হয়। অ্যান্ড্রয়েড 10 এপিআই ব্যবহার করে কল স্ক্রীনিং এবং কলার আইডি কার্যকারিতা প্রদানের জন্য ব্যবহারকারীর কাছ থেকে READ_CALL_LOG
অনুমতি পাওয়ার প্রয়োজনীয়তা দূর করে।
আপনি কল স্ক্রিন করার জন্য একটি CallScreeningService
বাস্তবায়ন ব্যবহার করেন। নম্বরটি ব্যবহারকারীর যোগাযোগ তালিকায় না থাকলে যেকোনো নতুন ইনকামিং বা আউটগোয়িং কলের জন্য onScreenCall()
ফাংশনে কল করুন। আপনি কল সম্পর্কে তথ্যের জন্য Call.Details
অবজেক্ট চেক করতে পারেন। বিশেষত, getCallerNumberVerificationStatus()
ফাংশন অন্য নম্বর সম্পর্কে নেটওয়ার্ক প্রদানকারীর তথ্য অন্তর্ভুক্ত করে। যাচাইকরণের স্থিতি ব্যর্থ হলে, এটি একটি ভাল ইঙ্গিত যে কলটি একটি অবৈধ নম্বর বা একটি সম্ভাব্য স্প্যাম কল থেকে এসেছে৷
কোটলিন
class ScreeningService : CallScreeningService() {
// This function is called when an ingoing or outgoing call
// is from a number not in the user's contacts list
override fun onScreenCall(callDetails: Call.Details) {
// Can check the direction of the call
val isIncoming = callDetails.callDirection == Call.Details.DIRECTION_INCOMING
if (isIncoming) {
// the handle (e.g. phone number) that the Call is currently connected to
val handle: Uri = callDetails.handle
// determine if you want to allow or reject the call
when (callDetails.callerNumberVerificationStatus) {
Connection.VERIFICATION_STATUS_FAILED -> {
// Network verification failed, likely an invalid/spam call.
}
Connection.VERIFICATION_STATUS_PASSED -> {
// Network verification passed, likely a valid call.
}
else -> {
// Network could not perform verification.
// This branch matches Connection.VERIFICATION_STATUS_NOT_VERIFIED.
}
}
}
}
}
জাভা
class ScreeningService extends CallScreeningService {
@Override
public void onScreenCall(@NonNull Call.Details callDetails) {
boolean isIncoming = callDetails.getCallDirection() == Call.Details.DIRECTION_INCOMING;
if (isIncoming) {
Uri handle = callDetails.getHandle();
switch (callDetails.getCallerNumberVerificationStatus()) {
case Connection.VERIFICATION_STATUS_FAILED:
// Network verification failed, likely an invalid/spam call.
break;
case Connection.VERIFICATION_STATUS_PASSED:
// Network verification passed, likely a valid call.
break;
default:
// Network could not perform verification.
// This branch matches Connection.VERIFICATION_STATUS_NOT_VERIFIED
}
}
}
}
নতুন কলে কীভাবে সাড়া দিতে হবে তা সিস্টেমকে জানাতে respondToCall()
কল করতে onScreenCall()
ফাংশন সেট করুন। এই ফাংশনটি একটি CallResponse
প্যারামিটার নেয় যা আপনি সিস্টেমকে কলটি ব্লক করতে, ব্যবহারকারীর মতো এটি প্রত্যাখ্যান করতে বা নীরব করতে বলতে পারেন। আপনি সিস্টেমকে বলতে পারেন যে ডিভাইসের কল লগে এই কলটি সম্পূর্ণভাবে যোগ করা এড়িয়ে যেতে।
কোটলিন
// Tell the system how to respond to the incoming call
// and if it should notify the user of the call.
val response = CallResponse.Builder()
// Sets whether the incoming call should be blocked.
.setDisallowCall(false)
// Sets whether the incoming call should be rejected as if the user did so manually.
.setRejectCall(false)
// Sets whether ringing should be silenced for the incoming call.
.setSilenceCall(false)
// Sets whether the incoming call should not be displayed in the call log.
.setSkipCallLog(false)
// Sets whether a missed call notification should not be shown for the incoming call.
.setSkipNotification(false)
.build()
// Call this function to provide your screening response.
respondToCall(callDetails, response)
জাভা
// Tell the system how to respond to the incoming call
// and if it should notify the user of the call.
CallResponse.Builder response = new CallResponse.Builder();
// Sets whether the incoming call should be blocked.
response.setDisallowCall(false);
// Sets whether the incoming call should be rejected as if the user did so manually.
response.setRejectCall(false);
// Sets whether ringing should be silenced for the incoming call.
response.setSilenceCall(false);
// Sets whether the incoming call should not be displayed in the call log.
response.setSkipCallLog(false);
// Sets whether a missed call notification should not be shown for the incoming call.
response.setSkipNotification(false);
// Call this function to provide your screening response.
respondToCall(callDetails, response.build());
আপনাকে অবশ্যই ম্যানিফেস্ট ফাইলে CallScreeningService
ইমপ্লিমেন্টেশনটি যথাযথ উদ্দেশ্য ফিল্টার এবং অনুমতি সহ নিবন্ধন করতে হবে যাতে সিস্টেম এটিকে সঠিকভাবে ট্রিগার করতে পারে৷
<service
android:name=".ScreeningService"
android:permission="android.permission.BIND_SCREENING_SERVICE">
<intent-filter>
<action android:name="android.telecom.CallScreeningService" />
</intent-filter>
</service>
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-28 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-28 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["Devices that run Android 10 (API level 29) or higher allow your app to identify\ncalls from numbers that aren't in the user's address book as potential spam\ncalls. Users can choose to have spam calls silently rejected. To provide greater\ntransparency to users when they miss calls, information about these blocked\ncalls is logged in the call log. Using the Android 10 API eliminates the\nrequirement to obtain the\n[`READ_CALL_LOG`](/reference/android/Manifest.permission#READ_CALL_LOG)\npermission from the user in order to provide call screening and caller ID\nfunctionality.\n\nYou use a\n[`CallScreeningService`](/reference/android/telecom/CallScreeningService)\nimplementation to screen calls. Call the\n[`onScreenCall()`](/reference/android/telecom/CallScreeningService#onScreenCall(android.telecom.Call.Details))\nfunction for any new incoming or outgoing calls when the number is not in the\nuser's contact list. You can check the\n[`Call.Details`](/reference/android/telecom/Call.Details) object for information\nabout the call. Specifically, the\n[`getCallerNumberVerificationStatus()`](/reference/android/telecom/Call.Details#getCallerNumberVerificationStatus())\nfunction includes information from the network provider about the other number.\nIf the verification status failed, this is a good indication that the call is\nfrom an invalid number or a potential spam call. \n\nKotlin \n\n```kotlin\nclass ScreeningService : CallScreeningService() {\n // This function is called when an ingoing or outgoing call\n // is from a number not in the user's contacts list\n override fun onScreenCall(callDetails: Call.Details) {\n // Can check the direction of the call\n val isIncoming = callDetails.callDirection == Call.Details.DIRECTION_INCOMING\n\n if (isIncoming) {\n // the handle (e.g. phone number) that the Call is currently connected to\n val handle: Uri = callDetails.handle\n\n // determine if you want to allow or reject the call\n when (callDetails.callerNumberVerificationStatus) {\n Connection.VERIFICATION_STATUS_FAILED -\u003e {\n // Network verification failed, likely an invalid/spam call.\n }\n Connection.VERIFICATION_STATUS_PASSED -\u003e {\n // Network verification passed, likely a valid call.\n }\n else -\u003e {\n // Network could not perform verification.\n // This branch matches Connection.VERIFICATION_STATUS_NOT_VERIFIED.\n }\n }\n }\n }\n}\n```\n\nJava \n\n```java\nclass ScreeningService extends CallScreeningService {\n @Override\n public void onScreenCall(@NonNull Call.Details callDetails) {\n boolean isIncoming = callDetails.getCallDirection() == Call.Details.DIRECTION_INCOMING;\n\n if (isIncoming) {\n Uri handle = callDetails.getHandle();\n\n switch (callDetails.getCallerNumberVerificationStatus()) {\n case Connection.VERIFICATION_STATUS_FAILED:\n // Network verification failed, likely an invalid/spam call.\n break;\n case Connection.VERIFICATION_STATUS_PASSED:\n // Network verification passed, likely a valid call.\n break;\n default:\n // Network could not perform verification.\n // This branch matches Connection.VERIFICATION_STATUS_NOT_VERIFIED\n }\n }\n }\n}\n```\n\nSet the `onScreenCall()` function to call\n[`respondToCall()`](/reference/android/telecom/CallScreeningService#respondToCall(android.telecom.Call.Details,%20android.telecom.CallScreeningService.CallResponse))\nto tell the system how to respond to the new call. This function takes a\n[`CallResponse`](/reference/android/telecom/CallScreeningService.CallResponse)\nparameter that you can use to tell the system to block the call, reject it as if\nthe user did, or silence it. You can also tell the system to skip adding this\ncall to the device's call log altogether. \n\nKotlin \n\n```kotlin\n// Tell the system how to respond to the incoming call\n// and if it should notify the user of the call.\nval response = CallResponse.Builder()\n // Sets whether the incoming call should be blocked.\n .setDisallowCall(false)\n // Sets whether the incoming call should be rejected as if the user did so manually.\n .setRejectCall(false)\n // Sets whether ringing should be silenced for the incoming call.\n .setSilenceCall(false)\n // Sets whether the incoming call should not be displayed in the call log.\n .setSkipCallLog(false)\n // Sets whether a missed call notification should not be shown for the incoming call.\n .setSkipNotification(false)\n .build()\n\n// Call this function to provide your screening response.\nrespondToCall(callDetails, response)\n```\n\nJava \n\n```java\n// Tell the system how to respond to the incoming call\n// and if it should notify the user of the call.\nCallResponse.Builder response = new CallResponse.Builder();\n// Sets whether the incoming call should be blocked.\nresponse.setDisallowCall(false);\n// Sets whether the incoming call should be rejected as if the user did so manually.\nresponse.setRejectCall(false);\n// Sets whether ringing should be silenced for the incoming call.\nresponse.setSilenceCall(false);\n// Sets whether the incoming call should not be displayed in the call log.\nresponse.setSkipCallLog(false);\n// Sets whether a missed call notification should not be shown for the incoming call.\nresponse.setSkipNotification(false);\n\n// Call this function to provide your screening response.\nrespondToCall(callDetails, response.build());\n```\n\nYou must register the `CallScreeningService` implementation in the manifest\nfile with the appropriate intent filter and permission so the system can trigger\nit correctly. \n\n \u003cservice\n android:name=\".ScreeningService\"\n android:permission=\"android.permission.BIND_SCREENING_SERVICE\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.telecom.CallScreeningService\" /\u003e\n \u003c/intent-filter\u003e\n \u003c/service\u003e"]]