Bark 앱 – 위치기반 소셜미디어 앱
Month: September 2016
Individual Assignment 2
– “LBS-based Mobile Augmented Reality” survey
Fall 2016
Kyoung Shin Park
September 20, 2016
Individual assignment – “LBS-based Mobile Augmented Reality” survey report (10 points)
With the advances in mobile devices and technologies that combine the real world with virtual information, augmented reality applications are as near to hand as any other application on a smart phone. Mobile AR application allows users to get experience interacting with virtual people/objects in the physical world using their mobile devices.
The goal of this assignment is for you to learn the key design aspect of augmented reality applications/games on a mobile phone, and think about how to design if you would create your own Mobile AR application.
In this assignment, you are to research 2~3 subjects of your interest on Mobile Augmented Reality Applications from the web sites given below and then summit the report (3-page) on Mobile AR technology survey, due by Sep 27th, 2016.
Reference:
Layar, worlds first mobile augmented reality browser on mobile
http://www.youtube.com/watch?v=b64_16K2e08
Wikitude AR Travel Guide
http://www.youtube.com/watch?v=8EA8xlicmT8&feature=related
Metaio Augmented Vision
http://venturebeat.com/2009/08/04/metaio-launches-augmented-reality-platform-for-mobile-sharing-marketing/
Nearest Tube Augmented Reality App for iPhone 3GS from acrossair
http://www.youtube.com/watch?v=U2uH-jrsSxs&feature=related
Sekai Camera
http://www.youtube.com/watch?v=XcdHGPnVUHU
iBufferfly = AR + GIS + Motion Sensor + Coupon
http://www.mobileart.jp/ibutterfly_en.html
Twitter Feed on an Augmented Reality Building
http://www.youtube.com/watch?v=n1ANVCDHYA4&feature=player_embedded
CES: Battling AR helicopter controlled by iPhone
http://www.youtube.com/watch?v=TSv2ca-IECc&NR=1&feature=fvwp
AR! Pirates – Augmented Reality Mobile Game
http://www.youtube.com/watch?v=al7StPimtRs
ARhrrrr – An Augmented Reality Shooter
http://www.youtube.com/watch?v=cNu4CluFOcw&feature=player_embedded
ARIS Mobile Media Learning Games
http://arisgames.org
Kweekies – mobile augmented reality game by int13 (IMGAwards demo)http://www.youtube.com/watch?v=Te9gj22M_aU&feature=related
Mobile AR Cooking Game “PAN MASTER”
http://www.youtube.com/watch?v=JuzVH7loGvo
Mobile AR Networking Game “AR FIGHTER”
http://www.youtube.com/watch?v=tGc6J7qDsGo&feature=related
Tagdis: The Virtual graffiti game you play in the real world
http://tagdis.com/
Art of Defense: a Mobile AR Game with Sketch-Based Interaction and Dynamic Multi-Marker Building Techniques
http://www.augmentedenvironments.org/lab/research/handheld-ar/artofdefense/
Mirror Worlds
http://www.augmentedenvironments.org/lab/2009/10/
DataStructureTest
//: Playground – noun: a place where people can play
// DataStructure (function, optional, enum, class, inheritance, struct)
// Kyoung Shin Park (2016 Fall)
import Cocoa
// function
func sayHello(personName: String = “World”) -> String {
let greeting = “Hello, ” + personName + “!”
return greeting
}
var delegate = sayHello()
print(sayHello())
print(sayHello(“Anna”))
print(delegate)
// Optional & Forced unwrapping & Optional binding
let planets = [“Mercury”:1, “Venus”:2, “Earth”:3] // assign dictionary
let planetID: Int? = planets[“Earth”]
if planetID != nil { // check if planetID is nil to prevent run-time error
print(“Earth = \(planetID!)”) // Forced unwrapping (using !) Earth = 3
} else {
print(“Earth is not found”)
}
// Optional binding (unwrapping an optional)
if let planetID = planets[“Earth”] { // return true if planetID has valid value
print(“Earth = \(planetID)”) // Earth = 3
}
// ImplicitlyUnwrappedOptional
var w: Int! = 1 // same as var w: ImplicitlyUnwrappedOptional<Int> = 1
print(w) // you don’t need to put !
var z: Int! // same as var z: ImplicitlyUnwrappedOptional<Int> = nil
//print(z) // RUN-TIME ERROR (because z is nil)
w = nil // OK
//print(w) // RUN-TIME ERROR (because w is nil) while unwrapping
// Nil coalescing operator
let defaultColorName = “Red”
var userDefinedColorName: String? // set to nil
// colorNameToUse = “Red” (because userDefinedColorName = nil)
var colorNameToUse = userDefinedColorName ?? defaultColorName
// if planets[“Earth”] = nil then it will return the default value 0)
var ID : Int? = planets[“Earth”] ?? 0 // var earthID: Int? = 3
// Optional chaining
class Person {
var contact: Contact? // automatically set to nil
}
class Contact {
var address: String? // automatically set to nil
var telephone: String? // automatically set to nil
}
let p = Person()
//var phone = p.contact!.telephone! // run-time error(because contact=nil)
if let contact = p.contact { // optional binding to read optional property
if let phone = contact.telephone {
print(phone)
} else {
print(“phone is nil”)
}
} else {
print(“contact is nil”)
}
// optional chaining
var phone = p.contact?.telephone // phone=nil (because contact=nil)
print(phone)
// use optional chaining & optional binding together
p.contact = Contact()
p.contact?.telephone = “12345”
if let phone = p.contact?.telephone {
print(p.contact?.telephone)
}
// Enumeration
enum Gender {
case Female
case Male
init() { // initialization
self = .Female
}
init(_ name: String)
{
switch name {
case “Female”, “여자”: self = .Female
case “Male”, “남자”: self = .Male
default: self = .Female
}
}
var description: String {
switch self {
case .Female: return “FEMALE~”
case .Male: return “MALE~”
}
}
}
var gender = Gender()
print(gender.description)
gender = Gender(“남자”)
print(gender.description)
gender = Gender.Female
gender = .Male
print(Gender.Male.description)
switch gender {
case .Female: print(“FEMALE!!”)
case .Male: print(“MALE!!”)
}
// Enum, multiple member values can appear on a single line, separated by commas
// Enum rawValue
enum Planet: Int {
case Mercury=1, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune
}
let earthID = Planet.Earth.rawValue
let somePlanet = Planet.Earth
switch somePlanet {
case .Earth:
print(“Mostly harmless”)
default:
print(“Not a safe place for humans”)
}
let aPlanet = Planet(rawValue: 7)
switch aPlanet! {
case .Earth:
print(“Mostly harmless”)
default:
print(“Not a safe place for humans”)
}
if let possiblePlanet = Planet(rawValue: 9) {
switch possiblePlanet {
case .Earth:
print(“Mostly harmless”)
default:
print(“Not a safe place for humans”)
}
} else {
print(“There isn’t a planet at position 9”)
}
// Enum associated values
enum TrainStatus {
case OnTime
case Delayed(Int)
}
var status:TrainStatus = .Delayed(5)
status = .OnTime
switch status {
case .OnTime:
print(“Train is on time”)
case .Delayed(let minutes):
print(“Train is delayed by \(minutes) minutes”)
}
// class
class Vehicle {
// stored properties
var numberOfPassengers: Int = 2
var numberOfWheels: Int = 4
// computed properties
var NumberOfWheels: Int {
get { return numberOfWheels }
set { numberOfWheels = newValue }
}
var description: String {
return “\(numberOfWheels) number of wheels”
}
}
class Bicycle: Vehicle {
override init() {
super.init()
numberOfPassengers = 1
numberOfWheels = 2
}
}
class Car: Vehicle {
// stored properties
var minVelocity: Int = 30
var accelVelocity: Int = 10
// computed properties
var speed: Int {
get {
return minVelocity + accelVelocity
}
set(newVelocity) {
accelVelocity = newVelocity – minVelocity
}
}
}
// struct
struct Frame {
var x: Int, y: Int // stored property
var width: Int, height: Int // stored property
var area: Int { // computed property (don’t need to enclose getter)
return width * height
}
mutating func addWidth(width: Int) {// method
self.width += width // mutating modifies the value of a stored property
}
}
let f = Frame(x: 5, y: 10, width: 100, height: 100) // member-wise initializer
//f.width = 250 // invalid (can’t change the struct properties stored in a let)
var g = Frame(x: 5, y: 10, width: 100, height: 100)
g.addWidth(15) // use mutating func to modify the value of a stored property
print(g.width) // 15
let h = Frame(x: 5, y: 10, width: 100, height: 100)
//h.addWidth(15) // compile error (can’t call mutating func of struct stored in a let)
EnumTest
//: Playground – noun: a place where people can play
// Swift EnumType (enum)
// Kyoung Shin Park (2016 Fall)
import Cocoa
import Foundation
// enum
enum Geometry : Int, CustomStringConvertible {
case Sphere = 1
case Cone
case Cylinder
case RectangularPrism
case SquarePyramid
case IsoscelesTriangularPrism
init(_ name: String)
{
switch name {
case “Sphere”, “구”, “1”: self = .Sphere
case “Cone”, “원뿔”, “2”: self = .Cone
case “Cylinder”, “원기둥”, “3”: self = .Cylinder
case “RectangularPrism”, “사각기둥”, “4”: self = .RectangularPrism
case “SquarePyramid”, “정사각뿔”, “5”: self = .SquarePyramid
case “IsoscelesTriangularPrism”, “이등변삼각기둥”, “6”: self = .IsoscelesTriangularPrism
default: self = .Sphere
}
}
var description: String {
switch self {
case .Sphere: return “Sphere”
case .Cone: return “Cone”
case .Cylinder: return “Cylinder”
case .RectangularPrism: return “RectangularPrism”
case .SquarePyramid: return “SquarePyramid”
case .IsoscelesTriangularPrism: return “IsoscelesTriangularPrism”
}
}
static func getGeometryBy(index : Int) -> Geometry? {
switch index {
case 1: return .Sphere
case 2: return .Cone
case 3: return .Cylinder
case 4: return .RectangularPrism
case 5: return .SquarePyramid
case 6: return .IsoscelesTriangularPrism
default: return nil
}
}
// use anyGenerator to get a generator that can enumerate across your values
static func enumerate() -> AnyGenerator<Geometry> {
var nextIndex = Sphere.rawValue
return anyGenerator { Geometry(rawValue: nextIndex++) }
}
}
for geo in Geometry.enumerate() {
print(geo.description)
}
var geo = Geometry(“1”)
print(geo.description)
geo = Geometry(“원뿔”)
print(geo.description)
geo = Geometry(“Cylinder”)
print(geo.description)
geo = Geometry.RectangularPrism
print(geo.description)
geo = .SquarePyramid
print(geo.description)
if let g = Geometry.getGeometryBy(6) {
print(g.description)
}
ArrayDictionaryTest
// Array & Dictionary: Playground – noun: a place where people can play
// Kyoung Shin Park (2016 Fall)
import UIKit
var a = Array<String>()
var b = [String]()
var c = [Int](count: 3, repeatedValue: 1)
let animals = [“Giraffe”, “Cow”, “Dog”, “Cat”]
//animals.append(“Bird”) // due to let
var animal = animals[1]
//var animal2 = animals[5] // due to out of bounds
for animal in animals {
print(animal)
}
for (index, value) in animals.enumerate() {
print(“animals[\(index)]=\(value)”)
}
b.append(“Egg”)
b += [“Cocoa”, “Milk”, “Flour”]
b[1…3] = [“Apple”, “Butter”]
print(b)
c.insert(4, atIndex: 1)
c.insertContentsOf([5,6], at: 2)
c.removeAtIndex(1)
c.removeRange(0..<2)
c.replaceRange(0…1, with: [8,9,7])
let sorted = c.sort { $0 < $1 }
for value in sorted {
print(value)
}
// map, filter, reduce
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
var arr1 = arr.map { (x)->Int in return x+1 }
print(arr1)
var arr2 = arr.map { (x)->Int in return x*2 }
print(arr2)
var arr3 = arr.filter { (x)->Bool in return x%2 == 0 }
print(arr3)
var sum = arr.reduce(0, combine: { (result, x)->Int in return result+x } )
print(sum)
let sum2: Int = arr.reduce(0) { $0 + $1 }
print(sum2)
let stringified = arr.map { “\($0)” }
print(stringified)
// dictionary
var planets1 = Dictionary<String, Int>() //empty dictionary
var planets = [String: Int]() // empty dictionary
planets = [ “Mercury”:1, “Venus”:2
] // assign
planets[“Mars”] = 3 // append
for (key, value) in planets {
print(“\(key) = \(value)”)
}
planets[“Mars”] = 4 // replace
for (key, value) in planets {
print(“\(key) = \(value)”)
}
let earth = planets[“Earth”] // earth is an Int? (should be nil)
if earth == nil {
print(“Earth is not found”)
} else {
let earthID = earth! // use forced unwrapping !
print(“Earth = \(earthID)”)
}
planets[“Earth”] = 3 // append Earth
// optional binding
if let earthID = planets[“Earth”] {
print(“Earth = \(earthID)”)
}
ArrayTest
//: Playground – noun: a place where people can play
// Swift2 string, array
// Kyoung Shin Park (2016 Fall)
import UIKit
//string
let hello = “Hello”
let world = “World”
let smile = “?”
var h = hello + ” ” + world // “Hello World”
h += “, Swift” // “Hello World, Swift”
h.append(Character(“!”)) // “Hello World, Swift!”
var strH = h.stringByAppendingString(smile) // Hello World, Swift!
print(strH)
print(strH.uppercaseString)
var len = hello.characters.count // “Hello” 5
var len2 = hello.startIndex.distanceTo(hello.endIndex) // “Hello” 5
for s in hello.characters { // using foreach
print(“\(s)”)
}
for i in 0..<hello.characters.count { // using String.Index & range
print(“\(i): \(hello[hello.startIndex.advancedBy(i)])”)
}
for (index, value) in hello.characters.enumerate() { // using array & tuple
print(“\(index): \(value)”)
}
// array
func fillArray(inout arr: [Int]) {
arr.appendContentsOf([1, 2, 3])
}
var myArray : [Int] = []
fillArray(&myArray)
print(myArray)
var a = Array<String>()
var b = [String]()
var c = [Int](count: 3, repeatedValue: 1)
var animals = [“Giraffe”, “Cow”, “Dog”, “Cat”]
animals.append(“Bird”)
var animal = animals[1]
for animal in animals { // using foreach
print(animal)
}
for i in 0..<animals.count { // using index & range
print(“animals[\(i)]=\(animals[i])”)
}
for (index, value) in animals.enumerate() { // using tuple & enumerate
print(“animals[\(index)]=\(value)”)
}
b.append(“Egg”)
print(b)
b += [“Cocoa”, “Milk”, “Flour”]
print(b)
b[1…3] = [“Apple”, “Butter”]
print(b)
c.insert(4, atIndex: 1)
print(c)
c.insertContentsOf([5,6], at: 2)
print(c)
c.removeAtIndex(1)
print(c)
c.removeRange(0..<2)
print(c)
c.replaceRange(0…1, with: [8,9,7])
print(c)
let sorted = c.sort { $0 < $1 }
for value in sorted {
print(value)
}
// http://useyourloaf.com/blog/swift-guide-to-map-filter-reduce/
// collections – map, filter, reduce
let odd: [Int] = sorted.filter { $0 % 2 != 0}
print(odd)
let stringified: [String] = sorted.map { “\($0)” }
print(stringified)
let squares: [Int] = sorted.map { $0 * $0 }
print(squares)
let sum: Int = [1, 2, 3].reduce(0) { $0 + $1 } // adds up the numbers in the Array
print(sum)
StringTest
//: Playground – noun: a place where people can play
// Swift2 string blog
// https://developer.apple.com/swift/blog/?id=30
// Kyoung Shin Park (2016 Fall)
import Cocoa
var letters: [Character] = [“c”, “a”, “f”, “e”]
var cafe = String(letters)
print(letters.count)
print(cafe)
print(cafe.characters.count)
// print char of string “cafe”
for c in cafe.characters {
print(c)
}
let acuteAccent : Character = “\u{0301}”
cafe.append(acuteAccent)
print(cafe)
print(cafe.characters.count)
print(cafe.characters.last!)
cafe.characters.contains(“e”)
cafe.characters.contains(“´”)
cafe.characters.contains(“é”)
// In Swift, strings are considered equal regardless of whether they are constructed from decomposed or precomposed character sequences:
let decomposed = “\u{1100}\u{1161}” // ᄀ + ᅡ
let precomposed = “\u{AC00}” // 가
decomposed == precomposed // true
let string1 = “”
var string2: NSString = “Hello”
switch (string2) {
case let string2 as NSString:
print(“string2 is NSString”)
case let string2 as String:
print(“string2 is String”)
default:
print(“None of those”)
}
var len = string2.length
var string3 = String(“Hello”)
string3 += ” World”
string3.append(Character(“!”))
var string4 = String(count: 7, repeatedValue: Character(“A”))
var string5 = NSString()
var string9 = NSString(string: “Hello”)
var string6 = NSMutableString(capacity: 10)
var total = 100
var string7 = “\(string3)! total=\(total)”
var string8: NSString = string7
//var string10: String = string3.stringByAppendingFormat(” append %@”, total)
//print(string10)
string5 = string2.stringByAppendingFormat(” append %@”, string8)
print(string8)
print(string8.description)
var str = “Hello”
var world = ” World”
var smile = “?”
var mark = “!~”
var combined = str + mark
var combined2 = (str + world).stringByAppendingString(smile)
var len2 = combined2.characters.count
// length
var length = combined.characters.count
var len3 = combined.startIndex.distanceTo(combined.endIndex)
var len4 = (combined as NSString).length
// print char of string
for char in combined.characters {
print(char)
}
print(combined2.lowercaseString)
print(combined2.uppercaseString)
print(combined2.capitalizedString)
if let range = combined.rangeOfString(“ello”) { // contains
print(“ello”)
}
else {
print(“none”)
}
var trail = combined.substringWithRange(Range<String.Index>(start: str.endIndex, end: combined.endIndex))
print(“combined = \(combined)”)
let startIndex = combined.startIndex.advancedBy(2)
let endIndex = combined.startIndex.advancedBy(5)
//combined.insert(“^”, atIndex: combined.endIndex)
//let question : Character = “?”
//combined.append(question)
//print(combined)
combined.insert(“a”, atIndex: startIndex)
combined.insertContentsOf(“bc”.characters, at: startIndex.successor())
combined.removeAtIndex(combined.endIndex.predecessor())
print(combined)
let substring = combined[startIndex..<endIndex]
print(“substring = \(substring)”)
var sub2 = combined.substringWithRange(Range<String.Index>(start: startIndex, end: endIndex))
print(sub2)
var myString = “Seoul, New York, Tokyo LA”
var myArray = myString.componentsSeparatedByString(“,”)
for s in myArray {
print(s)
}
var myArray2 = myString.componentsSeparatedByCharactersInSet(NSCharacterSet(charactersInString: “, “))
for s in myArray2 {
print(s)
}
var num = “56.25”
if let range = num.rangeOfString(“.”) {
let wholeNum = num[num.startIndex..<range.startIndex]
print(“wholeNum=\(wholeNum)”)
num.replaceRange(num.startIndex..<range.startIndex, with: “32”)
print(“num=\(num)”)
num.removeRange(num.startIndex..<range.startIndex)
print(“num2=\(num)”)
}
let animals = [“Giraffe”, “Cow”, “Dog”, “Cat”]
//animals.append(“Bird”)
var animal = animals[2]
for (index, value) in animals.enumerate() {
print(“animals[\(index)]=\(value)”)
}
DataType
//: Playground – noun: a place where people can play
// Swift2 DataType (constant, variable)
// Swift2 DataType (int, float, double, char, string, tuple, type inference, type casting)
// Kyoung Shin Park (2016 Fall)
import Cocoa
// constant
let x = 16 // Int (type inference)
let y : Double = -2.3 // Double
let z = -1.2 // Double (type inference)
let w : Float = -1.7 // Float
let str = “Hello, playground” // String (type inference)
let c1 = “A” // String (type inference)
let c2 : Character = “A” // Character
print(“x=\(x) y=\(y) z=\(z) w=\(w) y+z=\(y+z)”)
print(“x+y+z+w=\(Double(x)+y+z+Double(w))”) // type casting
print(“str=\(str) c1=\(c1) c2=\(c2)”)
// tuple
let (s, t, r, u, v) = (“ABC”, “D”, 1, 3.5, true) // tuple
print(“s=\(s) t=\(t) r=\(r) u=\(u) v=\(v)”)
let tupleValues = (“ABC”, “D”, 1, 3.5, true) // tuple
print(“\(tupleValues.0) \(tupleValues.1) \(tupleValues.2) \(tupleValues.3) \(tupleValues.4)”)
// variable
var isUsed = true // Bool (type inference)
if isUsed {
print(“isUsed=\(isUsed)”)
}
var a = 10 // Int (type inference)
print(“a=\(a)”)
a = 20
print(“a=\(a)”)
var b : UInt // UInt declaration
b = 30 // initialization
print(“b=\(b)”)
print(“a+b=\(a+Int(b))”)
for i in a…Int(b) {
print(i)
}
for j in 0..<5 {
print(j)
}
var str1 = “Hello” // String (type inference)
print(“str1=\(str1)”)
str1 += ” World” // String += operator
print(“str1=\(str1)”)
for s in str1.characters { // using foreach
print(“\(s)”)
}
for i in 0..<str1.characters.count { // using String.Index & range
print(“str1[\(i)]=\(str1[str1.startIndex.advancedBy(i)])”)
}
var charView = str1.characters
for (index, value) in charView.enumerate() { // using array & tuple
print(“str1[\(index)]=\(value)”)
}
Lecture2
Lecture2
Apple Special Event (September 7, 2016)
Apple Special Event (September 7, 2016)
– iPhone 7, Apple Watch 2, AirPods
http://www.apple.com/apple-events/september-2016/
애플 스페셜 이벤트