החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הסבר על המבנה GeofenceOptions
#include <
fused_location.h
>
המצב הנוכחי של הגדרת הגבול הגיאוגרפי. לדוגמה, אם המערכת כבר יודעת שהמשתמש נמצא בתוך הגדרת הגבול הגיאוגרפית, הערך יהיה FLP_GEOFENCE_TRANSITION_ENTERED. ברוב המקרים, הערך יהיה FLP_GEOFENCE_TRANSITION_UNCERTAIN.
ההגדרה מופיעה בשורה
720
בקובץ
fused_location.h
.
מעברים למעקב. או בינארי של FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED ו-FLP_GEOFENCE_TRANSITION_UNCERTAIN.
ההגדרה מופיעה בשורה
727
בקובץ
fused_location.h
.
int notification_responsivenes_ms
|
התיאור של המאמץ הטוב ביותר לזמן שבו צריך להפעיל את קריאת החזרה (callback) כשהמעבר שמשויך ל-
Geofence
מופעל. לדוגמה, אם מגדירים את הערך ל-1,000 אלפיות השנייה עם FLP_GEOFENCE_TRANSITION_ENTERED, צריך להפעיל את הפונקציה הלא חוזרת 1,000 אלפיות השנייה לאחר הכניסה למתחם הגיאופסי. הפרמטר הזה מוגדר באלפיות שנייה. הערה: אין לבלבל בין התדירות הזו לבין התדירות שבה מתבצע הסקרים של ה-GPS. מותר לשנות באופן דינמי את קצב הדגימה של ה-GPS מסיבות של חיסכון באנרגיה, כך שקצב הדגימה עשוי להיות מהיר או איטי יותר.
ההגדרה מופיעה בשורה
741
בקובץ
fused_location.h
.
המקורות שבהם נעשה שימוש למעקב אחרי אזורי הגנה גיאוגרפיים. הוא ביטוי OR בינארי של הדגלים FLP_TECH_MASK.
ההגדרה מופיעה בשורה
753
בקובץ
fused_location.h
.
מגבלת הזמן שאחריה המעבר לסטטוס UNCERTAIN אמור להופעל. הפרמטר הזה מוגדר באלפיות שנייה.
ההגדרה מופיעה בשורה
747
בקובץ
fused_location.h
.
התיעוד של המבנה הזה נוצר מהקובץ הבא:
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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,["# Android Hardware Abstraction Layer: GeofenceOptions Struct Reference\n\nGeofenceOptions Struct Reference\n================================\n\n[Data Fields](#pub-attribs) \nGeofenceOptions Struct Reference \n\n`\n#include \u003c\n`[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)`\n\u003e\n`\n\n|----------|-----------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| int | [last_transition](/reference/hal/struct_geofence_options#ac9f3044df5a350d9a141c36631daa4d8) |\n| ||\n| int | [monitor_transitions](/reference/hal/struct_geofence_options#a0c48726615ba0e8f18e47cbe3d6e7873) |\n| ||\n| int | [notification_responsivenes_ms](/reference/hal/struct_geofence_options#a759888e878e11256a8021d3cd3d8e12a) |\n| ||\n| int | [unknown_timer_ms](/reference/hal/struct_geofence_options#a2d1b6a36f124a618cbebc3f79977233b) |\n| ||\n| uint32_t | [sources_to_use](/reference/hal/struct_geofence_options#a352dd652f7b9c6033433ad53089fe281) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\n[Geofence](/reference/hal/struct_geofence)\nOptions\n\n\nDefinition at line\n[714](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\nField Documentation\n-------------------\n\n\n|---------------------|\n| int last_transition |\n\n\nThe current state of the geofence. For example, if the system already knows that the user is inside the geofence, this will be set to FLP_GEOFENCE_TRANSITION_ENTERED. In most cases, it will be FLP_GEOFENCE_TRANSITION_UNCERTAIN.\n\n\nDefinition at line\n[720](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|-------------------------|\n| int monitor_transitions |\n\n\nTransitions to monitor. Bitwise OR of FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED and FLP_GEOFENCE_TRANSITION_UNCERTAIN.\n\n\nDefinition at line\n[727](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|-----------------------------------|\n| int notification_responsivenes_ms |\n\n\nDefines the best-effort description of how soon should the callback be called when the transition associated with the\n[Geofence](/reference/hal/struct_geofence)\nis triggered. For instance, if set to 1000 millseconds with FLP_GEOFENCE_TRANSITION_ENTERED, the callback should be called 1000 milliseconds within entering the geofence. This parameter is defined in milliseconds. NOTE: This is not to be confused with the rate that the GPS is polled at. It is acceptable to dynamically vary the rate of sampling the GPS for power-saving reasons; thus the rate of sampling may be faster or slower than this.\n\n\nDefinition at line\n[741](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|-------------------------|\n| uint32_t sources_to_use |\n\n\nThe sources to use for monitoring geofences. Its a BITWISE-OR of FLP_TECH_MASK flags.\n\n\nDefinition at line\n[753](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|----------------------|\n| int unknown_timer_ms |\n\n\nThe time limit after which the UNCERTAIN transition should be triggered. This paramter is defined in milliseconds.\n\n\nDefinition at line\n[747](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)"]]