Skip to content

ga-adi-macaron/networking-in-android-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

title type duration creator
Making an HTTP call from Android
lab
1:30
name city
Yuliya Kaleda
NYC

Making an HTTP call from Android

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 the Walmart API. You will be working with the search endpoint of the API and using it to find and display information about tea, cereal, and chocolate products.

You'll need to generate your own API key to build your app with three buttons (tea, chocolate, cereal) and a RecyclerView. When the button is clicked the list gets populated with the information about the appropriate products using data from the API.

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

Exercise

Requirements

  • Register your development app and get an API key from the Walmart Labs Developer Page

  • Read up on the search endpoint for how to structure your API call

  • Your app should contain three buttons: tea, chocolate, cereal

  • Your app should contain one RecyclerView that will get populated with product names pulled from the Walmart API endpoint

  • Make sure the app is thread safe:

    • Check if the connection is available
    • Use AsyncTask or asynchronous OkHttp calls to pull the data from the API
    • The RecyclerView should get updated on the UI thread

Bonus:

  • In addition to the name of products, show the prices of the corresponding products
  • When one AsyncTask gets fired, make sure you will cancel other AsyncTasks that may be making HTTP requests

Deliverable

Here is a gif that demonstrates what the app's functionality should look like:

Resources

Walmart API Docs


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