A small Android project to practice executing network requests and parsing the network response

Overview

InspirationalQuotesExercise

A small Android project to practice executing network requests and parsing the network response

This app uses the ZenQuotes API to generate an inspirational quote. Specifically, we will be using the https://zenquotes.io/api/random endpoint. Note that on a free account, you can only call the API 5 times every 30 seconds. Once you've reached that limit, you will no longer receive a valid response.

The app currently doesn't work and requires a few fixes. This exercise takes you through the steps to produce a fully working app as pictured below.

  1. Clone this repo and import the project into Android Studio
  2. Launch the project on your Android device or emulator. Notice that the app is crashing on launch right now!
    a) Fix the crash by looking at the logs to see what caused the crash. (Hint: There's a TODO in ZenQuotesApiService)
    b) See solution for fixing crash here
  3. Notice that unfortunately, there are still no quotes being displayed in the app. This is because the Quote class is currently incomplete. It should be parsing the JSON object for a Quote. The documentation for the response object is here: https://premium.zenquotes.io/zenquotes-documentation/#api-response. Use the documentation to complete the Quote class.
    a) See how this is done in the Android Basics codelab on Step 8 for the @Json Annotation section
    b) See solution here
  4. The last step is to set up an onClickListener for the button in the app to display a new quote.
    a) See solution here
  5. Bonus step: Right now the app only displays the quote. But part of the response also includes the author of the quote. Display the author of the quote along with the quote itself!
You might also like...
Practice on connecting to internet and getting data from internet app. This gets Mars photos

MarsPhotos - Starter Code Starter code for Android Basics in Kotlin. Introduction Using this stater code you will create MarsPhotos is a demo app that

NiceHttp - A small and simple OkHttp wrapper to ease scraping

NiceHttp - A small and simple OkHttp wrapper to ease scraping

Compact and easy to use, 'all-in-one' android network solution
Compact and easy to use, 'all-in-one' android network solution

Deprecated Unfortunately due to many reasons including maintenance cost, this library is deprecated. I recommend to use Retrofit/OkHttp instead. Curre

Android library listening network connection state and change of the WiFi signal strength with event bus

NetworkEvents Android library listening network connection state and change of the WiFi signal strength with event bus. It works with any implementati

Android network client based on Cronet. This library let you easily use QUIC protocol in your Android projects

Android network client based on Cronet. This library let you easily use QUIC protocol in your Android projects

Write your asynchronous Network / IO call painlessly in Kotlin !!
Write your asynchronous Network / IO call painlessly in Kotlin !!

Asynkio : Write asynced IO/ Network calls painlessly on android | | | Documentation Write your network requests, IO calls in android with Kotlin seaml

A library that observes your network status.

A library that observes your network status. Update in progress ... Download Using gradle In your root build.gradle at the end of repositories add all

Operations are performed by calling api endpoints over the network

##About The app Operations are performed by calling api endpoints over the network. Local data is in effect immutable, the client just downloads updat

Cli lightning network server, based on LDK (rust-lightning). Provides DUMB-RPC interface (telnet friendly).

Hello Lightning Cli lightning network server, based on LDK (rust-lightning). Provides DUMB-RPC interface (telnet friendly). Example: Build it run it:

Owner
Caren
Android @ Google
Caren
Kotlin HTTP requests library. Similar to Python requests.

khttp khttp is a simple library for HTTP requests in Kotlin. It functions similarly to Python's requests module. import khttp.get fun main(args: Arra

Anna Clemens 466 Dec 20, 2022
Practice parsing data from the internet

InspirationalQuotesExercise A small Android project to practice executing network requests and parsing the network response This app uses the ZenQuote

Ayana Bando 0 Oct 19, 2021
SimpleApiCalls is a type-safe REST client for Android. The library provides the ability to interact with APIs and send network requests with HttpURLConnection.

SimpleApiCalls ?? SimpleApiCalls is a type-safe REST client for Android. The library provides the ability to interact with APIs and send network reque

null 4 Nov 28, 2022
LiteHttp is a simple, intelligent and flexible HTTP framework for Android. With LiteHttp you can make HTTP request with only one line of code! It could convert a java model to the parameter and rander the response JSON as a java model intelligently.

Android network framework: LiteHttp Tags : litehttp2.x-tutorials Website : http://litesuits.com QQgroup : 42960650 , 47357508 Android网络通信为啥子选 lite-htt

马天宇 829 Dec 29, 2022
TART: Tracing Action Response Times

Square Tart Tracing Action Response Times! This library is not stable for usage beyond Square, the APIs and internals might change anytime. Tart... ?

Square 246 Nov 24, 2022
Pluto is a on-device debugger for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manipulating application data on-the-go.

Pluto Pluto is a on-device debugger for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manip

Mocklets 8 Aug 22, 2022
Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.

ℹ️ ?? Get started with 4.x ?? Try it out Get the demo APK Still using 3.x ? It's not maintained or supported. You may have security issues and problem

Alex Gotev 2.7k Jan 3, 2023
super simple library to manage http requests.

HttpAgent super simple library to manage http requests. Gradle dependencies { implementation 'com.studioidan.httpagent:httpagent:1.0.16@aar' } No

idan ben shimon 32 Oct 24, 2021
Whois4K - A library for who is requests

Whois4K - A library for who is requests

Lyzev 1 Apr 6, 2022