User Input

Select views
-2 TextViews, 1 Button

Position views
-Use LinearLayout as parent ViewGroup for these 3 children view set LinearLayout orientation to be vertical

Style views
-Quanity header should be in all caps
-Quantity value should be in black font color
-Add spacing between views

activity_main.xml

<LinearLayout xmlns:android="http://schemas.android."
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:paddingBottom="@dimen/activity_vertical"
	android:paddingLeft="@dimen/activity_horizontal"
	android:paddingRight="@dimen/activity_horizontal"
	android:paddingTop="@dimen/activity_vertical"
	android:orientation="vertical"
	tools:context=".MainActivity">

	<TextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_marginBottom="16dp"
		android:text="Quantity" 
		android:textAllCaps="true" />

	<TextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="0"
		android:textSize="16sp"
		adnroid:textColor="@android:color/black" />

 	<Button
   	 android:layout_height="wrap_content"
     android:layout_width="wrap_content"
     android:layout_marginTop="16dp"
     android:text="Order" />

</LinearLayout>

button android
https://developer.android.com/reference/android/widget/Button.html

conversation list activity

Java file -> MainActivity.java

package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends ActionBarActivity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu){
		// Inflate the menu; this adds items to the action
		getMenuInflater().inflate(R.menu.menu_main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item){

		int id = item.getItemId();

		if ( id == R.id.action_settings){

		}
	}
}

comments java
http://journals.ecs.soton.ac.uk/java/tutorial/getStarted/application/comments.html

Data Analysis Process

extract -> clean -> explore -> analyze -> share

Bar graphs, Histograms, Scatter plots
Geospatial plots, Choropleth, Cartogram, Small multiples, Box plots, violin plots
Strip charts

choosing a good chart
http://extremepresentation.typepad.com/blog/2006/09/choosing_a_good.html

Bullet graphs, Sparkline, Connected scatter plot, Kernel density estimate, Cycle plots
Using color, Color palettes, Sequential palettes, Diverging palettes, Palettes for qualitative data

lie factor = size of effect shown in graphic / size of effect in data

Affordances

Affordances
-right size
-flip it
-throw it
-hide behind it

conceptual model
signified

most interesting solution comes out most interesting question.

good conceptual model <-> inaffective conceptual model

Quantitative:Quantitative data are things you measure as numbers such as temperature, money, and the number of scratches from your cat. You can split quantitative data into two groups, continuous and discrete.

Qualitative:Qualitative data is descriptive information about things that can’t be quantified with numbers, like male/female and hair color. These are categorical data, data that indicates belonging to a category or group. Often you’ll want to group your data by the categories and compare them.

Representing data with visual elements
Dots, Lines, Bars, Color

function

func averageScore(firstScore: Double, secondScore: Double, thirdScore: Double){
	let totalScore = firstScore + secondScore + thirdScore
	print(totalScore/ 3)
	}
func nameOfFunction(/* parameters */) -> Type {
	var valueToReturn: Type
	return valueToReturn
}

func calculateTip(priceOfMeal: Double) -> Double {
	return priceOfMeal * 0.15
}

func isValidLength(password: String) -> Bool {
	if password.characters.count >= 8 {
		return true
	} else {
		return false
	}
}

func calculateTip(priceOfMeal: Double -> Double{
	return priceOfMeal * 0.15
	})

let priceOfMeal = 43,27

let tip = calculateTip(priceOfMeal: priceOfMeal)

what’s string about

let theTrueth = "Money can't buy me love."
theTruth.characters.count

var forwardString = "spoons"
var charactersReversed = forwardString.characters.reversed()

for character in charactersReversed {
	print ("\(character)")
}

let similarTruth = "can't buy me"
var birthdayCheer = "Happy Birthday!"
print(birthdayCheer)

var name = "Kate"
var customizedBirthdayCheer = "Happy Birthday, \(name)!"
print(customizedBirthdayCheer)
var doggyDiet = "Mia eats 10 lbs of dog food per month."

var dogName = "Zebedee"
var lbsPerMonth: Double = 25

doggyDiet = "\(dogName) eats \(lbsPerMonth)lbs of dog food per month"

print(doggyDiet)

var kilosInALb = 0.45
var metricDoggyDiet = "\(dogName) eats \(kilosInALb * lbsPerMonth)kilos of dog food per month"

print(metricDoggyDiet)
let monkeyString = "I saw a monkey."
let thiefString = "He stole my iPhone."

var monkeyStringWithEmoji = "I saw a *."
var thiefStringWithEmoji = "He stole my *."

var forwardString = "time"
var charactersReversed = forwardString.characters.reversed()

for character in charactersReversed {
	print("\(character)")
}

let numOfPennies = 567
let dollarInt = numofPennies/100
let dollarsAndCentsString = "$\(dollarInt).\(numOfPennies % 100)"

let monkeyString = "I saw a monkey."
let thiefString = "He stole my iPhone."
var sillyMonkeyString = monkeyString + "" + thiefString

replacingOccurences(of: with:)

sillyMonkeyString.contains("key")

Different types of variables

var petsAge = 12
var myMiddleInitial: Character = "A"
var numberOfWheels: Int = 4
var centimetersOfRainfall: Float = 5.5
var pi: Double = 3.14159265359
var letterOfTheDay: Character = "z"
var myFavoriteAnimal: String = "nudibranch"
var rainingOutside: Bool = true
let encouragement = "you can do it!"
var customizedEncouragement = "you can do it, stephanie!"
customizedEncouragement = "you can do it, Ryder!"

let birthYear = 2008
var currentYear = 2017
var age = currentYear - birthYear
currentYear = 2017
age = currentYear - birthYear

Names cannot contain whitespace characters, mathematical symbols, arrows and [a few other obscure characters].
Names must begin with an uppercase or lowercase letter A through Z, an underscore, or [a few other less common options].

let theTrue = "Money can't buy me love."

var characterPoorString = ""
let stringWithPotential = String()

Sandbox

// test code here!
print((200 * 7)/2)

print("hello from iOS team")

var question = "Ready to write your first lines of Swift code?"
print(question)

var response = "Yeah! I'm ready!"
print(response)
var numberOfServingsForRecipe = 4
var desiredNumberOfServings = 8

var servingsFactor = desiredNumberOfServings/numberOfServingsForRecipe

var poundsOfTomatoesForRecipe = 2
var amountToUseToday = poundsOfTomatoesForRecipe * servingsFactor

print(amountToUseToday)

Drawing to code

step1: select the views
step2: position the views
step3: style the views

what view group should you use
-LinearLayout
-RelativeLayout : relative positioning, overlap

The drawable folder
android:src=”@drawable/androidparty”

Position the view
Style the view

Trouble shooting

android studio strouble shooting
https://docs.google.com/document/d/1w1Xn_hnSAODAAtdRDp7haYPBtEwX_l7Htpf8Wpgbu6w/pub?embedded=true

Linear layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:paddingBottom="@dimen/activity_vertical_margin"
	android:paddingLeft="@dimen/activity_horizontal_margin"
	android:paddingRight="@dimen/activity_horizontal_margin"
	android:paddingTop="@dimen/activity_vertical_margin"
	tools:context="com.xxx.myapplication.MainActivity">

	<TextView
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:text="Hello world!" />
</RelativeLayout>