USGS earthquake API parameters

USGS earthquake API parameters

parameter name: description
mag: short for “magnitude”
place: where the earthquake occurred
time: when the earthquake occurred
felt: how strong this quake was felt
tsunami: was there a tsunami alert issued?
title: the title of the quake (mag + place)
coordinates: where the earthquake occured (long, lat, depth)


import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;

public class EarthquakeActivity extends AppCompactActivity {

	public static final String LOG_TAG = EarthquakeActivity.class.getName();

	protected void onCreate(Bundle savedInstanceState){

		ArrayList<String> earthquakes = new ArrayList<>();
		earthquakes.add("San Fransisco");
		earthquakes.add("Mexico City");
		earthquakes.add("Rio de Janeiro");

		ListView earthquakeListView = (ListView) findViewById(;

		ArrayAdapter<String> adapter = new ArrayAdapter<String>(
			this, android.R.layout.simple_list_item_1, earthquakes);



USGS spreadsheet format

real-time data provided by USGS in spreadsheet format, most useful data in app.
date, latitude, longitude, depth, magnitude, place, type

For Developers API documentation

Get geojson data from query and parameter

json pretty print

-time is unix timestamp

more than 4.5 magnitude

Better Practice for User Interface

Best practices for User Interface

-Designing for Multiple Screens
How to build a user interface that’s flexible enough to fit perfectly on any screen and how to create different interaction patterns that are optimized for different screen sizes.

-Build a Responsible UI with ConstraintLayout
How to build a layout using ConstraintLayout and the Android Studio Layout Editor.

-Adding the App Bar
How to use the support library’s toolbar widget to implement an app bar that displays properly on a wide range of devices.

-Showing Pop-Up Message
How to use the support library’s Snackbar widget to display a brief pop-up message.

-Creating Custom Views
How to build custom UI widgets that are interactive and smooth.

-Creating Backword-Compatible UIs
How to use UI components and other APIs from the more recent versions of Android while remaining compatible with older versions of the platform.

-Implementing Accessibility
How to make your app accessible to users with vision impairment or other physical disabilities.

-Managing the System UI
How to hide and show status and navigation bars across different versions of Android, while managing the display of other screen components.

-Creating Apps with Material Design
How to implement material design on Android.


Alteryx: here we go

sources of data
-transactional, devices, collected

categories of data
-structured, unstructured, semi-structured

structured data
-columns(fields) and rows

Vertical Layouts

Label, imageView, Button

One Whole: numerator / denominator

repeated multiplication base^exponent
3^0 = 1
4^-1 = 1/4
4^-2 = 1/16
4^-3 = 1/56

be care for negative exponent

a cell divides into 4 cells after 2hours. how many cells are there after one day?
4^12 = 16777216

View Properties

Intrinsic Content Size
Compression Resistance
Content Hugging

-stack view
axis, spacing, alignment, distribution

happily modifies size of view
-> fill(default), fill equally, fill proportionally

works hard not to modify size of views
->equal spacing, equal centering

alignment -horizontal stack views
text-> ascender, baseline, descender

guiding principles of autolayout
-stackView first, constraints later
-Start small, or not at all
-Work from the inside out
-Trust the simulator only
-Don’t panic

Seven Commandments of AutoLayout
1. Tweak the properties of the StackView
2. Use another StackView
3. Tweak the compression resistance or the hugging priority
4. Add constraints to the StackView
5. Add constraints to the views
6. To connect views within different StackViews, use V.
7. If everything else fails, use a filler view