How to create a weather forecast app with Ionic

1 min
How to create a weather forecast app with Ionic

I decided I am going to write some articles about interesting apps that can be developed in a short time using Ionic. In this case, I am going to start with a simple application that allows us to check the weather in our location.

Source code on GitHub

What technologies have I used?

First, I decided to use the based Angular Ionic framework for several reasons. One of them is the speed with which we can develop a mobile application. You can find the source code on GitHub using the link above. Remember to install all the Node dependencies and Cordova plugins using npm i.

The only plugin that we are going to install is the one in charge of getting the geolocation of the device. This is necessary to obtain the weather forecast from the latitude and longitude of where we are. You can find the documentation for the Geolocation plugin here.

To obtain weather data, I use the OpenWeather free API. The free tier allows us to make up to 60 requests per minute (around 1 request per second). I think this is enough for what we are going to do. There are more APIs that offer data about the weather forecast, but many are not free. However, you can use the one you like best. You can find more information here.

Finally, I’ve been using the Visual Studio Code IDE, a cross-platform development environment that I’ve customised with plugins to get the most out of Ionic’s features.