با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برنامههای هواشناسی به کاربران اجازه میدهند اطلاعات مربوط به آبوهوای مربوط به مکان فعلی یا در طول مسیرشان را ببینند. برنامههای هواشناسی همچنین میتوانند قابلیتهای ناوبری را ارائه دهند - برای جزئیات بیشتر در مورد ساخت برنامههای ناوبری، به ساخت برنامههای ناوبری برای اتومبیلها مراجعه کنید.
اگر برنامه شما میتواند برای پیمایش نیز استفاده شود، هنگام اعلام دستهبندی، باید از راهنماییهای موجود در اعلام پشتیبانی پیمایش در مانیفست شما نیز پیروی کند. فیلتر قصد مورد استفاده برای اعلام دسته برنامه شما باید شامل هر دو دسته باشد:
برنامههای هواشناسی میتوانند به MapWithContentTemplate دسترسی داشته باشند، که میتواند برای نمایش فهرستها و انواع دیگر محتوا در کنار نقشهای که توسط برنامه شما ارائه میشود، استفاده شود. برای جزئیات بیشتر در مورد استفاده از این الگو به Draw maps مراجعه کنید.
برای دسترسی به الگو، برنامه شما باید مجوز androidx.car.app.MAP_TEMPLATES یا androidx.car.app.NAVIGATION_TEMPLATES را در فایل AndroidManifest.xml خود اعلام کند:
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Build a weather app\n\nWeather apps let users see relevant weather information related to their current\nlocation or along their route. Weather apps can also provide navigation\ncapabilities -- see [Build navigation apps for cars](/training/cars/apps/navigation) for more details on\nbuilding navigation apps.\n| **Design guidelines:** Refer to [Weather apps](https://developers.google.com/cars/design/create-apps/app-types/weather) for UX guidance specific to weather apps.\n\nDeclare the weather category in your manifest\n---------------------------------------------\n\nYour app must declare the `androidx.car.app.category.WEATHER`\n[car app category](/training/cars/apps#supported-app-categories) in the intent filter of its [`CarAppService`](/reference/androidx/car/app/CarAppService). \n\n \u003capplication\u003e\n ...\n \u003cservice\n ...\n android:name=\".MyCarAppService\"\n android:exported=\"true\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"androidx.car.app.CarAppService\" /\u003e\n \u003ccategory android:name=\"androidx.car.app.category.WEATHER\"/\u003e\n \u003c/intent-filter\u003e\n \u003c/service\u003e\n ...\n \u003capplication\u003e\n\n### Declare navigation support\n\nIf your app can also be used for navigation, it must also follow the\nguidance found at [Declare navigation support in your manifest](/training/cars/apps/navigation#declare-navigation-support) when\ndeclaring its category. The intent filter used to declare your app's category\nshould include both categories: \n\n \u003cintent-filter\u003e\n \u003caction android:name=\"androidx.car.app.CarAppService\" /\u003e\n \u003ccategory android:name=\"androidx.car.app.category.WEATHER\"/\u003e\n \u003ccategory android:name=\"androidx.car.app.category.NAVIGATION\"/\u003e\n \u003c/intent-filter\u003e\n\nImplement your app's functionality\n----------------------------------\n\nTo implement your app, refer to [Using the Android for Cars App Library](/training/cars/apps) on\nhow Car App Library apps are built. Also, be sure to familiarize yourself with\nthe [Car app quality guidelines for weather apps](/docs/quality-guidelines/car-app-quality?category=weather#app_categories), as your app will be\nreviewed against these guidelines.\n\n### Draw maps\n\nWeather apps can access the [`MapWithContentTemplate`](/reference/androidx/car/app/navigation/model/MapWithContentTemplate), which can be used to\ndisplay lists and other types of content alongside a map that is rendered by\nyour app. See [Draw maps](/training/cars/apps#draw-maps) for more details on using this template.\n| **Important:** Keep the [Weather Functionality](/docs/quality-guidelines/car-app-quality?category=weather#weather-functionality) quality guidelines in mind when determining what to render on a map\n\nTo access the template, your app needs to declare either the\n`androidx.car.app.MAP_TEMPLATES` or `androidx.car.app.NAVIGATION_TEMPLATES`\npermission in its `AndroidManifest.xml` file: \n\n \u003cmanifest ...\u003e\n ...\n \u003c!-- Use the MAP_TEMPLATES permission if your app doesn't provide navigation functionality --\u003e\n \u003cuses-permission android:name=\"androidx.car.app.MAP_TEMPLATES\"/\u003e\n\n \u003c!-- Use the NAVIGATION_TEMPLATES permission if your app provides navigation functionality --\u003e\n \u003cuses-permission android:name=\"androidx.car.app.NAVIGATION_TEMPLATES\"/\u003e\n ...\n \u003c/manifest\u003e\n\n| **Caution:** Don't include both the `androidx.car.app.MAP_TEMPLATES` and the `androidx.car.app.NAVIGATION_TEMPLATES` permissions in your manifest, or your app will be rejected during review."]]