החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
פיתוח אפליקציות בלי ספריית ממשק המשתמש שברכב
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
ספריית ממשק המשתמש שברכב (car-ui-library) היא ספרייה עקבית של ממשק משתמש לכלי רכב, ש-OEM יכולים להתאים אישית. Google ממליצה מאוד להשתמש ב-car-ui-library כדי ליצור את האפליקציה. אם אין אפשרות לעשות זאת, יש שתי חלופות:
- החל מגרסה 12 של Android, אפשר להשתמש ב-
car-rotary-lib
, קבוצת משנה של car-ui-library.
- ב-Android 11, חובה להטמיע את
FocusParkingView
, FocusArea
ו-DirectManipulationHelper
שלכם כפי שמתואר בהמשך.
הטמעת FocusParkingView
אפשר להטמיע FocusParkingView
משלכם או להעתיק את המחלקה מ-car-ui-library לפרויקט.
כדי להטמיע את FocusParkingView
:
- קודים את שם הכיתה של הנגישות כך ש-
RotaryService
יוכל לזהות אותו:
@Override
public CharSequence getAccessibilityClassName() {
return "com.android.car.ui.FocusParkingView";
}
הטמעת FocusArea
בדומה ל-FocusParkingView
, אפשר להטמיע FocusArea
משלכם או להעתיק את המחלקה מ-car-ui-library לפרויקט.
כדי להטמיע את FocusArea
:
- קודים ב-hard code את שם סיווג הנגישות כדי ששירות ה-rotary יוכל לזהות אותו:
@Override
public CharSequence getAccessibilityClassName() {
return "com.android.car.ui.FocusArea";
}
הטמעת DirectManipulationHelper
זוהי סיווג שירות. אפשר להעתיק את הכיתה מ-car-ui-library לפרויקט.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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,["# Develop apps without the Car UI library\n\nThe\n[Car UI Library (car-ui-library)](/docs/automotive/hmi/car_ui)\nis a self-consistent automotive UI library that can be customized by OEMs. Google strongly\nrecommends you use the car-ui-library to create your app. If this isn't feasible, there are\ntwo alternatives:\n\n- From Android 12, you can use `car-rotary-lib`, a subset of car-ui-library.\n- On Android 11, you MUST implement your own `FocusParkingView`, `FocusArea`, and `DirectManipulationHelper` as described below.\n\nImplement FocusParkingView\n--------------------------\n\nYou either can implement your own `FocusParkingView` or copy the class from the\ncar-ui-library to your project.\n\nTo implement `FocusParkingView`:\n\n1. Hard code the accessibility class name so that the `RotaryService` can recognize it: \n\n ```\n @Override\n public CharSequence getAccessibilityClassName() {\n return \"com.android.car.ui.FocusParkingView\";\n }\n ```\n\nImplement FocusArea\n-------------------\n\nLike `FocusParkingView`, you can either implement your own `FocusArea`\nor copy the class from the car-ui-library to your project.\n\nTo implement `FocusArea`:\n\n1. Hard code the accessibility class name so that rotary service can recognize it: \n\n ```\n @Override\n public CharSequence getAccessibilityClassName() {\n return \"com.android.car.ui.FocusArea\";\n }\n ```\n\nImplement DirectManipulationHelper\n----------------------------------\n\nThis is a utility class. You can copy the class from the car-ui-library to your project."]]