1 / 11

apps

apps. l earning objectives. writing apps! Wall, Tap events and Pages Records Geo-location Search Web APIs and web requests RSS, JSON, XML. wall. The wall represents the screen New item on top “a la facebook ” ( set reversed to reverse order) Clear the wall wall->clear

libba
Download Presentation

apps

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. apps

  2. learning objectives • writing apps! • Wall, Tap events and Pages • Records • Geo-location • Search • Web APIs and web requests • RSS, JSON, XML

  3. wall • The wall represents the screen • New item on top “a la facebook” (set reversed to reverse order) • Clear the wall wall->clear • Background color and picture wall->set background(colors->random) • Title and subtitle wall->set title(“Title of my change”)

  4. textbox • A skin-able textbox vartb:= wall->create text box(“Run”, 19) • Change color, font size, etc… • Attach tap event event tap wall TextBox(item : TextBox) if item->text->equals(“Run”) then ...

  5. page stack • A page contains a “wall” • Pages can be stacked • wall->push new page, adds a new blank wall • wall->pop page, removes the top wall • The user can pop a page by pressing the back button

  6. records • structured data • Table: Similar to your Excel table. • Index: table with index lookup • Object: garbage collected objects (and collections) • Decorator: add fields to existing objects

  7. 1 table per script record car model : string year : number • table var r := car table->create row r->model->set(“beetle”)var year := r->year->get • index (model is key) var r := car table->at(“beetle”) r->year->set(“beetle”) • object var r := car table->create r->model->set(“beetle”)r->year->set(1970)varrs:= car table->create collectionrs->add(r) Keys are immutable Collection is like a list

  8. geo-location Retrieve the longitude and latitude of the phone. • varloc := senses->current location • Low precision 1 mile. • Might use WiFi or Cell tower • varloc := senses->current location accurate • Better precision, tries to force GPS. • Easy way to show a map loc->post to wall

  9. invalid values • What if the user refuses to give his location? varloc := senses->current location • The value loc is invalid. if loc->is invalid then // do something without location

  10. search • Built-in Bing search web->searchweb->search images • Built-in Twitter/Facebook search social->search

  11. web requests • “if you need something, there is probably a Web API that does it” • Full support for HTTP requests // setup requestvar request := web->create request(url)// send request, receive responsevar response := request->send// read response response->content->post to wall

More Related