On your platform of choice, build a VERY simple app that will allow a user to make a basic request to the buildings API to look up info about a building at UVA. You do NOT have to provide an interface for EVERY option in the API, but you are welcome to expand upon the basic request outlined here.
The app should have an EditText / UITextField that allows a user to type in the building name and a button that initiates the search. The info should be displayed in the app somehow (i.e. not to the console through Log.d or print()), but it's up to you how you want to do this.
Your app does not have to be fancy in any way, but please make it "neat and clean..." I would prefer not to grade sloppy looking apps.
I highly suggest using Retrofit (https://square.github.io/retrofit/) to make your calls. Using native Java is pretty painful in my experience. There are other libraries that do this, but Retrofit is the one I see used the most.
Check out their GitHub repo for some samples (https://github.com/square/retrofit) along with whatever else you can Google. Note that to add Retrofit to your build path, you'll need to add implementation 'com.squareup.retrofit2:retrofit:2.4.0' to your Gradle build file along with the other implementation lines.
I would suggest just using the built-in Swift libraries, as they are relatively straightforward, but you can use other libraries if you like. Chapter 5.5 in the Swift book outlines exactly how to do this. This Xcode Playground shows you how you could make a JSON REST call against iTunes - the concept is the same: http://cs4720.cs.virginia.edu/resources/iTunesSearch.playground
Today we're going to start discussing REST - Representation State Transfer - a software architectural style for distributed hypermedia systems, such as the web.
The main principles of REST are the following:
Stateless Client/Server Protocol: Each message contains all the information needed by a receiver to understand and/or process it. This constraint attempts to "keep things simple" and avoid needless complexity.
Idempotency: you get the same result from the same action
A set of uniquely addressable resources enabled by a universal syntax for resource identification; "Everything is a Resource" in a RESTful system
A set of well-defined operations that can be applied to all resources; In the context of HTTP, the primary methods are POST, GET, PUT, and DELETE, similar (but not exactly) to the database world's notion of CRUD (Create, Read, Update, Delete).
The use of hypermedia both for application information and state transitions. Resources are typically stored in a structured data format that supports hypermedia links, such as HTML or XML
Let's look at how SIS works - it's command based. You do a command and the system responds. The system is built around verbs. In a RESTful system, the design emphasis is around nouns and resources - what their representation is and how they are affected by the standard methods. In REST, we assume four basic operations - Retrieve, Remove, Create, Update. Very much like Get, Delete, Post, and Put from HTTP and Select, Insert, Update, Delete from SQL.
For example, you could create an XML or JSON representation of an object that is then retrieved and modified by clients via the standard methods. Using HTTP commands, the XML or JSON could be retrieved with GET, modified, PUT back on the server.
A web application that is RESTful:
Is bookmarkable (in general)
Has "good looking" URLs
Has a good data model behind it
Often has a good external API
Fully takes advantage of the Internet's asynchronous nature
We will first look at more examples on RESTful websites that you have found. Check out the Postman tool for connecting to RESTful APIs.
We'll look today at the data that is stored and managed by apps, starting with the assets you ship with the app itself along with user-created content. We'll go through the four major ways of storing data with Android, specifically looking at an example project.
You are allowed to work with someone this week on the lab if you need to work together on someone's Mac. However, this lab is intended to make you start considering how you are going to do your iOS Mini-App. You can:
Own a Mac
Work with someone that owns a Mac (and only use their machine)