Weather Application

OpenWeatherMap API

Project Date 14th January 2022
Platform Mobile Application
Type Cross-Platform
Interface OpenWeatherMap API
Languages & Tools

1 Introduction

This project would be focused on developing a mobile weather application, based on flutter cross-platform development. Using this application, users would be able to view the weather information for the locations of various countries by searching the city name. Moreover, the application would be able to provide the weather information for an entire week for any selected location.

The requirements of the applications are;

  1. Create a weather application using OpenWeatherMap API.
  2. Use of mobile development and UI/UX best practices.
  3. Use of suitable architecture, methodologies and 3rd party libraries.

2 Features

  1. Search a city for weather.

This feature allows users to search for any city location through the application, to view the weather details of the specific location. This location would be verified using the city name, latitude location as well as its longitude location. This data would be retrieved from the weather API, based on the selected location.

  1. View current weather data.

This feature would allow the weather application to retrieve and display the weather information of the current day. This would view the current temperature, humidity percentage, rain probability and the wind speed of the location. This data would be retrieved from the weather API, based on the selected location.

  1. Extended today weather details.

This feature allows the application to additionally display the weather data for multiple hours ahead from the current time. This would majorly display the temperature with the time of the current day.

  1. Week’s weather details.

This application feature displays the weather details up to seven days, from the current day. This would display the temperature, wind speed, humidity percentage and rain probability for the coming seven days.

3 Architecture

  1. Language: Dart

Dart programming language has been selected to program the required Weather application. Dart is a free and open-source OOP (Object-Oriented Programming) language, consisted with C-based composition developed by Google LLC. Dart is majorly used to design the frontend user interfaces for mobile applications. It supports common concepts of programming languages like classes, interfaces, functions. Moreover, Dart is also a compiled language, the code requires to be compiled to machine code before being executed during development.

  1. Framework: Flutter

Flutter framework has been selected to assist the application development with Dart language. Flutter is an open-source and free mobile application user interface framework released by Google LLC. Flutter is well-known for its ability to design a native mobile application using one codebase. The Flutter framework is consisted of an SDK (Software Development Kit), which assists with tools used for development. It also consists a widget-based UI (User Interface) library, with a group of reusable UI elements.

  1. State Management: Cross-Platform

The Weather application will be implemented using cross-platform development technique. Cross-platform is a development methodology procedure that allows application implementation to be able work on multiple mobile operating systems concurrently, mainly including iOS, Android and Microsoft Windows. These applications are programmed with native codes along with independent codes supporting multiple platforms, which increases the development efficiency and effectiveness.

  1. Protocol: HTTP

Hypertext Transfer Protocol (HTTP) is an application-level protocol which allows the communication between resources among the internet. This protocol would establish the basic communication between internet clients and their specific requests. HTTP requests have been linked in this application in order to link third party libraries and the weather API with the application.

  1. Dart Package: Cupertino Icons

A dart package available to add specific icons in the application. The icons were used to include specific weather-related icons in the weather application.

  1. Dart Package: Flutter Glow

A dart package available to add visual glows to application widgets. Glows were used in the to separate weather components.

4 Third Party Library

4.1 OpenWeatherMap

OpenWeatherMap is considered as an online global weather information providing service. The service also provides business-based products using climate data. OpenWeatherMap contains real-time weather data for locations around the globe, using their own weather prediction system. OpenWeatherMap uses API keys to allow internet users to access their climate data, including current weather, hourly forecast, daily forecast, climatic forecast and even historical weather.

OpenWeatherMap users would be required to create an account on their website, receiving an API key to access the weather data. Users would also be able to generate multiple API keys as required. These weather data can be called using city names, city codes, zip codes or even geographical coordinates. Similarly, this project application is developed using OpenWeatherMap API key, in order to receive the required weather data to be displayed in the weather application.

This database library, developed by Darshan Gada, is a collection of the geographical data regarding countries, states and its cities. The library includes all the required data required to identify and verify geographical locations based on unique identities. The library was linked in the current project to assist the weather city searching feature of the application.

Once a city name is searched in the application, the specific city’s relevant geographical coordinates are retrieved from this library. Coordinates are verified, and then the relevant weather data would be retrieved from the OpenWeatherMap API source using the coordinates.