Question: Objective This assignment will help students integrate Google Maps SDK with Jetpack Compose, dynamically handle markers, fetch and update weather data for specific locations, manage
Objective
This assignment will help students integrate Google Maps SDK with Jetpack Compose, dynamically handle markers, fetch and update weather data for specific locations, manage local storage, and display routes using Google Maps. The app will consist of two main screens:
Map Screen: Users can interact with the map, add markers, fetch and save weather data for specific locations.
List Screen: Users can view saved locations with weather details and see routes to a selected location.
Automated Weather Updates: Synchronize weather data for saved locations periodically using WorkManager.
Features and Implementations
Google Maps SDK:
Integrate the Google Maps SDK with Jetpack Compose.
Display a map in the app.
Markers and Weather Data:
On a longtap on the map:
Add a marker dynamically at the tapped location.
Fetch weather information for the tapped latitude and longitude using a weather API eg OpenWeatherMap API
Save the marker's latitude, longitude, and weather information eg temperature, condition to a local database Room
Show a toast or dialog displaying the fetched weather details after the marker is added.
Weather Data Sync Using WorkManager:
Use the WorkManager API to periodically sync and update weather data for all saved locations in the local database.
Weather updates should occur in the background even if the app is not open.
Notify the user when new weather data is updated for any location using a system notification.
Local Database:
Use Room to store:
Marker details: latitude, longitude, and a custom name optional
Weather data: temperature, weather condition, and timestamp.
Ensure data persists across app sessions.
List Screen:
Retrieve saved marker data including weather details from the database and display it in a Compose LazyColumn.
Display the markers name, weather condition, temperature, and last updated timestamp in the list.
On clicking an item:
Navigate back to the map.
Display a route from the user's current location to the selected marker location.
Route Display:
Use Google Maps Directions API to calculate and show the route.
Use the users current location as the starting point and the selected marker as the destination.
Draw the route on the map using a polyline.
UI:
Ensure the UI is clean and userfriendly.
Use Material Design components for buttons, lists, and dialogs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
