Skip to content

Latest commit

 

History

History
116 lines (81 loc) · 4.99 KB

README_en.md

File metadata and controls

116 lines (81 loc) · 4.99 KB

Kotlin Projects Logo WeatherAPP Kotlin Projects Logo

WeatherApp

english version app spanish version app russian version app

🌐 Português Español English Русский 中文 العربية

📜 Description

The WeatherApp is a simple Android application that allows users to search for real-time weather information for any city using the OpenWeather API. With a user-friendly interface, users can view the current temperature, feels-like temperature, humidity, and the time of the last weather update.

🌟 Features

  • Real-time weather search by city.
  • Displays the current temperature (in Celsius), feels-like temperature, humidity, and city name.
  • Minimalistic and user-friendly interface.
  • Customized toast for errors and messages.

🛠️ Technologies Used

  • Kotlin: Main language used for app development.
  • Coroutines: Used for asynchronous operations like requests to the weather API.
  • Retrofit: Library used for consuming RESTful APIs.
  • OpenWeather API: API used to obtain weather information.
  • Material Design: Android Material Design components for a visually appealing interface.
  • Customized Toast: To display more striking error messages.

⚙️ Project Setup

Prerequisites

- Android Studio 4.1 or higher.
- Gradle 7.0 or higher.
- An account on [OpenWeather API](https://openweathermap.org/api) to obtain an API key.

Installation

1. Clone the repository:
   ```bash
   git clone git@github.com:SamuelRocha91/kotlinWeatherApp.git
   ```

2. Open the project in **Android Studio**.

3. Add your OpenWeather API key in the `local.properties` file:
   ```
   API_KEY=your_api_key_here
   ```

4. Build and run the project on your emulator or Android device.

📂 Code Structure

  • MainActivity.kt: Main activity of the application that manages the interface and handles user interactions.
  • OpenWeather.kt: Interface that defines the calls to the weather API using Retrofit.
  • Utilities: Utility functions, such as converting Unix timestamp to a readable format, can be extracted and placed in a utility class.
  • Layouts: XML layout files defined in the res/layout folder, which include the structure of the user interface.

📦 Dependencies

  • implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
  • implementation "com.squareup.retrofit2:retrofit:2.9.0"
  • implementation "com.squareup.retrofit2:converter-gson:2.9.0"
  • implementation "com.google.android.material:material:1.4.0"

🧑‍🤝‍🧑 How to Use

  1. Open the app.
  2. Enter the name of a city in the search field.
  3. Click the "Search" button.
  4. View the weather information, including:
    • Current temperature.
    • Feels-like temperature.
    • Humidity.
    • City and country name.

📁 Other Kotlin Projects: