Skip to content

mdmasum-shuvo/weather-api-jetpack-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌦 Weather App Features

1. Weather Based on Current Location

  • Automatically detects the user's location using device GPS.
  • Fetches real-time weather data for the current location.
  • Displays:
    • Temperature
    • Location
    • Icon
    • Weather conditions (e.g., sunny, cloudy, rainy)

2. Search Weather by Location

  • Location List: Provides a preloaded list of districts (zilla list) for easy location search.
  • Search Functionality: Allows users to search for weather details by district name.
    • Real-time search to narrow down district names as the user types.

3. Backstack Navigation

  • Efficient backstack management:
  • Users can navigate back to the main weather screen from the search screen.
  • Preserves the selected location and displays the weather for that location.

Configuration Change Management

  • Handles configuration changes, such as screen rotation, without losing data or state.
  • Uses ViewModel to retain UI-related data across configuration changes.
  • Leverages Jetpack Compose's declarative UI to automatically recompose views as needed.

🚀 Technologies Used

This app is built using modern Android development tools and practices:

  • Jetpack Compose: For building declarative and responsive UI.
  • ViewModel: To manage UI-related data in a lifecycle-aware way.
  • MVVM Architecture: For separating concerns and ensuring maintainability.
  • Koin: A lightweight dependency injection framework for managing app dependencies.
  • Ktor: For making efficient and structured API calls.
  • Coroutines: For managing asynchronous tasks smoothly and ensuring responsiveness.

🌐 API Usage Instructions

Step 1: Get an API Key

  1. Visit the website of the weather API provider (e.g., OpenWeatherMap).
  2. Sign up for an account and obtain your API key.
  3. Keep the API key secure as it is required to make API requests.

Step 2: Configure the API Key and Base URL

  1. Open the local.properties file in your project (located in the root directory).
  2. Add the following entries:

weather_api_key=your_api_key_here
base_url=https://api.openweathermap.org/data/2.5/
  1. Replace your_api_key_here with the API key you obtained.
  2. Clean and build the project.

📷 Screenshots

🎥 App Demonstration Video

Watch the demonstration video of the Weather App in action:

Watch the video

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages