You are on page 1of 13

INDEX

Sr. No. Title Page No.

1. Acknowledgement 4

2. Abstract 5

3. Introduction 6

4. Scope, Significance and Requirements 7

5. Program Code 8

6. Output 16

7. Conclusion 17

8. References 18

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


ACKNOWLEDGEMENT
In the accomplishment of this micro-project successfully, many people
have best owned upon me their blessings and heart-privileged support.
Primarily, I would like to express a special thanks of gratitude to the Principal Sir
of the Government Polytechnic, Solapur for giving this golden opportunity with
all the required facilities for completing this microproject of our group.

I would like to extend my gratitude to our MAD subject teacher, whose


valuable guidance has been the ones that helped us patch this project and
make it full proof success. Their suggestions and instructions has served as the
major contributor towards the completion of the micro-project. suggestions
and provided the required resources needed for the micro
-project. I would also like to thank my parents who have helped with their
valuable

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


ABSTRACT
As a student enrolled in the SSJP Polytechnic, , every semester we require
to do a micro-project on any one topic in the syllabus of the respective
subjects. Hence, we have created a project on Reminder Application as the
micro-project for the subject MAD (22617).

This project is aimed at developing a Reminder Application for Android devices.


The application is designed to help users manage their tasks and activities by
setting reminders for important events and deadlines. The Reminder App will
provide a user-friendly interface for creating and editing reminders.

The reminder application is developed using Android Studio and used


SQLite database to store the reminder data. It uses Recycler View to view all the
reminders. The reason for choosing Recycler View is because of its vast
customization and improved efficiency than ListView and GridViews.

The SQLite is the default database that is in-built in android which made us

easier to connect with it and performs operations with it. SQLite is a C-language

library that implements a small, fast, self-contained, highreliability, full

featured, SQL database engine. SQLite is the most used database engine in the

world.

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


Introduction
Weather forecasting is the application of science and technology
to predict the conditions of the atmosphere for a given location
and time. Human beings have attempted to predict the weather
informally for millennia and formally since the 19th century.
Weather forecasts are made by collecting quantitative data about
the current state of the atmosphere at a given place and using
meteorology to project how the atmosphere will change. There
are a variety of end uses to weather forecasts. Weather warnings
are important forecasts because they are used to protect life and
property. Forecasts based on temperature and precipitation are
important to agriculture, and therefore to traders within
commodity markets. Temperature forecasts are used by utility
companies to estimate demand over coming days. On an
everyday basis, people use weather forecasts to determine what
to wear on a given day. Since outdoor activities are severely
curtailed by heavy rain, snow and wind chill, forecasts can be
used to plan activities around these events, and to plan ahead and
survive them. In 2009, the US spent $5.1 billion on weather
forecasting

 SIGNIFICANCE OF PROJECT –
The main significance of this micro-project is to understand how an android
application is built, perform operations in the database, use Recycler View to
show list of items and use Alarm Manager and Broadcast Receiver to show
reminder notifications.

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


 SCOPE OF PROJECT –

The scope of the project is the system on which the software is


installed, i.e. the project is developed as a desktop application,
and it will work for a particular institute or organization. But
later on the project can be modified to operate it online. The
intention of developing weather app is to fetch the data in the
need of taking information about weather worldwide. Another
purpose for developing this software is to generate the report
automatically at the end of the session or in the between of the
session or in the between of the session as they require. This
project is basically a desktop application which means 3
selfcontained software runs on which it has been installed under
the user control

 HARDWARE REQUIREMENTS –
1. Laptop or PC with minimum 8GB RAM and i5/i7 8th Gen processor

 SOFTWARE REQUIREMENTS –
1. Operating System - Windows 11
2. Android Studio Electric Eel 2022.1.1
3. Android Emulator – UpsideDownCake (Android 14)

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


PROGRAM CODE
activitymain.xml
<?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="#e8f4f8"
android:orientation="vertical" android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
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:id="@+id/etCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:ems="10" android:hint="Enter
City Name"

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


android:inputType="textPersonName"
android:minHeight="48dp" />

<EditText android:id="@+id/etCountry"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:ems="10" android:hint="Enter
Country Code (Optional)"
android:inputType="textPersonName"
android:minHeight="48dp" />
<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>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adViewMain"
android:layout_width="wrap_content"
android:layout_height="wrap_content" ads:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_adunit_id">
</com.google.android.gms.ads.AdView>
</LinearLayout>
</LinearLayout>

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


Activity.java
package com.weatherupdate;

import android.graphics.Color;
import android.os.Bundle; import
android.view.View; import
android.widget.EditText; import
android.widget.TextView; import
android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

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
com.google.android.gms.ads.AdRequest; import
com.google.android.gms.ads.AdView; import
com.google.android.gms.ads.MobileAds; import
com.google.android.gms.ads.initialization.InitializationStatus;
import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;

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 = "e53301e27efa0b66d05045d91b2742d3";
DecimalFormat df = new DecimalFormat("#.##");

private AdView mAdView;

@Override protected void onCreate(Bundle


savedInstanceState) {

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override public void onInitializationComplete(InitializationStatus
initializationStatus) {
}
});

mAdView = findViewById(R.id.adViewMain);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);

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) {
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;

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


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(68,134,199)); output += "Current
weather of " + cityName + " (" + countryName + ")"
+ "\n Temp: " + df.format(temp) + " °C"
+ "\n Feels Like: " + df.format(feelsLike) + " °C"
+ "\n Humidity: " + humidity + "%"
+ "\n Description: " + description
+ "\n Wind Speed: " + wind + "m/s (meters per second)"
+ "\n Cloudiness: " + 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);
}
}

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


OUTPUT

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


CONCLUSION

In conclusion, weather forecasting applications provide users with


accurate and up-to-date information on weather conditions for a
given location and time. They are useful for a wide range of users,
including event planners, farmers, outdoor enthusiasts,
construction workers, and more. By providing reliable weather
information, these applications help users make informed
decisions and plan their activities accordingly. Overall, weather
forecasting applications are an essential tool for anyone looking to
stay informed about the weather.

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)


REFERENCES
1. www.google.com
2. www.youtube.com
3. www.w3schools.com
4. www.geeksforgeeks.com
5. www.tutorialspoint.com
6. www.android.com
7. E-Books

Downloaded by Rohan Kapoor (kapoor10564@gmail.com)

You might also like