Skip to content

ga-adi-macaron/retrofit-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

title type duration creator
Making a Weather App with Retrofit
lab
1:30
name city
Jean Weatherwax
San Francisco

Making a Weather App with Retrofit

Introduction

Note: This can be a pair programming activity or done independently.

In this lab, you will be building an app that sends a GET request to pull information from about the weather based on a city EditText entry from the user. You will be working with the search endpoint of the API and using it to find and display information about the weather, and you will use queries with Retrofit.

You'll need to generate your own API key for this lab (see below).

Your app doesn't need to look like the deliverable below, but it needs to have the same functionality.

Exercise

Requirements

  • register (free) with app and get an API key from the OpenWeatherMap API.

  • Read some of the basic API Documentation for the current weather API.

  • Your App will have an EditText for a city input, and 4 TextViews that will display the city name, weather description, humidity, pressure, and temperature.

  • If you're unsure of how to use the user input for city query, read how to use @Query with Retrofit to use a text input here in the documentation for Retrofit.

  • Make models for each of the necessary classes, either manually or using http://www.jsonschema2pojo.org/

  • Make an interface for the API and use it with Retrofit in your MainActivity to display the requirements

    • make sure to also check if the connection is available!

Deliverable

Here is an image of an example working app:

Aditional Resources

OpenWeatherMap API

Retrofit


Licensing

  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages