تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوفّر Android Health واجهات برمجة التطبيقات التالية لإنشاء تطبيقات الصحة واللياقة البدنية على مختلف أشكال الأجهزة: Health Connect والخدمات الصحية على نظام التشغيل Wear OS. يمكنك استخدام أحدها أو كليهما
لتجربة تطبيقك.
ويتضمّن مركز المطوّرين هذا إرشادات حول استخدام واجهات برمجة التطبيقات، كما يشمل نقاطًا إلى مراجع إضافية من نظام Android لمساعدتك في إنشاء تطبيقات للصحة واللياقة البدنية.
قراءة بيانات الصحة واللياقة البدنية على الجهاز وكتابتها باستخدام Health Connect
Health Connect هو نظام أساسي على Android يسمح لتطبيقات الصحة واللياقة البدنية بتخزين البيانات نفسها ومشاركتها على الجهاز ضمن منظومة متكاملة موحّدة. كما أنها توفر مكانًا واحدًا للمستخدمين للتحكم
في التطبيقات التي يمكنها قراءة بيانات الصحة واللياقة البدنية وكتابتها.
يتيح تطبيق Health Connect قراءة وكتابة أكثر من 50 نوعًا من البيانات المختلفة،
بدءًا من سرعة ركوب الدرّاجات ودرجة حرارة الجسم. إذا كنت بصدد إنشاء تطبيق جديد،
ننصحك باستخدام Health Connect.
الوصول إلى بيانات أجهزة الاستشعار العالية الجودة من خلال "الخدمات الصحية" على نظام التشغيل Wear OS
الخدمات الصحية على نظام التشغيل Wear OS هي واجهة برمجة تطبيقات تعمل وسيطًا لمختلف أدوات الاستشعار والخوارزميات ذات الصلة على أجهزة Wear OS. توفّر واجهة برمجة التطبيقات بيانات عالية الجودة للتطبيقات
المتعلقة بالنشاط والتمارين الرياضية والصحة بطريقة فعّالة من حيث استهلاك البطارية. تتوافق الخدمات مع الأجهزة التي تعمل بالإصدار 3 من Wear OS أو الإصدارات الأحدث، ما يعني أنّه عليك كتابة التطبيق مرة واحدة فقط، وستحرص "خدمات الصحة" على ضمان أداء التطبيق نفسه بغض النظر عن الجهاز.
لا يتوفّر تطبيق Health Connect إلا على أجهزة Android الجوّالة. مع ذلك، إذا كانت لديك مصادر بيانات أخرى مرتبطة بتطبيقك للأجهزة الجوّالة، مثل الأجهزة القابلة للارتداء، يمكنك استخدام تطبيقك على الأجهزة الجوّالة لتسهيل نقل البيانات من الجهاز القابل للارتداء إلى Health Connect، وبالتالي من Health Connect إلى الأجهزة القابلة للارتداء.
في الوقت الحالي، لا تتوفّر الخدمات الصحية إلا على أجهزة Wear OS التي تعمل بالإصدار 3 من Wear OS أو الإصدارات الأحدث. بالنسبة إلى جميع الأجهزة الأخرى، بما في ذلك الهواتف،
عليك الرجوع إلى مستندات SensorManager.
ربما تكون على دراية بواجهة برمجة تطبيقات Google Fit Android API التي تتيح العديد من الإجراءات المتعلّقة باللياقة البدنية، مثل قراءة البيانات في وقت قريب والبيانات السابقة وأنشطة التسجيل. تم وضع علامة متوقّفة نهائيًا على واجهة برمجة تطبيقات Google Fit Android. إذا كان تطبيقك يستخدم Google Fit Android API، راجِع دليل نقل البيانات للتعرّف على البدائل المتاحة للحفاظ على إمكانيات تطبيقك. يمكن تنفيذ العديد من الإجراءات التي يمكنك تنفيذها باستخدام واجهة برمجة تطبيقات Google Fit Android باستخدام واجهات برمجة التطبيقات Android Health. على سبيل المثال، يمكنك استخدام
واجهة برمجة التطبيقات للتسجيل على الأجهزة الجوّالة بدلاً من
واجهة برمجة التطبيقات لتسجيل Google Fit.
لتحديد واجهات برمجة التطبيقات التي يمكنك استخدامها، عليك الاطّلاع على أدلّة أنواع البيانات التالية
لمعرفة البيانات التي يمكنك قراءتها من Health Connect والبيانات التي يمكنك استخدامها لقراءتها من خلال "الخدمات الصحية" على أجهزة Wear OS:
تستخدم التجارب الأكثر اكتمالاً على أجهزة متعدّدة كلاً من "الخدمات الصحية" و"صحة Connect"
لتقديم أفضل قيمة للمستخدمين.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Get started with health on Android\n\nAndroid Health provides the following APIs to create health and\nfitness apps across form factors: [Health Connect](#health-connect) and\n[Health Services on Wear OS](#health-services). You can use one or both for your\napp experience.\n\nThis developer center includes guidance for using both APIs, and points to\nadditional resources from across Android to help you build health and fitness\napps.\n\n\u003cbr /\u003e\n\nRead and write on-device health and fitness data using Health Connect\n---------------------------------------------------------------------\n\n[Health Connect](/guide/health-and-fitness/health-connect) is an Android\nplatform that allows health and fitness apps to store and share the same\non-device data, within a unified ecosystem. It also offers a single place for\nusers to control which apps can read and write health and fitness data.\nHealth Connect supports reading and writing over 50 different data types,\nfrom cycling speed to body temperature. If you're building a new app, we\nrecommend you use Health Connect.\n\n[Get Started with Health Connect](/guide/health-and-fitness/health-connect)\n\nAccess high-quality sensor data with Health Services on Wear OS\n---------------------------------------------------------------\n\n[Health Services on Wear OS](/training/wearables/health-services)\nis an API that acts as an intermediary to the various sensors and related\nalgorithms on Wear OS devices. The API provides apps with high-quality data\nrelated to activity, exercise, and health, in a battery-efficient way. Health\nServices is consistent across devices running Wear OS 3 or higher, meaning you\nonly need to write your app once, and Health Services takes care of ensuring\nthe app performs the same, regardless of the device.\n\n[Get Started with Health Services](/training/wearables/health-services)\n\nAndroid Health across devices\n-----------------------------\n\n**Health Connect** is only available on Android mobile devices. However, if you\nhave other data sources connected to your mobile app, such as a wearable,\nyou can use your mobile app to facilitate the data transfer from the wearable\nto Health Connect and correspondingly from Health Connect to the wearable.\n| **Note:** Health Connect is not well-suited for providing live data, but rather storing and unifying data across apps and devices.\n\nAt this time, **Health Services** is only available for Wear OS\ndevices running Wear OS 3 or higher. For all other devices, including phones,\nyou should consult the documentation for [`SensorManager`](/reference/android/hardware/SensorManager).\n\n[Companion Device Manager](/guide/topics/connectivity/companion-device-pairing)\nand [Bluetooth connectivity](https://developer.android.com/guide/topics/connectivity/bluetooth)\nare additional options to connect companion devices that don't run Wear OS.\n\nYou might be familiar with the Google Fit Android API, which supports many\nfitness-related actions such as reading near-time and historic data and\nrecording activities. The Google Fit Android API has been\n[marked as deprecated](https://developers.google.com/fit/android). If your app\nuses the Google Fit Android API, consult the\n[migration guide](/guide/health-and-fitness/health-connect-guidelines/migrate/migration-guide)\nto learn about alternatives for maintaining your app's capabilities. Many of the\nactions you can perform with the Google Fit Android API can be done with Android\nHealth APIs. For example, you can use the\n[Recording API on mobile](/health-and-fitness/guides/recording-api) instead of\nthe Google Fit Recording API.\n\nTo plan out which APIs to use, you should consult the following data types\nguides to\nunderstand what data you could potentially read from Health Connect and what\ndata you could use Health Services to read from Wear OS devices:\n\n[Health Connect Data Types](/guide/health-and-fitness/health-connect/data-and-data-types/data-types)\n\n[Health Services Data Types](/reference/kotlin/androidx/health/services/client/data/DataType)\n\nThe most complete multidevice experiences use both Health Services and Health Connect\nto offer the most value for users.\n| **Note:** In order to read a particular data type from Health Connect back to your app, your user must have at least one app on-device that is writing that particular data type. For example, if you want to use heart rate in your mobile app and your app doesn't already measure heart rate, you need to rely on another app writing heart rate values to the Health Connect datastore in order to read heart rate data back."]]