हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
GpsGeofencingInterface स्ट्रक्चर का रेफ़रंस
#include <
gps.h
>
GPS_Geofencing की सहायता के लिए बेहतर इंटरफ़ेस
परिभाषा,
gps.h
की लाइन
1361
पर दी गई है.
void(* add_geofence_area)(int32_t geofence_id, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms)
|
कोई जियोफ़ेंस जोड़ें. फ़िलहाल, यह एपीआई सर्कुलर जियोफ़ेंस के साथ काम करता है. पैरामीटर: geofence_id - जियोफ़ेंस का आईडी. अगर इस आईडी वाला कोई जियोफ़ेंस पहले से मौजूद है, तो गड़बड़ी की वैल्यू (GPS_GEOFENCE_ERROR_ID_EXISTS) दिखनी चाहिए. latitude, longtitude, radius_meters - जियोफ़ेंस के लिए अक्षांश, देशांतर, और त्रिज्या (मीटर में) last_transition - जियोफ़ेंस की मौजूदा स्थिति. उदाहरण के लिए, अगर सिस्टम को पहले से पता है कि उपयोगकर्ता जियोफ़ेंस के अंदर है, तो यह वैल्यू GPS_GEOFENCE_ENTERED पर सेट हो जाएगी. ज़्यादातर मामलों में, यह GPS_GEOFENCE_UNCERTAIN होगा. monitor_transition - किन ट्रांज़िशन को मॉनिटर करना है. GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, और GPS_GEOFENCE_UNCERTAIN के बिटवाइज़ OR. notification_responsiveness_ms - इससे यह पता चलता है कि
जियोफ़ेंस
से जुड़ा ट्रांज़िशन ट्रिगर होने पर, कॉलबैक को कितनी जल्दी कॉल किया जाना चाहिए. उदाहरण के लिए, अगर GPS_GEOFENCE_ENTERED के साथ 1,000 मिलीसेकंड पर सेट किया गया है, तो जियोफ़ेंस में प्रवेश करने के 1,000 मिलीसेकंड के अंदर कॉलबैक को कॉल किया जाना चाहिए. इस पैरामीटर की वैल्यू मिलीसेकंड में दी जाती है. ध्यान दें: इसे उस दर से न जोड़ें जिस पर जीपीएस को पोल किया जाता है. बैटरी बचाने के लिए, जीपीएस सैंपलिंग की दर को डाइनैमिक तौर पर बदला जा सकता है. इसलिए, सैंपलिंग की दर इससे ज़्यादा या कम हो सकती है. unknown_timer_ms - वह समयसीमा जिसके बाद UNCERTAIN ट्रांज़िशन ट्रिगर होना चाहिए. इस पैरामीटर की वैल्यू मिलीसेकंड में दी जाती है. ज़्यादा जानकारी के लिए ऊपर देखें.
परिभाषा,
gps.h
फ़ाइल की लाइन
1400
पर दी गई है.
यह जियोफ़ेंस इंटरफ़ेस खोलता है और इस इंटरफ़ेस को लागू करने के लिए कॉलबैक रूटीन उपलब्ध कराता है.
परिभाषा,
gps.h
फ़ाइल की लाइन
1369
पर दी गई है.
void(* pause_geofence)(int32_t geofence_id)
|
किसी खास जियोफ़ेंस को मॉनिटर करने की सुविधा रोकना. पैरामीटर: geofence_id - जियोफ़ेंस का आईडी.
परिभाषा,
gps.h
फ़ाइल की लाइन
1409
पर दी गई है.
void(* remove_geofence_area)(int32_t geofence_id)
|
जियोफ़ेंस वाला कोई इलाका हटाना. फ़ंक्शन के रिटर्न होने के बाद, कोई सूचना नहीं भेजी जानी चाहिए. पैरामीटर: geofence_id - जियोफ़ेंस का आईडी.
परिभाषा,
gps.h
फ़ाइल की लाइन
1429
पर दी गई है.
void(* resume_geofence)(int32_t geofence_id, int monitor_transitions)
|
किसी खास जियोफ़ेंस को मॉनिटर करना फिर से शुरू करना. पैरामीटर: geofence_id - यह जियोफ़ेंस का आईडी है. monitor_transitions - यह तय करता है कि किन ट्रांज़िशन को मॉनिटर करना है. GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, और GPS_GEOFENCE_UNCERTAIN का बिटवाइज़ OR. यह वैल्यू, add_geofence_area कॉल में दी गई वैल्यू की जगह ले लेती है.
परिभाषा,
gps.h
फ़ाइल की लाइन
1421
पर दी गई है.
sizeof(GpsGeofencingInterface) पर सेट करें
परिभाषा,
gps.h
फ़ाइल की लाइन
1363
पर दी गई है.
इस स्ट्रक्चर का दस्तावेज़, इस फ़ाइल से जनरेट किया गया था:
-
hardware/libhardware/include/hardware/
gps.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: GpsGeofencingInterface Struct Reference\n\nGpsGeofencingInterface Struct Reference\n=======================================\n\n[Data Fields](#pub-attribs) \nGpsGeofencingInterface Struct Reference \n\n`\n#include \u003c\n`[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)`\n\u003e\n`\n\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| size_t | [size](/reference/hal/struct_gps_geofencing_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| void(\\* | [init](/reference/hal/struct_gps_geofencing_interface#a4504d0e82b1d377fa32d56ec5004774f) )( [GpsGeofenceCallbacks](/reference/hal/struct_gps_geofence_callbacks) \\*callbacks) |\n| ||\n| void(\\* | [add_geofence_area](/reference/hal/struct_gps_geofencing_interface#add2c5bdb0d1496ac9ee6a2460fb12a08) )(int32_t geofence_id, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms) |\n| ||\n| void(\\* | [pause_geofence](/reference/hal/struct_gps_geofencing_interface#a850b900b8eabf9328ec853978936ed4f) )(int32_t geofence_id) |\n| ||\n| void(\\* | [resume_geofence](/reference/hal/struct_gps_geofencing_interface#af409f9b64a5b9b42a5417ae381fabc88) )(int32_t geofence_id, int monitor_transitions) |\n| ||\n| void(\\* | [remove_geofence_area](/reference/hal/struct_gps_geofencing_interface#a4cff265eb49bb5d94d9be5a4c55ceea7) )(int32_t geofence_id) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nExtended interface for GPS_Geofencing support\n\n\nDefinition at line\n[1361](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\nField Documentation\n-------------------\n\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void(\\* add_geofence_area)(int32_t geofence_id, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms) |\n\n\nAdd a geofence area. This api currently supports circular geofences. Parameters: geofence_id - The id for the geofence. If a geofence with this id already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) should be returned. latitude, longtitude, radius_meters - The lat, long and radius (in meters) for the geofence last_transition - The current state of the geofence. For example, if the system already knows that the user is inside the geofence, this will be set to GPS_GEOFENCE_ENTERED. In most cases, it will be GPS_GEOFENCE_UNCERTAIN. monitor_transition - Which transitions to monitor. Bitwise OR of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and GPS_GEOFENCE_UNCERTAIN. notification_responsiveness_ms - Defines 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 GPS_GEOFENCE_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. unknown_timer_ms - The time limit after which the UNCERTAIN transition should be triggered. This parameter is defined in milliseconds. See above for a detailed explanation.\n\n\nDefinition at line\n[1400](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|--------------------------------------------------------------------------------------------------|\n| void(\\* init)( [GpsGeofenceCallbacks](/reference/hal/struct_gps_geofence_callbacks) \\*callbacks) |\n\n\nOpens the geofence interface and provides the callback routines to the implementation of this interface.\n\n\nDefinition at line\n[1369](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|----------------------------------------------|\n| void(\\* pause_geofence)(int32_t geofence_id) |\n\n\nPause monitoring a particular geofence. Parameters: geofence_id - The id for the geofence.\n\n\nDefinition at line\n[1409](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|----------------------------------------------------|\n| void(\\* remove_geofence_area)(int32_t geofence_id) |\n\n\nRemove a geofence area. After the function returns, no notifications should be sent. Parameter: geofence_id - The id for the geofence.\n\n\nDefinition at line\n[1429](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|------------------------------------------------------------------------|\n| void(\\* resume_geofence)(int32_t geofence_id, int monitor_transitions) |\n\n\nResume monitoring a particular geofence. Parameters: geofence_id - The id for the geofence. monitor_transitions - Which transitions to monitor. Bitwise OR of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and GPS_GEOFENCE_UNCERTAIN. This supersedes the value associated provided in the add_geofence_area call.\n\n\nDefinition at line\n[1421](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|-------------|\n| size_t size |\n\n\nset to sizeof(GpsGeofencingInterface)\n\n\nDefinition at line\n[1363](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)"]]