Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Le app meteo consentono agli utenti di visualizzare informazioni meteo pertinenti relative alla loro posizione attuale o lungo il percorso. Le app meteo possono anche fornire funzionalità di navigazione. Per maggiori dettagli sulla creazione di app di navigazione, consulta Creare app di navigazione per le auto.
Se la tua app può essere utilizzata anche per la navigazione, deve seguire anche le indicazioni riportate in Dichiarare il supporto della navigazione nel file manifest quando dichiari la sua categoria. Il filtro per intent utilizzato per dichiarare la categoria della tua app deve includere entrambe le categorie:
Le app meteo possono accedere a MapWithContentTemplate, che può essere utilizzato per visualizzare elenchi e altri tipi di contenuti insieme a una mappa visualizzata dalla tua app. Per ulteriori dettagli sull'utilizzo di questo modello, consulta Disegnare mappe.
Per accedere al modello, l'app deve dichiarare l'autorizzazione androidx.car.app.MAP_TEMPLATES o androidx.car.app.NAVIGATION_TEMPLATES nel file AndroidManifest.xml:
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],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."]]