Navigation SDK for Android 代码示例
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Navigation SDK for Android GitHub 上的示例代码库包含一些示例应用,可演示如何使用该 SDK。您可以导入并构建应用、添加 API 密钥、查看演示版,并以提供的示例代码为基础开发您的应用。该代码库包含两个示例应用:
- Map-sample,MapView 和 NavView 界面的展示:
android-navigation-samples/map-sample/
- Navigation-sample,基本导航体验:
android-navigation-samples /navigation-sample/
如需详细了解如何运行示例应用,请参阅试用演示。
Navigation SDK for Android Codelab
如需了解如何通过构建简单的 Android 应用来使用 Navigation SDK,请参阅 Navigation SDK for Android Codelab。
此 Codelab 提供了有关如何使用 Kotlin 实现 SDK 的分步指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Navigation SDK for Android provides sample apps on GitHub that demonstrate the use of the SDK, allowing developers to import, build, and explore the code.\u003c/p\u003e\n"],["\u003cp\u003eThe repository features two key samples: "Map-sample" focusing on MapView and NavView UI, and "Navigation-sample" showcasing the core navigation experience.\u003c/p\u003e\n"],["\u003cp\u003eA dedicated Codelab offers a step-by-step guide to build a simple Android app using the Navigation SDK with Kotlin, aiding developers in practical implementation.\u003c/p\u003e\n"]]],[],null,["# Navigation SDK for Android code samples\n\nThe Navigation SDK for Android [samples repository on\nGitHub](https://github.com/googlemaps-samples/android-navigation-samples)\nincludes sample apps that demonstrate the use of the SDK. You can import and\nbuild the apps, add your API key, view the demo, and use the sample code\nsupplied as a starting point for your app. The repository contains two sample\napps:\n\n- **Map-sample** , a showcase of the MapView and NavView UI: `android-navigation-samples/map-sample/`\n- **Navigation-sample** , The fundamental navigation experience: `android-navigation-samples /navigation-sample/`\n\nFor more information about running the sample apps, see [Try the\ndemo](/maps/documentation/navigation/android-sdk/try-demo).\n\nNavigation SDK for Android Codelab\n----------------------------------\n\nTo learn how to use the Navigation SDK by building a simple Android app, see the\n[Navigation SDK for Android\nCodelab](https://codelabs.developers.google.com/codelabs/maps-platform/navigation-sdk-101-android).\nThe Codelab provides a step-by-step guide for implementing the SDK using Kotlin."]]