A simple Android app built with Kotlin that fetches and displays the current weather of any city using the OpenWeatherMap API.
- Enter any city name and get:
- Current temperature in °C
- Weather description
- Wind speed
- Simple UI with clean output
- Retrofit for network calls
- XML layout
- Error handling for invalid inputs
- Kotlin
- Android SDK
- Retrofit2
- OpenWeatherMap API
- ViewBinding (optional)
-
Clone this repository
git clone https://github.com/AnaghaSujith/Wthr-app.git
-
Open with Android Studio
-
Add your API key
- Go to MainActivity.kt
- Replace the placeholder with your OpenWeatherMap API key: -val API_KEY = "3a3fe9945a38edc37c34319214f993cd"
-
Run the app on emulator or physical device.
OpenWeatherMap API docs: https://openweathermap.org/current- You need an active internet connection to fetch weather data.
- Make sure your app has INTERNET permission in AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>