SlideShare a Scribd company logo

IPhone Web Development With Grails from CodeMash 2009

C
Christopher JuddCTO, consultant, author at Manifest Solutions
Web Development with


     Christopher M. Judd
Christopher M. Judd
President/Consultant of

                                    leader
Creator of open source projects FallME and Fiddle
December 2008 issue
Columbus iPhone
  User Group

http://groups.google.com/group/cidug
    Going the conversation
iPhone
2008 Third Quarter Smart Phone Sales
iPhone Uniqueness
Screen
  320




           480




                    Landscape


Portrait
Input




Multi-touch
                      Virtual Keyboard
Always Connected


                 EDGE
                  3G




Unlimited data
Location Aware
Accelerometer
Camera
Browser

   HTML 4.01
  XHTML 1.0
   JavaScript 3
 CSS 2.1 (partial 3.0)
  DOM Level 2
AJAX (XMLHTTPrequest)



                   Mobile Safari (WebKit)
Browser

   HTML 4.01
  XHTML 1.0
   JavaScript 3
 CSS 2.1 (partial 3.0)
  DOM Level 2                               XHTML Mobile Profile (MP)
AJAX (XMLHTTPrequest)                             WAP 2.0
                                                 WAP/WML




                   Mobile Safari (WebKit)
Browser

   HTML 4.01
  XHTML 1.0
   JavaScript 3
 CSS 2.1 (partial 3.0)
  DOM Level 2                               XHTML Mobile Profile (MP)
AJAX (XMLHTTPrequest)                             WAP 2.0
                                                 WAP/WML




                   Mobile Safari (WebKit)
iPhone Development

        vs
Disadvantages:
Advantages:
                             Must know Objective-C
 Access native features
                             Need Mac and OSX Leopard
  camera
  location awareness         Give up first born child in
  3D support                 mountain of legal agreements
  accelerometer (fine grain)
                             Must have application
  off-line access
                             approved and vetted before
 Performance
                             distribution in App Store
                             Process is on Apple’s timeline
                             not yours
Advantages:                  Disadvantages:
 Develop with Server-side     Don’t have access to
    technology of choice      native features
  Java                        Not as glamorous
  Groovy/Grails
                              Network performance
  Ruby
  .NET
  PHP
  Perl
 Don’t have to deal with
 syncing data with cloud
 Deployment and schedule
 is under your control
 Easier to deal with versioning
Support Levels

Incompatible                Optimized
               Compatible
Incompatible Websites
No plug-in support
                                                       Avoid
                    No mobile
                                                     HTML Frames
                technology support                Absolute positioning
                                                Mouse and keyboard events

                     XHTML Mobile Profile (MP)
                           WAP 2.0
                          WAP/WML




      There is not much Mobile Safari
              doesn’t support
Compatible Websites




Looks good and proportioned Home screen icon (Web Clip Icon)
Optimized Websites
Grails
• Web Application Framework
• Development Environment
• Open Source under Apache 2.0 License
• Current version 1.0.4 (1.1 is around the corner)
• Best Practices
      Convention over configuration
  –
      Don’t repeat yourself (DRY)
  –
      Default is what you expect (DIWYE)
  –
      Agile
  –
      Scaffolding
  –
      AJAX
  –
      Plug-ins
  –
      Unit testing
  –
      Web Services
  –
Grails MVC

    Controller




                 Domain
                          DB
      GSP
Grails Development Environment
      JDK
  •                               JDK 1.4


      Web Container/App Server
  •
      Build System
  •
      Application Stack
  •
      Persistence Framework
  •                              GORM

      Web Framework
  •
      Unit Test Framework
  •
      AJAX Framework
  •
      Database
  •
      Scheduling Framework
  •
      XML Framework
  •
      Logging Framework
  •
      View
  •
      IDE
  •
Installing Grails

1. Download from http://www.grails.org/Download
  • 1.0.4 - Stable Release
  • 1.1-BETA2 - Development Release
2. Unzip archive
3. Set GRAILS_HOME environment variable
4. Add %GRAILS_HOME%bin to system path




                 Depends on JDK 1.4 or greater
Creating a Grails App


grails create-app mynotes
Running a Grails App
                 Navigate to http://localhost:8080/mynotes



grails run-app
Add Domain Classes
                                        Note.groovy

                                    class Note {
grails create-domain-class note
                                    }

                                    NoteTests.groovy
                          class NoteTests extends GroovyTestCase
                          {

                              void testSomething() {

                              }
                          }
Implement Domains
    Add properties, methods, constraints, relationships

class Note {
  String title
  String content
  Date dateCreated
  Date lastUpdated

    static constraints = {
      title(blank:false, nullable:false, size:5..150)
      content(nullable:false, maxSize:1000)
    }

    String toString() { title }

}
Generate Scaffolding


grails generate-all note
Generate Scaffolding


grails generate-all note


  • Controller
  • Views
    • create
    • edit
    • list
    • show
Grails Request Flow
http://localhost:8080/mynotes/note/list
          class NoteController {

                     def index = { redirect(action:list,params:params) }

                     def list = {
                           if(!params.max) params.max = 10
                           [ noteList: Note.list( params ) ]
                     }

                      // ... code removed for brevity
          }

                                                  grails-app/views/layout/main.gsp
grails-app/views/note/list.gsp
                                                        <html>
      <html>                                                <head>
        <head>                                                  <title><g:layoutTitle default=quot;Grailsquot; /></title>
          <meta name=quot;layoutquot; content=quot;mainquot; />                 <link rel=quot;stylesheetquot; href=quot;${createLinkTo(dir:'css',f
          <title>Note List</title>                              <link rel=quot;shortcut iconquot; href=quot;${createLinkTo(dir:'ima
        </head>                                                 <g:layoutHead />
        <body>                                                  <g:javascript library=quot;applicationquot; />
          <div class=quot;bodyquot;>                                </head>
             <h1>Note List</h1>                             <body>
             <div class=quot;listquot;>                                 <div id=quot;spinnerquot; class=quot;spinnerquot; style=quot;display:none;quot;
               <!-- code remove for brevity -->                     <img src=quot;${createLinkTo(dir:'images',file:'spinner
             </div>                                             </div>
          </div>                                                <div class=quot;logoquot;><img src=quot;${createLinkTo(dir:'images'
        </body>                                                 <g:layoutBody />
      </html>                                               </body>
                                                        </html>
Minimal iPhone Support
Home Screen Icon
      (Web Clip Icon)
Home Screen Icon
      (Web Clip Icon)
Home Screen Icon
        (Web Clip Icon)



    <link rel=quot;apple-touch-iconquot;
        href=quot;images/apple-touch-icon.pngquot;/>
Home Screen Icon
        (Web Clip Icon)



    <link rel=quot;apple-touch-iconquot;
        href=quot;images/apple-touch-icon.pngquot;/>




              iPhone Adds
              • Rounded corners
              • Drop shadow
              • Reflective shine
Home Screen Icon
        (Web Clip Icon)



    <link rel=quot;apple-touch-iconquot;
        href=quot;images/apple-touch-icon.pngquot;/>




              iPhone Adds
              • Rounded corners
              • Drop shadow
              • Reflective shine
Home Screen Icon
        (Web Clip Icon)



    <link rel=quot;apple-touch-iconquot;
        href=quot;images/apple-touch-icon.pngquot;/>


            png image 57x57
              iPhone Adds
              • Rounded corners
              • Drop shadow
              • Reflective shine
Scaling




        Default width is 980                              Custom Viewport
   and scaled down by 2:1 or 3:1
<meta name=quot;viewportquot;
    content=quot;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;quot;>
Custom iPhone
 Applications
   with iUI
iUI
 Provide a native iPhone application look and feel
  Open Source library containing
   Cascading Style Sheets (CSS)
   JavaScript
   Images


http://code.google.com/p/iui/




                       Transitions    Lists   Forms
iUI is AJAX
ommonly implemented as a single page
Named anchors URLs transition to named elements
Standard URLs make AJAX requests to server for snippet
Full page requests must use target of _self
Get more URLs must use target of _replace
Setting up iUI
     1.Download tar
     2.Uncompress
     3.Copy images, iui.css, iui.js and iuix.js to web project
     4.Import iui.css and iui.js
<html>
  <head>
    <title>Note List</title>
    <style type=quot;text/cssquot; media=quot;screenquot;>@import quot;/mynotes/js/iui/iui.cssquot;;</style>
    <meta name=quot;viewportquot;
       content=quot;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;quot;>
    <link rel=quot;apple-touch-iconquot; href=quot;/mynotes/images/apple-touch-icon.pngquot;/>
    <script type=quot;text/javascriptquot; src=quot;/mynotes/js/iui/iui.jsquot;></script>
    <script type=quot;text/javascriptquot; src=quot;/mynotes/js/application.jsquot;></script>
  </head>
  <body>
     <!-- code removed for brevity -->
  </body>
</html>
Toolbar
<html>
  <head>
   <!-- code removed for brevity -->
  </head>
  <body>
    <div class=quot;toolbarquot;>
       <h1 id=quot;pageTitlequot;></h1>
       <a id=quot;backButtonquot; class=quot;buttonquot; href=quot;#quot;></a>
       <a href=quot;/mynotes/note/createquot; class=quot;buttonquot;>+</a>
    </div>
    </body>
</html>




        Manages state and history
List
 <html>
   <head>
      <!-- code removed for brevity -->
   </head>
   <body>
     <div class=quot;toolbarquot;>
        <h1 id=quot;pageTitlequot;></h1>
        <a id=quot;backButtonquot; class=quot;buttonquot; href=quot;#quot;></a>
        <a href=quot;/mynotes/note/createquot; class=quot;buttonquot;>+</a>
     </div>

     <ul id=quot;notesquot; title=quot;Notesquot; selected=quot;truequot;>
       <li><a href=quot;/mynotes/note/show/46quot;>Grocery list</a></li>
       <li><a href=quot;/mynotes/note/show/47quot;>Chrismas wish list</a></li
       <li>
         <a href=quot;/mynotes/note/more?offset=8quot; target=quot;_replacequot;>
           Show 8 More Notes...
         </a>
       </li>
     </ul>
     </body>
 </html>



Just an HTML unordered list
Forms
<html>
  <body>

  <div style=quot;left: 0%;quot; id=quot;Notesquot; title=quot;Notesquot; class=quot;panelquot;>
    <h2>Show Note</h2>
    <fieldset>
      <div class=quot;rowquot;>
        <label>Title</label>
        <input type=quot;textquot; name=quot;titlequot; value=quot;Grocery listquot;/>
      </div>
      <div class=quot;rowquot;>
        <label>Content</label>
        <textarea rows=quot;5quot; cols=quot;30quot; name=quot;contentquot;>
          Eggs
          Milk
          Coffee
        </textarea>
      </div>
    </fieldset>

    <form id=quot;deleteFormquot; name=quot;deleteFormquot;
              action=quot;deletequot; method=quot;postquot;>
      <input type=quot;hiddenquot; name=quot;idquot; value=quot;46quot; />
      <a class=quot;whiteButtonquot; href=quot;#quot;
        target=quot;_selfquot;
        onclick=quot;document.deleteForm.submit()quot;>Delete</a>
    </form>

  </div>
  </body>
</html>
Grails and iUI
Grails iUI Plug-in
      A plug-in for simplifying using iUI with Grails.
                   http://grails.org/iUI+Plugin


                              iPhone layout
                              iUI CSS, JavaScript and images
grails install-plugin iui     Grails apple-touch-icon
                              Automatically uses optimized
                              JavaScript in production mode
Determine iPhone
User-Agents
 iPhone - Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML,
    like Gecko) Version/3.0 Mobile/4A93 Safari/419.3


    iPod Touch - Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1
    (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3


            Use Regular Express - Mobile.*Safari
class IPhoneFilters {
  def filters = {
    all(controller:'*', action:'*') {
      before = {
        if (request.getHeader(quot;User-Agentquot;) =~ quot;Mobile.*Safariquot;)
          request['fromIPhone'] = true
      }

        }
    }
}
Render iPhone View

def list = {
    if(!params.max) params.max = 8

    if (request.fromIPhone)
      render(view:'iphone_list', model:[noteList: Note.list( params )])
    else
      render(view:'list', model: [ noteList: Note.list( params ) ])
}
Snippets
                                Use templates

 <ul id=quot;notesquot; title=quot;Notesquot; selected=quot;truequot;>
   <g:render template=quot;iphone_notesquot; />
 </ul>




_iphone_notes.gsp
<g:each in=quot;${noteList}quot; status=quot;iquot; var=quot;notequot;>
  <li><g:link action=quot;showquot; id=quot;${note?.id}quot;>
       ${fieldValue(bean:note, field:'title')}
  </g:link></li>
</g:each>
<li>
  <g:link action=quot;morequot; target=quot;_replacequot; params=quot;[offset: 8]quot;>
       Show 8 More Notes...
  </g:link>
</li>
Testing
iPhone/iPod Touch

                      Challenges
                      • Corporate Network Access
                      • Hands of keyboard
                      • Difficult to debug




Should definitely use for final testing
SDK iPhone Simulator

              Challenges
              • Only works on Leopard OSX
              • Difficult to debug




  Included with SDK/XCode
Safari

      Challenges
      • Renders things the iPhone won’t




Mac or Windows
iPhone Spoofing
Debugging
iPhone Bookmarklets
http://www.manifestinteractive.com/iphone/#_Webdev


            Unique JavaScript solution
             View source
             Dump scripts
             View cookies
             etc
Resources


Web Development Guidelines for the iPhone (Safari Web Content Guide for iPhone OS)
   - https://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariWebContent/
Safari HTML Reference
   - http://developer.apple.com/documentation/AppleApplications/Reference/SafariHTMLRef/
Safari CSS Reference
   - http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/
WebKit DOM Programming Topic
   - http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSProgTopics/
1 of 63

IPhone Web Development With Grails from CodeMash 2009

Download to read offline

These are slides from my CodeMash 2009 presentation on developing iPhone web applications using Grails, Groovy and iUI.

C
Christopher JuddCTO, consultant, author at Manifest Solutions

Recommended

What's new in flutter and dart in 2020 by
 What's new in flutter and dart in 2020   What's new in flutter and dart in 2020
What's new in flutter and dart in 2020 Ahmed Abu Eldahab
686 views47 slides
The Magic of flutter Comex oman 2019 by
The Magic of flutter Comex oman 2019The Magic of flutter Comex oman 2019
The Magic of flutter Comex oman 2019Ahmed Abu Eldahab
372 views57 slides
T2 Web Framework by
T2 Web FrameworkT2 Web Framework
T2 Web FrameworkShinpei Ohtani
1.2K views36 slides
Google flutter and why does it matter by
Google flutter and why does it matterGoogle flutter and why does it matter
Google flutter and why does it matterAhmed Abu Eldahab
5.6K views63 slides
Developing Cross platform apps in flutter (Android, iOS, Web) by
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Priyanka Tyagi
1.3K views73 slides
The magic of flutter by
The magic of flutterThe magic of flutter
The magic of flutterShady Selim
1.6K views30 slides
Introduction to Flutter - truly crossplatform, amazingly fast by
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastBartosz Kosarzycki
50.8K views37 slides
The magic of Flutter - Amman ioextended 6-7-2019 by
The magic of Flutter - Amman ioextended 6-7-2019The magic of Flutter - Amman ioextended 6-7-2019
The magic of Flutter - Amman ioextended 6-7-2019Ahmed Abu Eldahab
496 views58 slides

More Related Content

What's hot

Build responsive applications with google flutter by
Build responsive applications with  google flutterBuild responsive applications with  google flutter
Build responsive applications with google flutterAhmed Abu Eldahab
1.1K views54 slides
Build beautiful native apps in record time with flutter by
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutterRobertLe30
305 views42 slides
Flutter beyond hello world by
Flutter beyond hello worldFlutter beyond hello world
Flutter beyond hello worldAhmed Abu Eldahab
512 views80 slides
Flutter - DevFestDC by
Flutter - DevFestDCFlutter - DevFestDC
Flutter - DevFestDCMichael R. Traverso
331 views45 slides
Google flutter the easy and practical way by
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical wayAhmed Abu Eldahab
483 views80 slides
Flutter beyond hello world GCDC Egypt Devfest 2019 by
Flutter beyond hello world GCDC Egypt  Devfest 2019Flutter beyond hello world GCDC Egypt  Devfest 2019
Flutter beyond hello world GCDC Egypt Devfest 2019Ahmed Abu Eldahab
288 views93 slides
What is flutter and why should i care? by
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?Sergi Martínez
6.1K views28 slides
Build web applications using google flutter by
Build web applications using google flutterBuild web applications using google flutter
Build web applications using google flutterAhmed Abu Eldahab
2.1K views41 slides
Google flutter the easy and practical way by
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical wayAhmed Abu Eldahab
640 views52 slides
Flutter latest updates and features 2022 by
Flutter latest updates and features 2022Flutter latest updates and features 2022
Flutter latest updates and features 2022Ahmed Abu Eldahab
266 views39 slides
Developing cross platform apps in Flutter (Android, iOS, and Web) by
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Priyanka Tyagi
287 views72 slides
Mobile Devolpment Slides by
Mobile Devolpment SlidesMobile Devolpment Slides
Mobile Devolpment SlidesLuke Angel
688 views39 slides
Flutter Tutorial For Beginners | Edureka by
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | EdurekaEdureka!
4.5K views23 slides
Getting started with flutter by
Getting started with flutterGetting started with flutter
Getting started with flutterrihannakedy
1.4K views49 slides
Rapid Prototyping with Cordova aka Phonegap by
Rapid Prototyping with Cordova aka PhonegapRapid Prototyping with Cordova aka Phonegap
Rapid Prototyping with Cordova aka PhonegapJosue Bustos
5.9K views40 slides
Silverlight 2 with Visual Studio 2008 and Expression Blend by
Silverlight 2 with Visual Studio 2008 and Expression BlendSilverlight 2 with Visual Studio 2008 and Expression Blend
Silverlight 2 with Visual Studio 2008 and Expression BlendCaleb Jenkins
856 views85 slides
Flutter state management from zero to hero by
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to heroAhmed Abu Eldahab
1.4K views100 slides
Flutter for web by
Flutter for web Flutter for web
Flutter for web rihannakedy
398 views33 slides
Flutter101 by
Flutter101Flutter101
Flutter101인수 장
1.5K views45 slides
Building beautiful apps using google flutter by
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutterAhmed Abu Eldahab
505 views63 slides

What's hot (20)

Build responsive applications with google flutter by Ahmed Abu Eldahab
Build responsive applications with  google flutterBuild responsive applications with  google flutter
Build responsive applications with google flutter
Ahmed Abu Eldahab1.1K views
Build beautiful native apps in record time with flutter by RobertLe30
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutter
RobertLe30305 views
Google flutter the easy and practical way by Ahmed Abu Eldahab
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
Ahmed Abu Eldahab483 views
Flutter beyond hello world GCDC Egypt Devfest 2019 by Ahmed Abu Eldahab
Flutter beyond hello world GCDC Egypt  Devfest 2019Flutter beyond hello world GCDC Egypt  Devfest 2019
Flutter beyond hello world GCDC Egypt Devfest 2019
Ahmed Abu Eldahab288 views
What is flutter and why should i care? by Sergi Martínez
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
Sergi Martínez6.1K views
Build web applications using google flutter by Ahmed Abu Eldahab
Build web applications using google flutterBuild web applications using google flutter
Build web applications using google flutter
Ahmed Abu Eldahab2.1K views
Google flutter the easy and practical way by Ahmed Abu Eldahab
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
Ahmed Abu Eldahab640 views
Flutter latest updates and features 2022 by Ahmed Abu Eldahab
Flutter latest updates and features 2022Flutter latest updates and features 2022
Flutter latest updates and features 2022
Ahmed Abu Eldahab266 views
Developing cross platform apps in Flutter (Android, iOS, and Web) by Priyanka Tyagi
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)
Priyanka Tyagi287 views
Mobile Devolpment Slides by Luke Angel
Mobile Devolpment SlidesMobile Devolpment Slides
Mobile Devolpment Slides
Luke Angel688 views
Flutter Tutorial For Beginners | Edureka by Edureka!
Flutter Tutorial For Beginners | EdurekaFlutter Tutorial For Beginners | Edureka
Flutter Tutorial For Beginners | Edureka
Edureka!4.5K views
Getting started with flutter by rihannakedy
Getting started with flutterGetting started with flutter
Getting started with flutter
rihannakedy1.4K views
Rapid Prototyping with Cordova aka Phonegap by Josue Bustos
Rapid Prototyping with Cordova aka PhonegapRapid Prototyping with Cordova aka Phonegap
Rapid Prototyping with Cordova aka Phonegap
Josue Bustos5.9K views
Silverlight 2 with Visual Studio 2008 and Expression Blend by Caleb Jenkins
Silverlight 2 with Visual Studio 2008 and Expression BlendSilverlight 2 with Visual Studio 2008 and Expression Blend
Silverlight 2 with Visual Studio 2008 and Expression Blend
Caleb Jenkins856 views
Flutter state management from zero to hero by Ahmed Abu Eldahab
Flutter state management from zero to heroFlutter state management from zero to hero
Flutter state management from zero to hero
Ahmed Abu Eldahab1.4K views
Flutter for web by rihannakedy
Flutter for web Flutter for web
Flutter for web
rihannakedy398 views
Flutter101 by 인수 장
Flutter101Flutter101
Flutter101
인수 장1.5K views
Building beautiful apps using google flutter by Ahmed Abu Eldahab
Building beautiful apps using google flutterBuilding beautiful apps using google flutter
Building beautiful apps using google flutter
Ahmed Abu Eldahab505 views

Similar to IPhone Web Development With Grails from CodeMash 2009

IE 8 et les standards du Web - Chris Wilson - Paris Web 2008 by
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008Association Paris-Web
4.4K views34 slides
HTML5 on Mobile by
HTML5 on MobileHTML5 on Mobile
HTML5 on MobileAdam Lu
8.4K views67 slides
Real-World AJAX with ASP.NET by
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NETgoodfriday
2.2K views23 slides
Silver Light By Nyros Developer by
Silver Light By Nyros DeveloperSilver Light By Nyros Developer
Silver Light By Nyros DeveloperNyros Technologies
893 views18 slides
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13 by
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
1.5K views100 slides
Widget Summit 2008 by
Widget Summit 2008Widget Summit 2008
Widget Summit 2008Volkan Unsal
778 views52 slides
Grails Introduction - IJTC 2007 by
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Guillaume Laforge
1K views45 slides
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers by
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersTodd Anglin
5.3K views89 slides
Client-side JavaScript Vulnerabilities by
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesOry Segal
28.1K views24 slides
GTLAB Installation Tutorial for SciDAC 2009 by
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009marpierc
635 views46 slides
Internet Explorer 8 for Developers by Christian Thilmany by
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
4.4K views30 slides
HTML5 for Rich User Experience by
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User ExperienceMahbubur Rahman
2.9K views38 slides
Html 5 in a big nutshell by
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshellLennart Schoors
30.5K views45 slides
Web app and more by
Web app and moreWeb app and more
Web app and morefaming su
406 views79 slides
Web Apps and more by
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
1K views79 slides
Struts,Jsp,Servlet by
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servletdasguptahirak
7.6K views238 slides
Strutsjspservlet by
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
757 views238 slides
Strutsjspservlet by
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
755 views238 slides
Even Faster Web Sites at jQuery Conference '09 by
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Steve Souders
1.2K views66 slides
Moving from Web 1.0 to Web 2.0 by
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Estelle Weyl
1.7K views42 slides

Similar to IPhone Web Development With Grails from CodeMash 2009 (20)

IE 8 et les standards du Web - Chris Wilson - Paris Web 2008 by Association Paris-Web
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
HTML5 on Mobile by Adam Lu
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
Adam Lu8.4K views
Real-World AJAX with ASP.NET by goodfriday
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
goodfriday2.2K views
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13 by Fred Sauer
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer1.5K views
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers by Todd Anglin
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Todd Anglin5.3K views
Client-side JavaScript Vulnerabilities by Ory Segal
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript Vulnerabilities
Ory Segal28.1K views
GTLAB Installation Tutorial for SciDAC 2009 by marpierc
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
marpierc635 views
Internet Explorer 8 for Developers by Christian Thilmany by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
Christian Thilmany4.4K views
HTML5 for Rich User Experience by Mahbubur Rahman
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User Experience
Mahbubur Rahman2.9K views
Web app and more by faming su
Web app and moreWeb app and more
Web app and more
faming su406 views
Web Apps and more by Yan Shi
Web Apps and moreWeb Apps and more
Web Apps and more
Yan Shi1K views
Strutsjspservlet by Sagar Nakul
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul757 views
Strutsjspservlet by Sagar Nakul
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul755 views
Even Faster Web Sites at jQuery Conference '09 by Steve Souders
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
Steve Souders1.2K views
Moving from Web 1.0 to Web 2.0 by Estelle Weyl
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
Estelle Weyl1.7K views

Recently uploaded

21st Century Literature_Q2_Module 1.3 FINAL.pdf by
21st Century Literature_Q2_Module 1.3 FINAL.pdf21st Century Literature_Q2_Module 1.3 FINAL.pdf
21st Century Literature_Q2_Module 1.3 FINAL.pdfLeah Condina
156 views32 slides
OOPs - JAVA Quick Reference.pdf by
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdfArthyR3
212 views66 slides
Introduction to CVS ZMCh.pptx by
Introduction to CVS ZMCh.pptxIntroduction to CVS ZMCh.pptx
Introduction to CVS ZMCh.pptxPandian M
58 views31 slides
The Picture Of A Photograph by
The Picture Of A PhotographThe Picture Of A Photograph
The Picture Of A PhotographEvelyn Donaldson
45 views81 slides
A Book / Story Summary by
A Book / Story SummaryA Book / Story Summary
A Book / Story SummaryEugene Lysak
48 views10 slides
Curriculum-An Introduction.pptx by
Curriculum-An Introduction.pptxCurriculum-An Introduction.pptx
Curriculum-An Introduction.pptxAnandakumar Natarajan
72 views9 slides
From social media to generative media (3).pptx by
From social media to generative media (3).pptxFrom social media to generative media (3).pptx
From social media to generative media (3).pptxMark Carrigan
191 views28 slides
EAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdf by
EAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdfEAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdf
EAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdfLeah Condina
36 views35 slides
Brazil EdTech Market by Reach Capital by
Brazil EdTech Market by Reach CapitalBrazil EdTech Market by Reach Capital
Brazil EdTech Market by Reach CapitalTony Wan
222 views42 slides
Down Payments In Odoo 16 Sales by
Down Payments In Odoo 16 SalesDown Payments In Odoo 16 Sales
Down Payments In Odoo 16 SalesCeline George
58 views14 slides
A House Remembered - Final Sequence Assignment by
A House Remembered - Final Sequence AssignmentA House Remembered - Final Sequence Assignment
A House Remembered - Final Sequence Assignmentemilymartin25015
59 views8 slides
Mental Health in Fact-checking and Journalism: Dealing with Stress and Trauma by
Mental Health in Fact-checking and Journalism: Dealing with Stress and TraumaMental Health in Fact-checking and Journalism: Dealing with Stress and Trauma
Mental Health in Fact-checking and Journalism: Dealing with Stress and Trauma211 Check
71 views44 slides
Multiplexer and Demultiplexer.pdf by
Multiplexer and Demultiplexer.pdfMultiplexer and Demultiplexer.pdf
Multiplexer and Demultiplexer.pdfsudarmani5694
52 views11 slides
Madrian_Summit Conference - AI and Business Education - 2023-11-30.pptx by
Madrian_Summit Conference - AI and Business Education - 2023-11-30.pptxMadrian_Summit Conference - AI and Business Education - 2023-11-30.pptx
Madrian_Summit Conference - AI and Business Education - 2023-11-30.pptxKevin Jessop
111 views24 slides
HM-02 Heme catabolism & Genetic defects.pptx by
HM-02 Heme catabolism & Genetic defects.pptxHM-02 Heme catabolism & Genetic defects.pptx
HM-02 Heme catabolism & Genetic defects.pptxDr. Santhosh Kumar. N
34 views29 slides
Peripheral artery diseases by Dr. Garvit.pptx by
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptxgarvitnanecha
161 views48 slides
Interaction of microorganisms with Insects.pptx by
Interaction of microorganisms with Insects.pptxInteraction of microorganisms with Insects.pptx
Interaction of microorganisms with Insects.pptxMicrobiologyMicro
81 views14 slides
Portland Drama Club 2023 Annual Report.pdf by
Portland Drama Club 2023 Annual Report.pdfPortland Drama Club 2023 Annual Report.pdf
Portland Drama Club 2023 Annual Report.pdfrobin258682
35 views7 slides
Share WOMEN ENTREPRENEURS IN INDIA-1.pptx by
Share WOMEN ENTREPRENEURS IN INDIA-1.pptxShare WOMEN ENTREPRENEURS IN INDIA-1.pptx
Share WOMEN ENTREPRENEURS IN INDIA-1.pptxSGowriShankar5
144 views33 slides
Chapter 3- Topography of Ethiopia and the Horn (GeES 1011).pdf by
Chapter 3- Topography of Ethiopia and the Horn  (GeES 1011).pdfChapter 3- Topography of Ethiopia and the Horn  (GeES 1011).pdf
Chapter 3- Topography of Ethiopia and the Horn (GeES 1011).pdfBehailu Getu, Wolkite University, Ethiopia
33 views38 slides

Recently uploaded (20)

21st Century Literature_Q2_Module 1.3 FINAL.pdf by Leah Condina
21st Century Literature_Q2_Module 1.3 FINAL.pdf21st Century Literature_Q2_Module 1.3 FINAL.pdf
21st Century Literature_Q2_Module 1.3 FINAL.pdf
Leah Condina156 views
OOPs - JAVA Quick Reference.pdf by ArthyR3
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdf
ArthyR3212 views
Introduction to CVS ZMCh.pptx by Pandian M
Introduction to CVS ZMCh.pptxIntroduction to CVS ZMCh.pptx
Introduction to CVS ZMCh.pptx
Pandian M58 views
From social media to generative media (3).pptx by Mark Carrigan
From social media to generative media (3).pptxFrom social media to generative media (3).pptx
From social media to generative media (3).pptx
Mark Carrigan191 views
EAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdf by Leah Condina
EAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdfEAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdf
EAPP Q2 - M3_ Writing Various Kinds of Position Paper.pdf
Leah Condina36 views
Brazil EdTech Market by Reach Capital by Tony Wan
Brazil EdTech Market by Reach CapitalBrazil EdTech Market by Reach Capital
Brazil EdTech Market by Reach Capital
Tony Wan222 views
Down Payments In Odoo 16 Sales by Celine George
Down Payments In Odoo 16 SalesDown Payments In Odoo 16 Sales
Down Payments In Odoo 16 Sales
Celine George58 views
A House Remembered - Final Sequence Assignment by emilymartin25015
A House Remembered - Final Sequence AssignmentA House Remembered - Final Sequence Assignment
A House Remembered - Final Sequence Assignment
emilymartin2501559 views
Mental Health in Fact-checking and Journalism: Dealing with Stress and Trauma by 211 Check
Mental Health in Fact-checking and Journalism: Dealing with Stress and TraumaMental Health in Fact-checking and Journalism: Dealing with Stress and Trauma
Mental Health in Fact-checking and Journalism: Dealing with Stress and Trauma
211 Check71 views
Multiplexer and Demultiplexer.pdf by sudarmani5694
Multiplexer and Demultiplexer.pdfMultiplexer and Demultiplexer.pdf
Multiplexer and Demultiplexer.pdf
sudarmani569452 views
Madrian_Summit Conference - AI and Business Education - 2023-11-30.pptx by Kevin Jessop
Madrian_Summit Conference - AI and Business Education - 2023-11-30.pptxMadrian_Summit Conference - AI and Business Education - 2023-11-30.pptx
Madrian_Summit Conference - AI and Business Education - 2023-11-30.pptx
Kevin Jessop111 views
Peripheral artery diseases by Dr. Garvit.pptx by garvitnanecha
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptx
garvitnanecha161 views
Interaction of microorganisms with Insects.pptx by MicrobiologyMicro
Interaction of microorganisms with Insects.pptxInteraction of microorganisms with Insects.pptx
Interaction of microorganisms with Insects.pptx
Portland Drama Club 2023 Annual Report.pdf by robin258682
Portland Drama Club 2023 Annual Report.pdfPortland Drama Club 2023 Annual Report.pdf
Portland Drama Club 2023 Annual Report.pdf
robin25868235 views
Share WOMEN ENTREPRENEURS IN INDIA-1.pptx by SGowriShankar5
Share WOMEN ENTREPRENEURS IN INDIA-1.pptxShare WOMEN ENTREPRENEURS IN INDIA-1.pptx
Share WOMEN ENTREPRENEURS IN INDIA-1.pptx
SGowriShankar5144 views

IPhone Web Development With Grails from CodeMash 2009

  • 1. Web Development with Christopher M. Judd
  • 2. Christopher M. Judd President/Consultant of leader Creator of open source projects FallME and Fiddle
  • 4. Columbus iPhone User Group http://groups.google.com/group/cidug Going the conversation
  • 6. 2008 Third Quarter Smart Phone Sales
  • 8. Screen 320 480 Landscape Portrait
  • 9. Input Multi-touch Virtual Keyboard
  • 10. Always Connected EDGE 3G Unlimited data
  • 14. Browser HTML 4.01 XHTML 1.0 JavaScript 3 CSS 2.1 (partial 3.0) DOM Level 2 AJAX (XMLHTTPrequest) Mobile Safari (WebKit)
  • 15. Browser HTML 4.01 XHTML 1.0 JavaScript 3 CSS 2.1 (partial 3.0) DOM Level 2 XHTML Mobile Profile (MP) AJAX (XMLHTTPrequest) WAP 2.0 WAP/WML Mobile Safari (WebKit)
  • 16. Browser HTML 4.01 XHTML 1.0 JavaScript 3 CSS 2.1 (partial 3.0) DOM Level 2 XHTML Mobile Profile (MP) AJAX (XMLHTTPrequest) WAP 2.0 WAP/WML Mobile Safari (WebKit)
  • 18. Disadvantages: Advantages: Must know Objective-C Access native features Need Mac and OSX Leopard camera location awareness Give up first born child in 3D support mountain of legal agreements accelerometer (fine grain) Must have application off-line access approved and vetted before Performance distribution in App Store Process is on Apple’s timeline not yours
  • 19. Advantages: Disadvantages: Develop with Server-side Don’t have access to technology of choice native features Java Not as glamorous Groovy/Grails Network performance Ruby .NET PHP Perl Don’t have to deal with syncing data with cloud Deployment and schedule is under your control Easier to deal with versioning
  • 20. Support Levels Incompatible Optimized Compatible
  • 21. Incompatible Websites No plug-in support Avoid No mobile HTML Frames technology support Absolute positioning Mouse and keyboard events XHTML Mobile Profile (MP) WAP 2.0 WAP/WML There is not much Mobile Safari doesn’t support
  • 22. Compatible Websites Looks good and proportioned Home screen icon (Web Clip Icon)
  • 25. • Web Application Framework • Development Environment • Open Source under Apache 2.0 License • Current version 1.0.4 (1.1 is around the corner) • Best Practices Convention over configuration – Don’t repeat yourself (DRY) – Default is what you expect (DIWYE) – Agile – Scaffolding – AJAX – Plug-ins – Unit testing – Web Services –
  • 26. Grails MVC Controller Domain DB GSP
  • 27. Grails Development Environment JDK • JDK 1.4 Web Container/App Server • Build System • Application Stack • Persistence Framework • GORM Web Framework • Unit Test Framework • AJAX Framework • Database • Scheduling Framework • XML Framework • Logging Framework • View • IDE •
  • 28. Installing Grails 1. Download from http://www.grails.org/Download • 1.0.4 - Stable Release • 1.1-BETA2 - Development Release 2. Unzip archive 3. Set GRAILS_HOME environment variable 4. Add %GRAILS_HOME%bin to system path Depends on JDK 1.4 or greater
  • 29. Creating a Grails App grails create-app mynotes
  • 30. Running a Grails App Navigate to http://localhost:8080/mynotes grails run-app
  • 31. Add Domain Classes Note.groovy class Note { grails create-domain-class note } NoteTests.groovy class NoteTests extends GroovyTestCase { void testSomething() { } }
  • 32. Implement Domains Add properties, methods, constraints, relationships class Note { String title String content Date dateCreated Date lastUpdated static constraints = { title(blank:false, nullable:false, size:5..150) content(nullable:false, maxSize:1000) } String toString() { title } }
  • 34. Generate Scaffolding grails generate-all note • Controller • Views • create • edit • list • show
  • 35. Grails Request Flow http://localhost:8080/mynotes/note/list class NoteController { def index = { redirect(action:list,params:params) } def list = { if(!params.max) params.max = 10 [ noteList: Note.list( params ) ] } // ... code removed for brevity } grails-app/views/layout/main.gsp grails-app/views/note/list.gsp <html> <html> <head> <head> <title><g:layoutTitle default=quot;Grailsquot; /></title> <meta name=quot;layoutquot; content=quot;mainquot; /> <link rel=quot;stylesheetquot; href=quot;${createLinkTo(dir:'css',f <title>Note List</title> <link rel=quot;shortcut iconquot; href=quot;${createLinkTo(dir:'ima </head> <g:layoutHead /> <body> <g:javascript library=quot;applicationquot; /> <div class=quot;bodyquot;> </head> <h1>Note List</h1> <body> <div class=quot;listquot;> <div id=quot;spinnerquot; class=quot;spinnerquot; style=quot;display:none;quot; <!-- code remove for brevity --> <img src=quot;${createLinkTo(dir:'images',file:'spinner </div> </div> </div> <div class=quot;logoquot;><img src=quot;${createLinkTo(dir:'images' </body> <g:layoutBody /> </html> </body> </html>
  • 37. Home Screen Icon (Web Clip Icon)
  • 38. Home Screen Icon (Web Clip Icon)
  • 39. Home Screen Icon (Web Clip Icon) <link rel=quot;apple-touch-iconquot; href=quot;images/apple-touch-icon.pngquot;/>
  • 40. Home Screen Icon (Web Clip Icon) <link rel=quot;apple-touch-iconquot; href=quot;images/apple-touch-icon.pngquot;/> iPhone Adds • Rounded corners • Drop shadow • Reflective shine
  • 41. Home Screen Icon (Web Clip Icon) <link rel=quot;apple-touch-iconquot; href=quot;images/apple-touch-icon.pngquot;/> iPhone Adds • Rounded corners • Drop shadow • Reflective shine
  • 42. Home Screen Icon (Web Clip Icon) <link rel=quot;apple-touch-iconquot; href=quot;images/apple-touch-icon.pngquot;/> png image 57x57 iPhone Adds • Rounded corners • Drop shadow • Reflective shine
  • 43. Scaling Default width is 980 Custom Viewport and scaled down by 2:1 or 3:1 <meta name=quot;viewportquot; content=quot;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;quot;>
  • 45. iUI Provide a native iPhone application look and feel Open Source library containing Cascading Style Sheets (CSS) JavaScript Images http://code.google.com/p/iui/ Transitions Lists Forms
  • 46. iUI is AJAX ommonly implemented as a single page Named anchors URLs transition to named elements Standard URLs make AJAX requests to server for snippet Full page requests must use target of _self Get more URLs must use target of _replace
  • 47. Setting up iUI 1.Download tar 2.Uncompress 3.Copy images, iui.css, iui.js and iuix.js to web project 4.Import iui.css and iui.js <html> <head> <title>Note List</title> <style type=quot;text/cssquot; media=quot;screenquot;>@import quot;/mynotes/js/iui/iui.cssquot;;</style> <meta name=quot;viewportquot; content=quot;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;quot;> <link rel=quot;apple-touch-iconquot; href=quot;/mynotes/images/apple-touch-icon.pngquot;/> <script type=quot;text/javascriptquot; src=quot;/mynotes/js/iui/iui.jsquot;></script> <script type=quot;text/javascriptquot; src=quot;/mynotes/js/application.jsquot;></script> </head> <body> <!-- code removed for brevity --> </body> </html>
  • 48. Toolbar <html> <head> <!-- code removed for brevity --> </head> <body> <div class=quot;toolbarquot;> <h1 id=quot;pageTitlequot;></h1> <a id=quot;backButtonquot; class=quot;buttonquot; href=quot;#quot;></a> <a href=quot;/mynotes/note/createquot; class=quot;buttonquot;>+</a> </div> </body> </html> Manages state and history
  • 49. List <html> <head> <!-- code removed for brevity --> </head> <body> <div class=quot;toolbarquot;> <h1 id=quot;pageTitlequot;></h1> <a id=quot;backButtonquot; class=quot;buttonquot; href=quot;#quot;></a> <a href=quot;/mynotes/note/createquot; class=quot;buttonquot;>+</a> </div> <ul id=quot;notesquot; title=quot;Notesquot; selected=quot;truequot;> <li><a href=quot;/mynotes/note/show/46quot;>Grocery list</a></li> <li><a href=quot;/mynotes/note/show/47quot;>Chrismas wish list</a></li <li> <a href=quot;/mynotes/note/more?offset=8quot; target=quot;_replacequot;> Show 8 More Notes... </a> </li> </ul> </body> </html> Just an HTML unordered list
  • 50. Forms <html> <body> <div style=quot;left: 0%;quot; id=quot;Notesquot; title=quot;Notesquot; class=quot;panelquot;> <h2>Show Note</h2> <fieldset> <div class=quot;rowquot;> <label>Title</label> <input type=quot;textquot; name=quot;titlequot; value=quot;Grocery listquot;/> </div> <div class=quot;rowquot;> <label>Content</label> <textarea rows=quot;5quot; cols=quot;30quot; name=quot;contentquot;> Eggs Milk Coffee </textarea> </div> </fieldset> <form id=quot;deleteFormquot; name=quot;deleteFormquot; action=quot;deletequot; method=quot;postquot;> <input type=quot;hiddenquot; name=quot;idquot; value=quot;46quot; /> <a class=quot;whiteButtonquot; href=quot;#quot; target=quot;_selfquot; onclick=quot;document.deleteForm.submit()quot;>Delete</a> </form> </div> </body> </html>
  • 52. Grails iUI Plug-in A plug-in for simplifying using iUI with Grails. http://grails.org/iUI+Plugin iPhone layout iUI CSS, JavaScript and images grails install-plugin iui Grails apple-touch-icon Automatically uses optimized JavaScript in production mode
  • 53. Determine iPhone User-Agents iPhone - Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3 iPod Touch - Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3 Use Regular Express - Mobile.*Safari class IPhoneFilters { def filters = { all(controller:'*', action:'*') { before = { if (request.getHeader(quot;User-Agentquot;) =~ quot;Mobile.*Safariquot;) request['fromIPhone'] = true } } } }
  • 54. Render iPhone View def list = { if(!params.max) params.max = 8 if (request.fromIPhone) render(view:'iphone_list', model:[noteList: Note.list( params )]) else render(view:'list', model: [ noteList: Note.list( params ) ]) }
  • 55. Snippets Use templates <ul id=quot;notesquot; title=quot;Notesquot; selected=quot;truequot;> <g:render template=quot;iphone_notesquot; /> </ul> _iphone_notes.gsp <g:each in=quot;${noteList}quot; status=quot;iquot; var=quot;notequot;> <li><g:link action=quot;showquot; id=quot;${note?.id}quot;> ${fieldValue(bean:note, field:'title')} </g:link></li> </g:each> <li> <g:link action=quot;morequot; target=quot;_replacequot; params=quot;[offset: 8]quot;> Show 8 More Notes... </g:link> </li>
  • 57. iPhone/iPod Touch Challenges • Corporate Network Access • Hands of keyboard • Difficult to debug Should definitely use for final testing
  • 58. SDK iPhone Simulator Challenges • Only works on Leopard OSX • Difficult to debug Included with SDK/XCode
  • 59. Safari Challenges • Renders things the iPhone won’t Mac or Windows
  • 62. iPhone Bookmarklets http://www.manifestinteractive.com/iphone/#_Webdev Unique JavaScript solution View source Dump scripts View cookies etc
  • 63. Resources Web Development Guidelines for the iPhone (Safari Web Content Guide for iPhone OS) - https://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariWebContent/ Safari HTML Reference - http://developer.apple.com/documentation/AppleApplications/Reference/SafariHTMLRef/ Safari CSS Reference - http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/ WebKit DOM Programming Topic - http://developer.apple.com/documentation/AppleApplications/Conceptual/SafariJSProgTopics/