فحص الرمز الشريطي
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.

باستخدام واجهة برمجة تطبيقات مسح الرموز الشريطية في ML Kit، يمكنك قراءة البيانات المرمّزة باستخدام معظم
تنسيقات الرموز الشريطية العادية. ويجري فحص الرموز الشريطية على الجهاز، ولا يتطلب اتصالاً بالشبكة.
الرموز الشريطية هي طريقة سهلة لتمرير المعلومات من الواقع إلى تطبيقك. وعلى وجه الخصوص، عند استخدام التنسيقات الثنائية الأبعاد مثل رمز الاستجابة السريعة، يمكنك ترميز البيانات المنظَّمة مثل معلومات الاتصال أو بيانات اعتماد شبكة WiFi. ونظرًا لأنّ
حزمة تعلّم الآلة يمكنها التعرّف تلقائيًا على هذه البيانات وتحليلها، يمكن أن يستجيب تطبيقك بشكل ذكي
عندما يمسح المستخدم ضوئيًا رمزًا شريطيًا.
بالنسبة إلى المستخدمين الذين لا يحتاجون إلى واجهة مستخدم مخصّصة، ننصح باستخدام أداة فحص رموز Google. تستخدم واجهة برمجة التطبيقات (API) الخاصة بماسح الرموز نموذج الاستنتاج نفسه المستخدم في واجهة برمجة التطبيقات الخاصة بفحص الرموز الشريطية، ولكنها لا تعرض سوى الرمز الشريطي الأكثر مركزيًا للحصول على تجربة أسرع وأكثر اتساقًا. يعد الماسح الضوئي للرموز من Google أيضًا أكثر أمانًا وبدون إذن، ولا يتطلب تنفيذًا أو أذونات ذات صلة بالكاميرا.
iOS
Android
الماسح الضوئي للرموز من Google
الإمكانات الرئيسية
- يقرأ معظم التنسيقات العادية
- التنسيقات الخطية: Codabar والرمز 39 والرمز 93 والرمز 128 وEAN-8 وEAN-13 وITF وUPC-A وUPPC-E
- التنسيقات الثنائية الأبعاد: Aztec، مصفوفة البيانات، PDF417، رمز الاستجابة السريعة
- الكشف التلقائي عن التنسيقات
- يمكنك إجراء مسح ضوئي لجميع تنسيقات الرمز الشريطي المتوافقة بدون الحاجة إلى تحديد التنسيق الذي تبحث عنه، أو تعزيز سرعة المسح من خلال حصر أداة الرصد على التنسيقات التي تهمّك فقط.
- استخراج البيانات المنظَّمة
- يتم تلقائيًا تحليل البيانات المنظَّمة التي يتم تخزينها باستخدام أحد التنسيقات الثنائية الأبعاد المتوافقة. وتشمل أنواع المعلومات المتاحة عناوين URL ومعلومات الاتصال وأحداث التقويم وعناوين البريد الإلكتروني وأرقام الهواتف ومطالبات الرسائل القصيرة SMS وأرقام ISBN ومعلومات اتصال Wi-Fi والموقع الجغرافي ومعلومات برنامج التشغيل العادية التي يستند إليها نظام AAMVA.
- إمكانية العمل مع أي اتجاه
- يتم التعرّف على الرموز الشريطية ومسحها ضوئيًا بغض النظر عن اتجاهها:
من اليمين إلى الأعلى أو مقلوبة أو جانبًا.
- يمكن تشغيله على الجهاز.
- يتم إجراء فحص الرمز الشريطي بالكامل على الجهاز ولا يتطلب
اتصالاً بالشبكة.
تجدر الإشارة إلى أنّ واجهة برمجة التطبيقات هذه لا تتعرّف على الرموز الشريطية بالتنسيقات التالية:
- رموز شريطية أحادية الأبعاد تتكون من حرف واحد فقط
- رموز شريطية بتنسيق ITF أقل من ستة أحرف، ومن المعروف أن هذا التنسيق غير مستقر بسبب عدم وجود المجموع الاختباري
- رموز شريطية تم ترميزها باستخدام FNC2 أو FNC3 أو FNC4
- رموز الاستجابة السريعة التي يتم إنشاؤها في وضع ECI
لا تتعرف واجهة برمجة التطبيقات هذه على أكثر من 10 رموز شريطية لكل استدعاء من واجهة برمجة التطبيقات.
أمثلة النتائج
|
النتيجة |
الزوايا |
(49,125)، (172,125)، (172,160)، (49,160) |
القيمة الأولية |
2404105001722 |
|
|
النتيجة |
الزوايا |
(87,87) (612,87) (612,612) (87,612) |
القيمة الأولية |
WIFI:S:SB1Guest;P:12345;T:WEP;; |
معلومات شبكة Wi-Fi |
معرّف مجموعة الخدمات (SSID) |
SB1Guest |
كلمة المرور |
12345 |
النوع |
WEP |
|
|
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-29 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-29 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eML Kit's Barcode Scanning API reads data from most standard barcode formats, including linear and 2D formats, without needing an internet connection.\u003c/p\u003e\n"],["\u003cp\u003eIt automatically detects and parses structured data like contact info, WiFi credentials, and more from supported 2D formats, enabling intelligent app responses.\u003c/p\u003e\n"],["\u003cp\u003eThe API works offline, recognizing barcodes in any orientation, and the Google Code Scanner offers a faster, safer, and permissionless option for basic scanning needs.\u003c/p\u003e\n"],["\u003cp\u003eWhile it supports a wide range of formats and data types, the API has limitations regarding certain 1D barcodes, ITF formats, and QR codes with specific encodings, recognizing a maximum of 10 barcodes per call.\u003c/p\u003e\n"]]],["ML Kit's barcode scanning API reads data from most standard barcode formats on the device without needing a network connection. It automatically detects and parses structured data from 2D formats like QR codes, recognizing information such as URLs, contact details, and WiFi credentials. The API supports various linear and 2D formats, works with any barcode orientation, and offers a Google code scanner option for a faster, safer, permission-less experience. It does not recognize some formats including some 1D and ITF barcodes.\n"],null,["With ML Kit's barcode scanning API, you can read data encoded using most\nstandard barcode formats. Barcode scanning happens on the device, and doesn't\nrequire a network connection.\n\nBarcodes are a convenient way to pass information from the real world to your\napp. In particular, when using 2D formats such as QR code, you can encode\nstructured data such as contact information or WiFi network credentials. Because\nML Kit can automatically recognize and parse this data, your app can respond\nintelligently when a user scans a barcode.\n\nFor users who don't require custom UI, we recommend using the\n[Google code scanner](/ml-kit/vision/barcode-scanning/code-scanner). The code\nscanner API uses the same inference model as the standard Barcode scanning API,\nbut returns only the most centralized barcode for a faster and more consistent\nexperience. Google code scanner is also safer and permission-less, and does not\nrequire camera-related implementation or permissions.\n\n[iOS](/ml-kit/vision/barcode-scanning/ios)\n[Android](/ml-kit/vision/barcode-scanning/android)\n[Google code scanner](/ml-kit/vision/barcode-scanning/code-scanner)\n\nKey capabilities\n\nReads most standard formats\n:\n - Linear formats: Codabar, Code 39, Code 93, Code 128, EAN-8, EAN-13, ITF, UPC-A, UPC-E\n - 2D formats: Aztec, Data Matrix, PDF417, QR Code\n\nAutomatic format detection\n: Scan for all supported barcode formats at once without having to specify\n the format you're looking for, or boost scanning speed by restricting the\n detector to only the formats you're interested in.\n\nExtracts structured data\n: Structured data that's stored using one of the supported 2D formats is\n automatically parsed. Supported information types include URLs,\n contact information, calendar events, email addresses, phone\n numbers, SMS message prompts, ISBNs, WiFi connection information,\n geographic location, and AAMVA-standard driver information.\n\nWorks with any orientation\n: Barcodes are recognized and scanned regardless of their orientation:\n right-side-up, upside-down, or sideways.\n\nRuns on the device\n: Barcode scanning is performed completely on the device, and doesn't\n require a network connection.\n\nNote that this API does not recognize barcodes in these forms:\n\n- 1D Barcodes with only one character\n- Barcodes in ITF format with fewer than six characters, and this format is known to be flaky due to absence of checksum\n- Barcodes encoded with FNC2, FNC3 or FNC4\n- QR codes generated in the ECI mode\n\nThis API recognizes no more than 10 barcodes per API call.\n\nExample results\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | | Result || |---------------|------------------------------------------| | **Corners** | (49,125), (172,125), (172,160), (49,160) | | **Raw value** | 2404105001722 | |\n\n|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | | Result || |----------------------|-----------------------------------------------------------------------------------------------------------------| | **Corners** | (87,87) (612,87) (612,612) (87,612) | | **Raw value** | `WIFI:S:SB1Guest;P:12345;T:WEP;;` | | **WiFi information** | |--------------|----------| | **SSID** | SB1Guest | | **Password** | 12345 | | **Type** | WEP | | |"]]