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

Weather App Mini Project Report: VARDHMAN (19EUCS165) SHAILESH (19EUCS129) VIGNESH B (19EUCS168)

The document describes a weather app mini project created by three students. The app uses an open source weather database called Open Weather Map to detect weather conditions and parameters like temperature, humidity, and wind for a given location entered by the user. The app was developed as both a web and mobile application using tools like XML, JSON for the front end and Open Weather Map for the back end.

Uploaded by

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

Weather App Mini Project Report: VARDHMAN (19EUCS165) SHAILESH (19EUCS129) VIGNESH B (19EUCS168)

The document describes a weather app mini project created by three students. The app uses an open source weather database called Open Weather Map to detect weather conditions and parameters like temperature, humidity, and wind for a given location entered by the user. The app was developed as both a web and mobile application using tools like XML, JSON for the front end and Open Weather Map for the back end.

Uploaded by

Shail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

1

WEATHER APP

MINI PROJECT REPORT

submitted by
VARDHMAN (19EUCS165)
SHAILESH (19EUCS129)
VIGNESH B(19EUCS168)

In partial fulfilment for the award of the degree

of

BACHELOR OF ENGINEERING

In

COMPUTER SCIENCE AND ENGINEERING

SRI KRISHNA COLLEGE OF ENGINEERING AND

TECHNOLOGY (An Autonomous Institution)

(Approved by AICTE and Affiliated to Anna University, Chennai)

ACCREDITED BY NAAC WITH “A” GRADE


JANUARY-2022
2

SRI KRISHNA COLLEGE OF ENGINEERING AND


TECHNOLOGY (An Autonomous Institution)

(Approved by AICTE and Affiliated to Anna University, Chennai)

ACCREDITED BY NAAC WITH “A” GRADE

BONAFIDE CERTIFICATE

Certified that this mini project report “WEATHER APP” is the bonafide work of “Vardhman
(19EUCS165), Shailesh (19EUCS129), Vignesh B(19EUCS168)” who carried out the project
work under my supervision.

SIGNATURE SIGNATURE

Dr. P. KAVITHA RANI M.E.,Ph.D Mr. KARTHIKEYAN N PROFESSOR ASSISTANT


PROFESSOR HEAD OF THE DEPARTMENT SUPERVISOR

Department of Computer Science and Engineering Sri


Krishna College of Engineering and Technology
Kuniamuthur, Coimbatore.

This project report is submitted for the autonomous project viva-voice examination held on
.....................

INTERNAL EXAMINER EXTERNAL EXAMINER


3

ACKNOWLEDGEMENT

We express our sincere thanks to the management and Dr. J. JANET M.E., Ph.D., Principal, Sri Krishna College
of Engineering and Technology, Coimbatore for providing us the facilities to carry out this mini project work.

We are thankful to Dr. P. KAVITHA RANI M.E.,Ph.D., Professor and Head, Department of Computer Science
and Engineering, for her continuous evaluation and commentsgiven during the course of the mini project work.

We express our deep sense of gratitude to our supervisor and mini project coordinator Mr. KARTHIKEYAN N,
Assistant Professor, Department of Computer science and Engineering for her valuable advice, guidance and
support during the course of our mini project work.

We express our heartfelt sense of gratitude and thanks to our beloved parents, family and friends who have helped
during the miniproject course.
4

ABSTRACT
Weather Application System is application of science and technology to detect the state of atmosphere for a
given location. Ancient weather detecting methods usually relied on observed patterns of events, also termed
pattern recognition. For example, it might be observed that if the sunset was particularly red, the following day
often brought fair weather. Here this system will detect weather and base it on parameters such as temperature,
humidity and wind. User will enter a certain place or city and the app will detect its humidity and wind and other
parameters. This App detects weather of a certain place using an open source database called Open Weather Map.
Then the application detects the weather conditions along with other parameters of certain place the user desires
and fetches it. This application developed as both web application and a mobile application.

TABLE OF THE CONTENTS

CHAPTER CONTENTS PAGE NO ACKNOWLEDGEMENT

1 INTRODUCTION

1.1 OVERVIEW 8
2 PROBLEM DEFINITION 10 2.1 PROBLEM STATEMENT 10

2.2 EXISTING SYSTEM 11

2.2.1 DISADVANTAGE OF EXISTING SYSTEM 11

2.3 PROPOSAL SYSTEM 11

3 REQUIREMENTS 12 3.1 TOOLS REQUIREMENTS 12

3.1.1 TOOLS USED 12

3.1.2 MINIMUM REQUIREMENTS OF THE SYSTEM 12

3.2 FUNCTONAL REQUIREMENTS 12


6

3.3 NON FUNCTIONAL REQUIREMENTS 12

3.3.1 PERFORMANCE 12

3.3.2 SAFETY AND SECURITY REQUIREMENTS 13

4 MODULES DESCRIPTION 14 4.1 CLIENT INTERFACE MODULE 14

4.2 ADMIN FEATURE 14

4.3 BOOKING FEATURE 14

4.3.1 PRE-CONDITION 14

4.3.2 POST-CONDITION 14

5 DESIGN
5.1 SCREENSHOTS 15
6 IMPLEMENTATION 26 6.1 FRONT END 26

6.1.1 FEATURES 26

6.1.2 FRONT END CODE 26

6.2 BACK END 42

6.2.1 MONGODB 43
7

6.2.2 FEATURES 45

6.3 CONNECTIVITY 45

6.3.1 MONGODB 45

6.3.2 VERSION OF MONGODB 45

6.3.3 FEATURES 45

6.4 CODE 46

7 TESTING 50 7.1 INTRODUCTION 50

7.2 STRATEGIC APPROACH TO SOFTWARE TESTING 50

7.3 UNIT TESTING 50

7.3.1 WHITE BOX TESTING 50

7.3.2 CONDITION TESTING 51

7.3.3 DATA FLOW TESTING 51

7.3.4 LOOP TESTING 51

7.4 TEST CASE 51


8 CONCLUSION AND FUTUREWORK 52 9 REFERENCES 53
8

CHAPTER-1
INTRODUCTION

Weather App is the application of science and technology to predict the conditions of
the atmosphere for a given location and time. You can get the realtime Weather
forecasting by using this web application. It detects the weather conditions and its
parameters of a certain place or city. User can view parameters and other info about
the place. This Application uses Java as a front-end and Open Weather Map database
as the back-end.
Weather finder is the application of science and technology topredict the conditions
of the atmosphere for a given city.People have attempted to predict the
weather informally for millennia and formally since the 19th century.
Weatherforecasts are made by collecting quantitative data about thecurrent state of the
atmosphere, land, and ocean

WORKING OF WEATHER FINDER


There are two different tasks at the core of aweather finder:

● User request analysis

● Returning the response

USER REQUEST ANALYSIS


● This is the first task that a weather app performs.It analyzes the user’s request
to identify the userintent and to extract relevant entities.

RETURNING THE RESPONSE


● Once the user’s intent has been identified, the weather must provide the most
appropriate response for the user’s request. The answer return the weather of city
request.

CHAPTER-2
PROBLEM DEFINITION

2.1 PROBLEM STATEMENT

2.2 EXISTING SYSTEM


This chapter will discuss about existing Weather App.
2.3 DISADVANTAGE OF EXISTING SYSTEM


2.4 PROPOSED SYSTEM

2.5 ADVANTAGE OF THE PROPOSED SYSTEM:

CHAPTER-3
REQUIREMENTS
3.1 TOOL REQUIREMENTS

3.1.1 TOOLS USED

Front End :XML, JSON

Back End : Open Weather map

EDITOR: Android Studio


Operating System : Android 5.0 and above

3.1.2 MINIMUM REQUIREMENTS OF THE SYSTEM


3.2 FUNCTIONAL REQUIREMENTS

⮚Every online application needs to be associated with an account.


⮚user to register their details such as name, phone number, Email-Id ,Password.
⮚Function to set userid.
⮚Function to search view the total no of tickets, products etc.
⮚Function to choose timing for the conv55enient of the user.
⮚Function to add the user account.
3.3 NON-FUNCTIONAL REQUIREMENTS

3.3.1 Performance

Performance is measured in terms of the output provided by the application. Requirement specification plays an
important part in the analysis of a system. Only when the requirement specifications are properly given, it is
possible to design an application, which will fit into required environment. The load for the user interface screens
shall take no longer than 2 seconds. . Queries shall return results within 5 seconds.
13

3.3.2 Safety and Security Requirements

⮚ User Identification:

o The system requires the user to identify himself/herself User

⮚ Login ID:

o Any user who uses the system shall have a Login.

⮚ Modification:

o Any modification (insert, delete (or) update) for the Database shall be
synchronized and done only by the admin in the ward.

⮚ Admin Rights:

o Admin shall be able to view and modify the information.


14

CHAPTER-4
MODULES DESCRIPTION

4.1 CLIENT INTERFACE MODULE

In this module we deal with login interface and retrieval of data from database in the server. The
client login with the given login id and password.The client can view the staff allocated and the class
timings . The handling of the data and records for such a vast system very complex task is done manually
but it can be made much easier if the system is computerized.
4.2 ADMIN FEATURES

⮚ Admin have their respective user id & password for authenticatedlogin

⮚ With the Aquarium website, the admin can manage the reservation, timing of the ticket booking and
product buying and let user know thedetails.
4.3 USER FEATURES
⮚ user have their respective login including the attribute such as user name, phonenumber, email-id,
password for secured login.
⮚ user can view the ticket timing and products.
⮚ user can be able to view the newly available products.

4.3.1 PRE-CONDITION

⮚ The system displays the menu of available function that are detailed information.
⮚ This system displays the menu of admin panel.

4.3.2 POST-CONDITION

⮚ Login is successful.
⮚ Whole system make more flexible for user to use.
15

CHAPTER-5
SCREENSHOTS
5.1 USER INTERFACE
18

5.1.5 PRODUCTS DETAILS:


25

CHAPTER-6
IMPLEMENTATION
6.1 FRONT END

⮚ XML and JSON


6.1.1 FEATURES
XML is a software- and hardware-independent tool for storing and transporting data. It stands for
eXtensible Markup Language XML is quite self-descriptive:
 It has sender information.
 It has receiver information
 It has a heading
 It has a message body.
The XML language has no predefined tags. The tags in the example above (like <to> and <from>) are not defined
in any XML standard. These tags are "invented" by the author of the XML document. HTML works with
predefined tags like <p>, <h1>, <table>, etc. With XML, the author must define both the tags and the document
structure. Many computer systems contain data in incompatible formats. Exchanging data between incompatible
systems (or upgraded systems) is a time-consuming task for web developers. Large amounts of data must be
converted, and incompatible data is often lost. XML stores data in plain text format. This provides a software- and
hardware-independent way of storing, transporting, and sharing data. XML also makes it easier to expand or
upgrade to new operating systems, new applications, or new browsers, without losing data. With XML, data can be
available to all kinds of "reading machines" like people, computers, voice machines, news feeds, etc.

The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text only. JSON data
can easily be sent between computers, and used by any programming language. The Code for reading and
generating JSON data can be written in any programming language. JSON data is written as name/value pairs, just
like JavaScript object properties. JSON objects are written inside curly braces. JSON arrays are written inside
square brackets. A common use of JSON is to read data from a web server, and display the data in a web page.

6.1.2 UI CODE

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


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity"
android:background="@drawable/gradient_bg"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@android:color/holo_blue_dark"
android:textSize="40sp"
android:text="Weather Update"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</View>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/etCity"
android:layout_marginBottom="10dp"
android:ems="10"
android:hint="Enter City Name"
android:inputType="textPersonName" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/etCountry"
android:layout_marginBottom="10dp"
android:ems="10"
android:hint="Enter Country Code (Optional)"
android:inputType="textPersonName" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btnGet"
android:layout_marginBottom="10dp"
android:background="#0070c7"
android:textColor="@android:color/white"
android:onClick="getWeatherDetails"
android:text="Get"
app:backgroundTint="@null" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="150dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tvResult" />
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</View>
</LinearLayout>
</LinearLayout>

6.1.3 BACKGROUND THEME

<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.WeatherUpdate" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
<style name="Theme.WeatherUpdate.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.WeatherUpdate.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.WeatherUpdate.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

6.1.4 GRADIENT

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


<shape
android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:startColor="#9561a1"
android:endColor="#122259">
</gradient>
</shape>

6.1.5 MAIN ACTIVITY

package com.example.weatherupdate;
import android.graphics.Color;
import android.os.Bundle;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.DecimalFormat;
public class MainActivity extends AppCompatActivity {
EditText etCity, etCountry;
TextView tvResult;
private final String url = "https://api.openweathermap.org/data/2.5/weather";
private final String appid = "a97c0d9a7517628b6148ef4ece616784";
DecimalFormat df = new DecimalFormat("#.##");
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
etCity = findViewById(R.id.etCity);
etCountry = findViewById(R.id.etCountry);
tvResult = findViewById(R.id.tvResult);
}
public void getWeatherDetails(View view) {
String tempUrl = "";
String city = etCity.getText().toString().trim();
String country = etCountry.getText().toString().trim();
if(city.equals("")){
tvResult.setText("City field can not be empty!");
}else{
if(!country.equals("")){
tempUrl = url + "?q=" + city + "," + country + "&appid=" + appid;
}else{
tempUrl = url + "?q=" + city + "&appid=" + appid;
}
StringRequest stringRequest = new StringRequest(Request.Method.POST, tempUrl, new
Response.Listener<String>() {
@Override
public void onResponse(String response){
//Log.d("response",response);
String output = "";
try {
JSONObject jsonResponse = new JSONObject(response);
JSONArray jsonArray = jsonResponse.getJSONArray("weather");
JSONObject jsonObjectWeather = jsonArray.getJSONObject(0);
String description = jsonObjectWeather.getString("description");
JSONObject jsonObjectMain = jsonResponse.getJSONObject("main");
double temp = jsonObjectMain.getDouble("temp") - 273.15;
double feelsLike = jsonObjectMain.getDouble("feels_like") - 273.15;
float pressure = jsonObjectMain.getInt("pressure");
int humidity = jsonObjectMain.getInt("humidity");
JSONObject jsonObjectWind = jsonResponse.getJSONObject("wind");
String wind = jsonObjectWind.getString("speed");
JSONObject jsonObjectClouds = jsonResponse.getJSONObject("clouds");
String clouds = jsonObjectClouds.getString("all");
JSONObject jsonObjectSys = jsonResponse.getJSONObject("sys");
String countryName = jsonObjectSys.getString("country");
String cityName = jsonResponse.getString("name");
tvResult.setTextColor(Color.rgb(0,0,0));
output += "Current weather of " + cityName + " (" + countryName + ")"
+ "\n Temperature: " + df.format(temp) + " °C"
+ "\n Ground Level Temperature: " + df.format(feelsLike) + " °C"
+ "\n Humidity: " + humidity + "%"
+ "\n Description: " + description
+ "\n Wind Speed: " + wind + " m/s"
+ "\n Cloud Density: " + clouds + "%"
+ "\n Pressure: " + pressure + " hPa";
tvResult.setText(output);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error){
Toast.makeText(getApplicationContext(), error.toString().trim(), Toast.LENGTH_SHORT).show();
}
});
RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext());
requestQueue.add(stringRequest);
}
}
}

6.1.6 ANDROID MANIFEST


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.weatherupdate">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.WeatherUpdate"
android:networkSecurityConfig="@xml/network_security_config">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.WeatherUpdate.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

50

CHAPTER-7
TESTING

7.1 INTRODUCTION

Software testing is a critical element of software quality assurance and represents the ultimate review of
specification, design and coding. In fact, testing is the one step in the software engineering process that could be
viewed as destructive rather than constructive. A strategy for software testing integrates software test case design
methods into a well-planned series of steps that result in the successful construction of software. Testing is the set
of activities that can be planned in advance and conducted systematically.

7.2 STRATEGIC APPROACH TO SOFTWARE TESTING

The software engineering process can be viewed as a spiral.Initially system engineering defines the role of
software and leads to software requirement analysis where the information domain, functions, behaviour,
performance, constraints and validation criteria for software are established.Moving inward along the spiral, we
come to design and finally to coding. To develop computer software we spiral in along streamlines that decrease
the level of abstraction on each turn. A strategy for software testing may also be viewed in the context of the spiral.
Unit testing begins at the vertex of the spiral and concentrates on each unit of the software as implemented in
source code. Talking another turn on outward on the spiral we encounter validation testing where requirements
established as part of software requirements analysis are validated against the software that has been constructed.

7.3 UNIT TESTING

Unit testing focuses verification effort on the smallest unit of software design, the module. The unit testing we
have is white box oriented and some modules the steps are conducted in parallel. 7.3.1 WHITE BOX TESTING

To follow the concept of white box testing we have tested each form. We have created independently to verify that
Data flow is correct and all conditions are exercised to check their validity. ⮚ All loops are executed on their
boundaries. This type of testing ensures that all independent paths have been exercised at least once
⮚ All logical decisions have been exercised on their true and false sides
⮚ All loops are executed at their boundaries and within their operational bounds
51

⮚ All internal data structures have been exercised to assure their validity paths.

7.3.2 CONDITIONAL TESTING

In this part of the testing each of the conditions were tested to both true and false aspects. And all the resulting
paths were tested so that each path that may generate on a particular condition is traced to uncover any possible
errors.
7.3.3 DATA FLOW TESTING

This type of testing selects the path of the program according to the location of definition and use of variables. This
kind of testing was used only when some local variable were declared. The definition-use chain method was used
in this type of testing.
7.3.4 LOOP TESTING

In this type of testing all the loops are tested to all the limits possible.

The following exercise was adopted for all loops:

⮚ All the loops were tested at their limits, just above them and just below them. All the loops were skipped at least
once.
⮚ For nested loops test the inner most loop first and then work outwards. For concatenated loops the values of
dependent loops were set with the help of connected loop.
⮚ Unstructured loops were resolved into nested loops or concatenated loops and tested as above. ⮚ Each unit has
been separately tested by the development team itself and all the input have been validated.

7.4 TEST CASE

A test case, in software engineering, is a set of conditions or variables under which a tester will determine whether
an application, software system or one of its features is working as it was originally established for it to do. The
mechanism for determining whether a software program or system has passed or failed such a test is known as a
test oracle. In some settings, an oracle could be a requirement or use case, while in others it could be a heuristic. It
may take many test cases to determine that a software program or system is considered sufficiently scrutinized to
be released. Test cases are often referred to as test scripts, particularly when written - when they are usually
collected into test suites.
52

CHAPTER -8
CONCLUSION AND FUTUREWORK

CHAPTER-9

REFERENCES

You might also like