A simple weather forecasting app built using Android Studio, Kotlin, Retrofit, Room, and Jetpack components. This app allows users to check the weather forecast for a specified city.
--Project Overview --Features --Technologies Used --Setup and Installation --Folder Structure --File Descriptions --License
This project is an Android application that fetches and displays weather data for a specified location. It demonstrates the use of the MVVM (Model-View-ViewModel) architecture, data binding, and a combination of REST API calls with Retrofit and local data storage using Room. It is designed to be an introductory project for learning weather APIs, app UI layouts, and Android architecture components.
--Fetches real-time weather data for a city using a weather API. --Displays temperature and weather conditions. --Follows MVVM architecture. --Stores weather data locally using Room Database. --UI designed with Jetpack Compose.
--Android Studio: Development Environment. --Kotlin: Programming language. --Retrofit: REST API integration. --Room: Local database storage. --Jetpack Components: Including ViewModel and LiveData. --GitHub: Version control.
--Clone the Repository: git clone https://github.com/leo10manyam/WeatherForecastApp.git cd WeatherForecastApp --Open the Project in Android Studio: Open Android Studio and select Open an Existing Project. Navigate to the cloned repository folder and select it. Configure the API Key: --Register on a weather API provider (e.g., OpenWeatherMap) to obtain an API key. Open WeatherRepository.kt and replace "https://api.example.com/" with the base URL of the weather API provider. Replace "your_api_key_here" in API calls with your actual API key. --Build and Run: Connect an Android device or launch an emulator. Run the app using Run > Run 'app' in Android Studio.
- MainActivity.kt : Entry point of the app. It initializes the WeatherViewModel and sets the UI content.
- WeatherViewModel.kt : Manages UI-related data and handles the communication between the Repository and UI components.
- WeatherRepository.kt : Handles data operations. Fetches weather data from the API and stores it in the Room database.
- ApiService.kt : Defines the interface for making API requests using Retrofit.
- WeatherResponse.kt : Data model for mapping the JSON response from the weather API.
- WeatherFragment.kt : The main UI fragment displaying the weather information.
- WeatherAdapter.kt : Optional adapter for displaying a list of weather items.
- activity_main.xml : Layout file for the main activity.
- fragment_weather.xml : Layout file for the weather fragment that displays city, temperature, and description.
- strings.xml : Contains text strings used in the app.
This project is licensed under the MIT License. See the LICENSE file for more information.
Contributions are welcome! Please submit pull requests for any improvements or new features.
For any questions or suggestions, feel free to contact me via email.