0% found this document useful (0 votes)
80 views17 pages

Weather App Micro-Project Report

The document is a micro-project report on a Weather App developed for Android, which provides real-time weather data using the OpenWeatherMap API. The app features a user-friendly interface that allows users to input city names or use GPS for location detection, displaying key weather metrics and supporting temperature unit conversion. It demonstrates key Android development concepts, including API integration, JSON data parsing, and error handling, making it a practical example of mobile app development.

Uploaded by

shirinofficially
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views17 pages

Weather App Micro-Project Report

The document is a micro-project report on a Weather App developed for Android, which provides real-time weather data using the OpenWeatherMap API. The app features a user-friendly interface that allows users to input city names or use GPS for location detection, displaying key weather metrics and supporting temperature unit conversion. It demonstrates key Android development concepts, including API integration, JSON data parsing, and error handling, making it a practical example of mobile app development.

Uploaded by

shirinofficially
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A

MICRO-PROJECT REPORT

ON
WEATHER APP

SUBMITTED TO

MSBTE

IN PARTIAL FULFILMENT OF REQUIREMENT OF DIPLOMA OF


COMPUTER ENGINEERING

UNDER I SCHEME

SUBMITTED BY

MS. SAVANI SHASHIKANT JADHAV.


MS. CHITRA DEU TATE
MS. SHIRIN ANWAR SHAIKH.
MS. SHREYA SHIRISHKUMAR RANE.

UNDER GUIDENCE OF

MR. A. S. PADWAL.

FOR ACADEMIC YEAR 2024-25


YASHWANTRAO BHONSALE INSTITUTE OF TECHNOLOGY,
SAWANTWADI.
MAHARASTRA STATE BOARD OF TECHNICAL ENDUCATION

This is to certify that, Roll No


Ms. Savani Shashikant Jadhav. Roll no - 62
Ms. Chitra Deu Tate. Roll no - 67
Ms. Shirin Anwar Shaikh. Roll no - 72
Ms. Shreya Shirishkumar Rane. Roll no – 82

Of SIXTH semester of diploma in COMPUTER ENGINEERING Of


institute YASHWANTRAO BHONSALE INSTITUTE OF TECHNOLOGY (1742)
has Completed the Microproject satisfactorily in subject MOBILE APPLICATION
DEVELOPMENT (22617) for the academic year 2024 to 2025 as prescribed in the
curriculum.

Subject Teacher Head of Department Principal

Seal Of

Institute
INDEX

Sr. No. Topic Name Page No.

1. ABSTRACT 1

2. INTRODUCTION 2

3. FEATURES 3

4. ADVANTAGES 4

5. DESIGN 5

6. CODE 6-11

7. OUTPUT 12

8. CONCLUSION 13

9. REFERENCES 14
Computer Engineering Weather App

1. ABSTRACT:

The Weather App developed in Android Studio provides users with real-time weather data for any
city globally, leveraging the OpenWeatherMap API. The primary objective of this application is to
offer a seamless and intuitive way for users to access up-to-date weather information, including key
metrics such as temperature, humidity, wind speed, and detailed weather conditions (e.g., sunny,
rainy, cloudy). By allowing users to input the name of a city or use their current location, the app
retrieves weather data dynamically and displays it in a clean, visually engaging format. The user
interface presents weather data using intuitive icons for different weather conditions and provides an
option to switch between Celsius and Fahrenheit units for temperature.

Built using Android Studio, the app is developed using Kotlin (or Java) as the programming language
and utilizes Retrofit for making HTTP requests to the weather API. The app processes the weather
data, which is returned in JSON format, using libraries such as Gson or Moshi for efficient JSON
parsing. The application also incorporates robust error handling, ensuring users are notified of issues
like incorrect city names, connectivity problems, or any failure in fetching the weather data.

In terms of functionality, the app supports dynamic updates, meaning users can get the latest weather
conditions every time they search for a new city or refresh the page. This app is designed to be
lightweight yet effective, ensuring quick and accurate data retrieval, even with varying network
conditions. Additionally, the app’s user interface is optimized for ease of use, with simple navigation
and responsive design. Through this project, key Android development concepts such as working
with external APIs, parsing JSON data, handling network operations, managing UI updates, and
implementing error handling mechanisms are demonstrated. This weather app not only serves as a
useful tool for checking weather conditions but also provides a practical example of mobile app
development using modern Android practices.

Yashwantrao Bhonsale Institute Of Technology 1|Page


Computer Engineering Weather App

2. INTRODUCTION:

This project involves the creation of a weather application for Android that allows users to access
real-time weather data for any city worldwide. The primary goal is to provide a user-friendly
interface where users can input the name of a city and retrieve current weather details, such as
temperature, humidity, wind speed, and a weather description (sunny, rainy, cloudy, etc.). The app
leverages a third-party weather API, such as Open Weather Map, to gather the necessary data and
display it in a visually appealing and informative manner. The app is designed to ensure a seamless
user experience, including the ability to switch between different temperature units (Celsius and
Fahrenheit), and offers features like error handling for invalid inputs or connectivity issues.
Additionally, the weather information is updated dynamically, ensuring that users are always
presented with the latest available data.

Android Studio is used as the development environment, with Kotlin (or Java) as the programming
language of choice for the app's backend logic. The app communicates with the weather API over the
internet to fetch weather data in the form of a JSON response. Libraries such as Retrofit or Volley are
used to handle HTTP requests, while Gson or Moshi are employed for parsing the JSON data into
Kotlin objects for easier manipulation. To enhance the user interface, elements such as ImageViews
are used to display weather icons representing different weather conditions, and TextViews are used
to show weather parameters like temperature, wind speed, and humidity. The app also implements
proper error handling, alerting users to issues like incorrect city names or problems with network
connectivity.

Through this project, users will not only be able to get up-to-date weather information but will also
experience an intuitive design and responsive UI. By integrating third-party APIs, handling JSON
data, and optimizing network requests, this weather app serves as a comprehensive Android project
that showcases key mobile development skills. Additionally, it provides a practical example of using
external APIs to enhance app functionality, ensuring users can interact with live, real-time data.

Yashwantrao Bhonsale Institute Of Technology 2|Page


Computer Engineering Weather App

3. FEATURES:

The Weather App offers a wide array of features aimed at providing users with an intuitive, efficient,
and dynamic way to access real-time weather information. One of the key features of the app is its
ability to fetch weather data from the OpenWeatherMap API, which provides comprehensive details
about the current weather conditions in any city across the globe. Upon entering a city name or using
the device's GPS to automatically detect location, users are instantly provided with relevant weather
information, including the current temperature, humidity, wind speed, and atmospheric pressure.
These elements are displayed in an easy-to-read format that allows users to quickly grasp the weather
conditions of their chosen location.

Another important feature is the inclusion of weather condition icons, which visually represent the
weather, such as clear skies, clouds, rain, or thunderstorms, adding a layer of intuitive clarity to the
data. The app also provides a temperature conversion option, allowing users to switch between
Celsius and Fahrenheit based on their preference, making it adaptable to international users.
Furthermore, the app includes detailed descriptions of the weather conditions, such as "clear skies,"
"scattered clouds," or "light rain," providing a fuller picture of the local weather.

To enhance the user experience, the app integrates error handling to gracefully manage issues like
invalid city names, lack of internet connectivity, or API request failures. If a user enters a non-
existent city or encounters a network issue, the app presents clear, actionable error messages, guiding
the user to correct the issue. Additionally, the app's design is responsive, offering a seamless
experience across various screen sizes and orientations, which ensures optimal usability on both
phones and tablets.

The overall user interface is clean, simple, and modern, with an emphasis on usability and aesthetics.
Data is displayed clearly with prominent font sizes for critical weather information, while secondary
details such as wind speed and pressure are shown in a less obtrusive manner. Through these features,
the Weather App not only functions as a practical tool for daily weather checking but also
exemplifies efficient mobile app development practices, combining external API integration, UI/UX
design, error management, and dynamic data handling

Yashwantrao Bhonsale Institute Of Technology 3|Page


Computer Engineering Weather App

4. ADVANTAGES:

1. Real-Time Weather Updates:

One of the primary advantages of the Weather App is its ability to provide real-time, accurate weather
data sourced from the OpenWeatherMap API (or similar weather data providers). This ensures that
users receive the most up-to-date weather conditions, which is crucial for planning daily activities
such as travel, outdoor events, or simply deciding what to wear. By dynamically fetching data, the
app ensures users always have access to the latest weather information, which is continuously
updated based on the current conditions.

2. Global Coverage:

The Weather App offers global coverage, meaning users can search for weather information for any
city or location around the world. This is especially advantageous for people who travel frequently or
for those with loved ones in different parts of the globe. Whether a user is in New York, London, or
Tokyo, they can instantly access weather data for their specific location, making it a universal and
versatile tool for anyone.

3. User-Friendly Interface:

The app provides a clean, intuitive, and easy-to-navigate interface, making it accessible to users of all
technical skill levels. With a well-organized layout, users can quickly view key weather information,
including temperature, humidity, wind speed, and weather conditions like clear skies, clouds, or rain.
The use of icons and easy-to-read text makes the information visually appealing and simple to
understand. Additionally, the app provides a responsive design, ensuring a smooth experience across
various devices, screen sizes, and orientations.

Yashwantrao Bhonsale Institute Of Technology 4|Page


Computer Engineering Weather App

5. DESIGN

Yashwantrao Bhonsale Institute Of Technology 5|Page


Computer Engineering Weather App

6. CODE:

6.1 Activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:orientation="vertical"
android:background="#ADD8E6">

<EditText
android:id="@+id/city_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter city name"
android:textSize="30dp"
android:layout_marginTop="30dp"/>

<Button
android:id="@+id/get_weather_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"

Yashwantrao Bhonsale Institute Of Technology 6|Page


Computer Engineering Weather App

android:layout_marginTop="30dp"
android:text="Get Weather"
android:background="#00008B"/>

<TextView
android:id="@+id/weather_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="24dp"
android:layout_marginTop="30dp"/>

</LinearLayout>

Yashwantrao Bhonsale Institute Of Technology 7|Page


Computer Engineering Weather App

6.2 [Link]:

package [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];

import [Link];
import [Link];
import [Link];
import [Link];

public class MainActivity extends AppCompatActivity {

private EditText cityEditText;


private Button getWeatherButton;
private TextView weatherTextView;

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);

setContentView([Link].activity_main);
cityEditText = findViewById([Link].city_edit_text);
getWeatherButton = findViewById([Link].get_weather_button);
weatherTextView = findViewById([Link].weather_text_view);

[Link](new [Link]()

Yashwantrao Bhonsale Institute Of Technology 8|Page


Computer Engineering Weather App

@Override
public void onClick(View v) {
String city =
[Link]().toString();
if (![Link]()) {
getWeatherData(city);
} else {
[Link]("Please enter a
city name.");
}
}
});}

private void getWeatherData(String city) {


// Replace YOUR_API_KEY with your actual
OpenWeatherMap API key
String apiUrl =
"[Link]
" + city +
"&appid=c08f020e2ab8e8487ea8dda706739150&unit
s=metric";
// Using metric for Celsius

new Thread(new Runnable() {


@Override
public void run() {
try {
URL url = new URL(apiUrl);
HttpURLConnection connection =
(HttpURLConnection) [Link]();

[Link]("GET");
int responseCode =
[Link]();
if (responseCode == 200) {
BufferedReader reader = new
BufferedReader(new
InputStreamReader([Link]()));
StringBuilder response = new StringBuilder();
String line;
while ((line = [Link]()) !=
null) {
[Link](line);
}

Yashwantrao Bhonsale Institute Of Technology 9|Page


Computer Engineering Weather App

[Link]();
JSONObject jsonObject = new
JSONObject([Link]());
String weather =
[Link]("weather").getJSONObject
(0).getString("description");
final String temperature =
[Link]("main").getString("temp")
;

runOnUiThread(new Runnable() {
@Override
public void run() {

[Link]("Weather: " + weather +


"\nTemperature: " + temperature + "°C");
}
});
} else {
runOnUiThread(new Runnable() {

@Override
public void run() {

[Link]("Failed to get weather


data. Error: " + responseCode);
}
});
}
} catch (Exception e) {
runOnUiThread(new Runnable() {
@Override
public void run() {

[Link]("Failed to get weather


data. Please check your internet
connection."+[Link]());
}
});
}
}
}).start();
}
}

Yashwantrao Bhonsale Institute Of Technology 10 | P a g e


Computer Engineering Weather App

6.3 [Link]:

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="[Link]
xmlns:tools="[Link]

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />

<category android:name="[Link]" />


</intent-filter>
</activity>
</application>
<uses-permission android:name="[Link]" />
</manifest>

Yashwantrao Bhonsale Institute Of Technology 11 | P a g e


Computer Engineering Weather App

7 OUTPUT:

Yashwantrao Bhonsale Institute Of Technology 12 | P a g e


Computer Engineering Weather App

8 CONCLUSION:

In conclusion, the Weather App developed for Android provides users with an efficient and
accessible way to check real-time weather conditions for any location globally. By integrating the
OpenWeatherMap API, the app ensures that users receive accurate and up-to-date weather data,
including key information such as temperature, humidity, wind speed, and weather conditions like
clear skies, rain, or thunderstorms. The user-friendly interface, which includes intuitive icons and
easy-to-read text, enhances the overall experience, allowing users to quickly access vital weather
details.

The app's ability to switch between Celsius and Fahrenheit provides flexibility for users worldwide,
ensuring that the app is adaptable to different preferences and regions. Additionally, the integration of
location-based services through GPS allows for automatic weather updates based on the user's current
location, further enhancing convenience and usability.

Robust error handling ensures a smooth user experience even in cases of invalid inputs or network
issues, while the overall design remains lightweight, ensuring optimal performance across different
devices. This weather app not only serves as a practical tool for users to stay informed about weather
conditions but also demonstrates key skills in mobile app development, including API integration,
JSON parsing, dynamic UI updates, and efficient error management.

Ultimately, the Weather App stands as a powerful example of a modern, functional Android
application that combines practicality with design, offering both value and usability to users. Through
this project, developers can learn the essential aspects of mobile app development while creating an
app that serves a real-world, everyday purpose.

Yashwantrao Bhonsale Institute Of Technology 13 | P a g e


Computer Engineering Weather App

9 REFERENCES

[Link]
string-set-in-code

[Link]

[Link]
openweathermap-api-in-android-studio/

[Link]
studio-with-source-code-5185db532e17

[Link]

Yashwantrao Bhonsale Institute Of Technology 14 | P a g e

Common questions

Powered by AI

The Weather App exemplifies efficient mobile app development through several practices. It demonstrates the seamlessly integrated use of external APIs for dynamic data fetching and real-time updates. The app uses best practices in JSON parsing through libraries like Gson or Moshi to handle data efficiently. It implements user-friendly UI/UX design principles, ensuring simple navigation and a clean, responsive interface across devices. Additionally, it integrates robust error handling mechanisms to manage user input and connectivity issues gracefully. The adaptive design supporting both Celsius and Fahrenheit adds to its international usability. These practices together illustrate a comprehensive approach to modern mobile app development, balancing functionality and user experience .

The interaction between the Weather App's UI elements and its backend functionality is integral to its seamless operation. The UI, composed of elements such as EditText for user input, Button for triggering weather data fetch, and TextView for displaying results, is directly tied to backend functions. Upon user interaction, the app uses an HTTP request to fetch data from the OpenWeatherMap API through Retrofit. The response, in JSON format, is parsed using libraries like Gson, and the resulting data is updated on the UI using Android's threading mechanisms to ensure main thread UI updates without performance hitches. This tight coupling of UI and backend allows for a responsive and real-time user experience .

Using Retrofit for HTTP requests in the Weather App provides several advantages compared to other methods such as HttpURLConnection. Retrofit abstracts and simplifies the network call process, allowing developers to define network requests as a part of the service interface, which enhances code readability and organization. It automatically serializes the JSON response using well-integrated libraries like Gson or Moshi, eliminating the manual parsing required with other methods. Retrofit also provides built-in support for managing API responses and error handling, streamlining the process of network operations and reducing boilerplate code, leading to more maintainable and efficient application development .

The Weather App incorporates robust error handling mechanisms to manage user input errors and connectivity issues. When an incorrect city name is entered, or if there is a network problem, the app provides clear, actionable error messages guiding the user to resolve the issue. This includes notifying users of invalid city inputs, a lack of internet connection, or API request failures. The app ensures that error messages are user-friendly, enhancing user experience by providing guidance on how to rectify these errors .

Incorporating dynamic weather updates significantly enhances the user experience of the Weather App by ensuring users have access to the most current and accurate weather information. This real-time feature means users can make informed decisions related to daily activities, such as planning events or travel, with confidence in the reliability of the data presented. It also reduces the need for manual updates or checks by the user, minimizing the friction in using the app. Moreover, real-time updates underscore the app's responsiveness and reliability, fostering a sense of trust and satisfaction as users witness immediate reflections of real-world atmospheric changes in their locality or a chosen destination .

The primary programming languages used in the development of the Weather App are Kotlin and Java. These languages are chosen because they are native to Android development, offering robust support and integration with Android Studio. Kotlin, in particular, is preferred for its concise syntax and interoperability with Java, making it easier to write and maintain code efficiently. These languages also support the necessary libraries such as Retrofit for HTTP requests and Gson or Moshi for JSON parsing, which are crucial for the app's functionality .

The Weather App's design accommodates varying device orientations and screen sizes through its responsive UI design principles. It uses adaptable layout resources and auto-scaling UI components, such as dynamic TextView and ImageView sizes, to maintain a consistent aesthetic across different screens. The app's use of flexible layouts, possibly utilizing ConstraintLayout, ensures that UI elements are automatically repositioned when the device orientation changes, while maintaining readability and usability. This approach not only enhances user experience by providing consistent functionality and appearance on both phones and tablets but also ensures usability remains high regardless of device type .

The Weather App ensures data accuracy and reliability through several mechanisms. It sources its real-time weather updates from the OpenWeatherMap API, known for reliable and comprehensive weather data. The app dynamically processes these updates to reflect the most current weather conditions every time a user searches for a new city or refreshes the page. It leverages robust network handling techniques to ensure data is fetched successfully despite variable network conditions and implements thorough error checking and handling to address failed API requests or incorrect data entries. These elements collectively safeguard data integrity and timeliness, providing users with consistently accurate weather information .

The Weather App ensures accessibility and user-friendliness for a global audience through several key features. It offers a clean and intuitive interface with simple navigation and responsive design, compatible with various devices and screen sizes. The ability to switch between Celsius and Fahrenheit allows users worldwide to customize their temperature display preferences. Global coverage is achieved by allowing users to search for weather information for any city around the world and supports multiple languages for comprehensive user adaptation. The inclusion of graphical weather icons and real-time updates enhances understanding and engagement, regardless of technical skill levels .

The Weather App utilizes third-party APIs, specifically the OpenWeatherMap API, to fetch real-time weather data. These APIs provide benefits such as access to comprehensive and accurate weather information including temperature, humidity, and wind speed globally. This integration allows the app to dynamically update weather data for any chosen city or detected location through GPS. By using libraries like Retrofit for HTTP requests and Gson for JSON parsing, the app efficiently processes and displays up-to-date weather conditions, enhancing its functionality and user experience. The use of APIs also supports the app's ability to handle live data, ensuring its reliability in providing the latest weather updates .

You might also like