पसंद के मुताबिक नेविगेशन का अनुभव
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Navigation SDK, आपके ऐप्लिकेशन में नेविगेशन की सुविधा को इंटिग्रेट करने के अलग-अलग तरीके उपलब्ध कराता है. इस पेज पर बताया गया है कि कस्टम नेविगेशन की सुविधा क्या होती है. साथ ही, यह भी बताया गया है कि यह सुविधा, Navigation SDK में उपलब्ध नेविगेशन की अन्य सुविधाओं से कैसे अलग है.
कस्टम नेविगेशन अनुभव क्या होता है?
Navigation SDK को लागू करने का मुख्य तरीका, Google
navigation
experience का इस्तेमाल करना है. इससे, रास्ते के दिशा-निर्देश देने की सुविधा को एम्बेड किया जा सकता है. यह सुविधा, Google के यूज़र इंटरफ़ेस (यूआई) एलिमेंट और विज़ुअल का इस्तेमाल करती है. यह Google Maps ऐप्लिकेशन में नेविगेशन की सुविधा की तरह ही होती है. अगर आपको Google नेविगेशन के अनुभव से ज़्यादा फ़्लेक्सिबिलिटी चाहिए, तो कस्टम नेविगेशन का अनुभव लागू किया जा सकता है.
कस्टम नेविगेशन का मतलब है कि टर्न के बारे में जानकारी देने वाली सुविधा को पूरी तरह से बंद कर दिया जाए और नेविगेशन को सिर्फ़ बैकग्राउंड प्रोसेस के तौर पर चलाया जाए. इसके अलावा, इसका मतलब यह भी है कि नेविगेशन की सुविधा चलाने वाले डिवाइस से अलग स्क्रीन पर, उपयोगकर्ता के हिसाब से तैयार की गई जानकारी दिखाई जाए. कस्टम नेविगेशन की सुविधा के ज़रिए, आपका ऐप्लिकेशन Navigation SDK को कॉल करता है. इससे उसे बारी-बारी से नेविगेशन फ़ीड का अनुरोध मिलता है. इसके बाद, आपको यूज़र इंटरफ़ेस (यूआई) एलिमेंट और विज़ुअल उपलब्ध कराने और उन्हें मैनेज करने होते हैं. ये वे एलिमेंट और विज़ुअल होते हैं जो उपयोगकर्ता को नेविगेशन के दौरान दिखते हैं. Google के नेविगेशन सिस्टम को लागू करना आम तौर पर आसान होता है. हालांकि, अपनी पसंद के मुताबिक नेविगेशन सिस्टम बनाने से, उसे ज़्यादा बेहतर बनाया जा सकता है.
अपनी पसंद के मुताबिक नेविगेशन की सुविधा बनाने पर, आपका ऐप्लिकेशन Navigation SDK को कॉल करता है. इससे नेविगेशन शुरू, चालू, और बंद किया जा सकता है. इसके लिए, यह तरीका अपनाया जाता है:
नेविगेट करना शुरू करें. Google नेविगेशन की तरह ही, कस्टम नेविगेशन में भी नेविगेशन इंस्टेंस बनाना और डेस्टिनेशन सेट करना शामिल होता है. हालांकि, नेविगेशन को पसंद के मुताबिक बनाने की सुविधा का इस्तेमाल करके, ऐसा किया जा सकता है. इसके लिए, सबसे पहले GMSNavigationService.createNavigationSession
का इस्तेमाल करके नेविगेशन सेशन शुरू करें. यह एक ऐसा नॉन-यूआई ऑब्जेक्ट है जो स्थिति के बारे में जानकारी देता है. यह व्यू कंट्रोलर के साथ या उसके बिना काम कर सकता है.
ज़्यादा जानकारी के लिए, टर्न-बाय-टर्न डेटा फ़ीड चालू करना लेख पढ़ें.
डेमो देखें: Navigation SDK टूल को डाउनलोड करने पर, आपको एक डेमो मिलता है. इसे चलाकर, नेविगेशन के अनुभव का एक उदाहरण देखा जा सकता है. इसमें, स्टैंडर्ड नेविगेशन के ज़रिए बारी-बारी से दिशा-निर्देश देने वाले नेविगेशन से लेकर, सिर्फ़ सड़क की पॉलीलाइन के साथ-साथ डिवाइस की जगह की जानकारी दिखाने वाले नेविगेशन के अनुभव के बीच स्विच किया जाता है.
नेविगेशन चालू है. Google की ओर से उपलब्ध कराए गए नेविगेशन के अनुभव और कस्टम नेविगेशन के अनुभव के बीच एक और अहम अंतर यहां दिया गया है.
Navigation SDK के बिल्ट-इन इवेंट मैनेजर को निर्देश देने के बजाय, आपको बारी-बारी से निर्देश देने की सुविधा चालू करनी होगी. साथ ही, इवेंट हैंडलर लागू करने होंगे. इससे आपका ऐप्लिकेशन, नेविगेशन इवेंट के लिए सुनना में बताए गए इवेंट के हिसाब से काम कर पाता है.
नेविगेशन बंद करें. Google नेविगेशन की तरह ही, कस्टम नेविगेशन के लिए भी आपको नेविगेशन को इस तरह से बंद करना होगा जिससे ऐप्लिकेशन का अनुभव बेहतर हो.
नेविगेशन के लिए, कस्टम अनुभव का इस्तेमाल कब किया जा सकता है?
यहां दी गई टेबल में, कस्टम नेविगेशन के कुछ उदाहरण दिए गए हैं.
उदाहरण |
सामान्य चरण |
आपको दोपहिया वाहनों जैसे छोटे डिवाइसों के लिए, सिर्फ़ टेक्स्ट के तौर पर ड्राइवर को निर्देश देने होंगे. |
नेविगेटर बनाएं और मोड़-दर-मोड़ निर्देशों को डेटा फ़ीड के तौर पर सेट अप करें, ताकि ड्राइवर की नज़रों से दूर, छोटी स्क्रीन वाले डिवाइस पर नेविगेटर चलता रहे. |
आपको अपने ऐप्लिकेशन को Android Auto का इस्तेमाल करने वाले ड्राइवर के लिए, कार सेवा के तौर पर उपलब्ध कराना हो. |
- कार सेवा सेट अप करें.
- Navigation SDK प्रोजेक्ट सेट अप करें.
- अगर आपने अब तक नेविगेटर सेट अप नहीं किया है, तो इसे सेट अप करें.
- मोड़-दर-मोड़ निर्देशों वाला फ़ीड चालू करें.
- ऑटो ऐप्लिकेशन की सतह पर मैप बनाएं और कॉन्फ़िगर किए गए डेटा फ़ीड से फ़ील्ड भरें.
ज़्यादा जानकारी के लिए, Android Auto के लिए नेविगेशन की सुविधा चालू करना लेख पढ़ें |
आपके ऐप्लिकेशन का इस्तेमाल करने वाले ड्राइवर, अपनी ज़्यादातर यात्रा के लिए एक खास मैप चाहते हैं. उन्हें शहर की सड़कों के लिए, सिर्फ़ कुछ दिशा-निर्देशों की ज़रूरत होती है. |
आपके ऐप्लिकेशन में, ड्राइवर को Google नेविगेशन की सुविधा को अपनी ज़रूरत के हिसाब से चालू और बंद करने की अनुमति होनी चाहिए. साथ ही, उसे डेस्टिनेशन और यात्रा के मोड के लिए नेविगेटर की सेटिंग में बदलाव करने की ज़रूरत नहीं पड़नी चाहिए. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-09-04 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-09-04 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe Navigation SDK offers both a pre-built Google navigation experience and the flexibility to create custom navigation experiences.\u003c/p\u003e\n"],["\u003cp\u003eCustom navigation experiences allow developers to manage UI elements, visuals, and event handling for a highly tailored user interface.\u003c/p\u003e\n"],["\u003cp\u003eThis customization ranges from background navigation to projecting guidance onto separate screens, giving developers more control.\u003c/p\u003e\n"],["\u003cp\u003eCustom experiences involve starting navigation, managing active navigation with event handlers, and ending navigation as needed.\u003c/p\u003e\n"],["\u003cp\u003eUse cases for custom navigation include text-only guidance, Android Auto integration, and dynamic switching between map views and turn-by-turn instructions.\u003c/p\u003e\n"]]],[],null,["# Custom navigation experience\n\nThe Navigation SDK provides different ways to integrate a navigation\nexperience into your app. This page explains what a custom navigation experience\nis and how it differs from other navigation experiences that are available in\nthe Navigation SDK.\n\nWhat is a custom navigation experience?\n---------------------------------------\n\nThe primary way to implement the Navigation SDK is to use the [Google\nnavigation\nexperience](/maps/documentation/navigation/android-sdk/intro-google-nav),\nwhich lets you embed a turn-by-turn navigation experience that uses\nGoogle-provided UI elements and visuals --- similar to the navigation experience\nwithin the Google Maps apps. If you need more flexibility than the Google\nnavigation experience offers, you can implement a custom navigation experience.\nA custom navigation experience refers to anything from eliminating turn guidance\nentirely with and running navigation only as a background process, to projecting\na highly customized guidance experience to a screen separate from the device\nthat runs the navigation. With a custom navigation experience, your app calls\nthe Navigation SDK to request a turn-by-turn navigation feed, and then\nyou provide and manage the UI elements and visuals that the user sees in the\nnavigation experience. While using the Google navigation experience is generally\neasier to implement, building your own custom navigation experience allows for\nmore customization.\n\nWhen you create a custom navigation experience, your app calls the Navigation\nSDK to start, run, and stop navigation, using the following flow:\n\n1. **Start navigation** . As with the Google navigation experience, a custom\n navigation experience still involves creating a navigation instance and\n setting the destination. However, with a customized navigation experience,\n you achieve this by first establishing a navigation session using\n `GMSNavigationService.createNavigationSession`, which is a state-bearing\n non-UI object that can operate either with a view controller, or without\n one.\n\n For more information, see [Enable turn-by-turn data\n feed](/maps/documentation/navigation/android-sdk/tbt-feed).\n\n **See the demo:** The download of the Navigation SDK contains a demo\n you can run to see an example of a navigation experience that switches\n between turn-by-turn guidance through standard navigation to a navigation\n experience that shows only the device location moving along a road\n polyline.\n2. **Active navigation** . Here is another key difference between a\n Google-provided navigation experience and a custom navigation experience.\n Instead of handing off guidance to the built-in event manager of the\n Navigation SDK, you enable the turn-by-turn feed and implement event\n handlers. This allows your experience to respond to the events described in\n [Listen for navigation\n events](/maps/documentation/navigation/android-sdk/events).\n\n3. **End navigation**. As with the Google navigation experience, custom\n navigation also requires you to terminate navigation in the manner best\n suited for the app's experience.\n\nWhen might you use a custom navigation experience?\n--------------------------------------------------\n\nThe following table describes some custom navigation scenarios.\n\n| **Example scenario** | **High-level steps** |\n|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| You need to provide text-only driver guidance for small devices such as 2-wheeled vehicles. | Create your navigator and set up the turn-by-turn guidance as a data feed to a small screen device while the navigator runs on the driver's mobile phone outside of their immediate view. |\n| You want to make your app available as a car service for drivers who use Android Auto. | 1. Set up the car service. 2. Set up your Navigation SDK project. 3. Establish a navigator if you haven't already. 4. Enable the turn-by-turn guidance feed. 5. Draw the map on the auto app surface and populate the fields from the data feed you configured. For more information, see [Enable Navigation for Android Auto](/maps/documentation/navigation/android-sdk/android-auto) |\n| Drivers using your app want an overview map for most of their journey, with only minimal turn-by-turn guidance for city streets. | Your app should allow drivers to enter and exit the Google navigation experience as they need, without alternating the navigator's settings for destination and trip mode. |"]]