תוכנית למשתמשים חדשים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
לאפליקציות רבות יש תהליך קליטה מותאם אישית, כמו הסבר על התכונות או בקשה לקבלת הסכמה מהמשתמשים. כדי לאפשר ל-Health Connect להפעיל את תהליך ההצטרפות, צריך להוסיף את הקטע הבא למניפסט:
<!-- Required to support pre-Android 14 devices with APK Health Connect -->
<activity
android:name=".OnboardingActivity"
android:exported="true"
android:permission="com.google.android.apps.healthdata.permission.START_ONBOARDING">
<intent-filter>
<action android:name="androidx.health.ACTION_SHOW_ONBOARDING"/>
</intent-filter>
</activity>
<!-- Required to support Android 14+ devices with platform Health Connect -->
<activity-alias
android:name="UAndAboveOnboardingActivity"
android:exported="true"
android:targetActivity=".OnboardingActivity"
android:permission="android.permission.health.START_ONBOARDING">
<intent-filter>
<action android:name="android.health.connect.action.SHOW_ONBOARDING" />
</intent-filter>
</activity-alias>
המשתמשים יכולים להתחיל את הקישור לאפליקציה שלכם ישירות מאפליקציית Health Connect, ולא מתוך האפליקציה שלכם. אם האפליקציה שלכם דורשת אינטראקציה נוספת מעבר להענקת הרשאה לקרוא או לכתוב נתונים, עליכם לספק פעילות קליטה.
תמיכה בגרסאות
כדי לתמוך גם במכשירים עם Android מגרסה 14 ואילך וגם במכשירים עם גרסאות ישנות יותר של Android:
הגישה המומלצת: יוצרים פעילות קליטה אחת שמטפלת בשני התרחישים. כדי לוודא את התאימות בגרסאות השונות של Android, אפשר להשתמש בכינוי לפעילות,כפי שמתואר בדוגמה.
גישה חלופית: מייצאים שתי פעילויות נפרדות, אחת לכל גרסה של Android. הגישה הזו עשויה להוביל לעלייה ברמת המורכבות של התחזוקה.
דרישות לגבי פעילות שיוצאת
כשמשתמש מנסה לקשר את האפליקציה שלכם ל-Health Connect, הפעילות המיוצאת מופעלת. הפעילות הזו צריכה לבצע את הפעולות הבאות:
- להציג חומר חינוכי רלוונטי למשתמשים, כמו הסבר על הנתונים שנכתבים או נקראים.
- אם צריך, מבקשים מהמשתמש להביע הסכמה.
- שולחים בקשת הרשאות ל-Health Connect.
- לבצע לוגיקה אחרת ספציפית לאפליקציה, כמו תזמון של עובד תקופתי.
- בסיום, מאפשרים למשתמש לסגור את הפעילות.
באפליקציות שלא מייצאות פעילות של קליטת משתמשים, כשהמשתמש מנסה לחבר את האפליקציה, Health Connect מעביר אותו למסך ניהול ההרשאות. יכול להיות שזה מתאים לאפליקציות שבהן ההרשאות שהמשתמשים מעניקים הן התנאי היחיד להפעלת השילוב.
חשוב לדעת: ייתכן שהפעילות של תהליך ההצטרפות תופעל יותר מפעם אחת, למשל אם המשתמש יבטל מאוחר יותר את ההרשאות לאפליקציה ולאחר מכן יקיש על 'התחברות'.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-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-07-27 (שעון UTC)."],[],[],null,["# Plan for onboarding users\n\nMany apps have a custom onboarding flow such as feature education or asking user\nconsent. To enable Health Connect to launch your onboarding flow, add the\nfollowing to your manifest: \n\n \u003c!-- Required to support pre-Android 14 devices with APK Health Connect --\u003e\n \u003cactivity\n android:name=\".OnboardingActivity\"\n android:exported=\"true\"\n android:permission=\"com.google.android.apps.healthdata.permission.START_ONBOARDING\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"androidx.health.ACTION_SHOW_ONBOARDING\"/\u003e\n \u003c/intent-filter\u003e\n \u003c/activity\u003e\n \u003c!-- Required to support Android 14+ devices with platform Health Connect --\u003e\n \u003cactivity-alias\n android:name=\"UAndAboveOnboardingActivity\"\n android:exported=\"true\"\n android:targetActivity=\".OnboardingActivity\"\n android:permission=\"android.permission.health.START_ONBOARDING\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.health.connect.action.SHOW_ONBOARDING\" /\u003e\n \u003c/intent-filter\u003e\n \u003c/activity-alias\u003e\n\nUsers may initiate the connection to your app directly from the Health\nConnect app, rather than from within your app. If your app requires any\nadditional interaction beyond being granted permission to read or write data,\nprovide an onboarding activity.\n\nVersion support\n---------------\n\nTo support both pre-Android 14 and Android 14+ devices:\n\n- **Recommended approach:** Create a single onboarding activity that handles\n both scenarios. Use an activity alias, as shown in the example,to verify\n compatibility across Android versions.\n\n- **Alternative approach:** Export two separate activities,\n one for each Android version. This approach may lead to increased maintenance\n complexity.\n\nExported activity requirements\n------------------------------\n\nWhen a user attempts to connect your app to Health Connect, the exported\nactivity is launched. This activity must do the following:\n\n- Display any relevant user education such as explaining what data is written or read.\n- Ask the user to grant consent if required.\n- Make a permissions request to Health Connect.\n- Carry out any other application specific logic such as scheduling a periodic worker.\n- Once complete, allow the user to dismiss the activity.\n\nFor apps that *don't* export an onboarding activity, Health Connect instead\nbrings the user to the **Manage permissions** screen once the user attempts to\nconnect the app. This may be acceptable for apps where permissions being\ngranted is the only prerequisite for the integration to function.\n\nNote that the onboarding activity may be launched more than once, for example if\nthe user later revokes permissions to your app and then reconnects it."]]