SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Advanced iPhone Web Development
Josh Schumacher
Treemo Labs


                  email: Josh.Schumacher@gmail.com
                  web: http://blog.joshschumacher.com
iPhone      Symbian       Windows Mobile           Blackberry    Palm   Linux




                           Blackberry
         Windows Mobile
                              20%
              13%


                                                                  Mobile
                                           Palm
                                            1%

                                                                Smartphone
                                           Linux
                                            8%
                                                                Market Share
                                                                 Q4 2008
                                        iPhone
                                         11%
         Symbian
           48%
iPhone         Android     Java ME   Symbian     Win Mo     Blackberry   Palm



                          Palm
                Win Mo     2%
                  6%
                     Blackberry
                        3%
            Symbian
              7%

                                                           Mobile Devices
         Java ME

                                                          By Internet Usage
           8%


                                                              April 2009
          Android
            9%                          iPhone
                                         65%
Topics of Discussion
 Meta Tags
 Webkit CSS Extensions
 Webkit DOM Additions
 Design Patterns
 Offline Web Applications
 Blurring Boundaries, Web Apps as Native Apps
 Helpful Resources
Meta Tags
Useful <meta> tags

 <meta name=quot;viewportquot; content=quot;width=device-width, user-
 scalable=no initial-scale = 1.0quot; />

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

 <meta name=quot;apple-mobile-web-app-status-bar-stylequot;
 content=quot;blackquot; />

 <meta name=quot;apple-mobile-web-app-capablequot; content=quot;yesquot; />

 <body onorientationchange=quot;myOrientationChangeFunction()quot;>

 <meta name=quot;format-detectionquot; content=quot;telephone=noquot; />
<meta name=quot;apple-mobile-web-app-
           capablequot; content=quot;yesquot; />
window.navigator.standalone read-only
JavaScript Boolean if window is currently in
fullscreen mode

<meta name=quot;apple-mobile-web-
app-status-bar-stylequot;
content=quot;blackquot; />

   Has no effect unless launched from home
   screen link

   Can be set to translucent to hide the
   status bar
Webkit CSS Extensions
Some Must Have CSS Rules
text-shadow
text-fill-color
text-stroke
-webkit-tap-highlight-color
-webkit-box-shadow
-webkit-border-radius
-webkit-border-image
Getting Really Fancy
 Gradients
 Masks
 Reflections
 Transitions
 Animations
 Transforms
Gradients          (Coming Soon to iPhone)


 background:

   -webkit-gradient(
        linear,
        left top,
        left bottom,
        from(#333),
        color-stop(0.8, #bbb),
        to(#333)
   );
CSS Transitions

  .fade-away {
      opacity: 0;
      -webkit-transition: opacity 1s ease-out 20ms;
  }

  <p onclick=quot;className='fade-away';quot;>Click Me To Fade Away</p>
Transforms
  #banner {
      -webkit-transform: rotate(-45deg);
      width: 150px;
      position: absolute;
      top: 20px;
      left: 0px;
      background: red;
      padding: 4px;
      text-align: center;
      border: solid 1px #333;
      margin-left: -50px;
  }
Webkit DOM Extensions
Multi-Touch
Interactions
Touches Events
Gesture Events
Touches are important for keeping track of how many
fingers are on the screen, where they are, and what they’re
doing. Gestures are important for determining what the
user is doing when they have two fingers on the screen
and are either pinching, pushing, or rotating them.
Touches Events

touchstart
Happens every time a finger is placed on the screen
touchend
Happens every time a finger is removed from the screen
touchmove
Happens as a finger already placed on the screen is moved across the screen
touchcancel
Gesture Events

 gesturestart
 Sent when two or more fingers touch the surface
 gesturechange
 Sent when fingers are moved during a gesture
 gestureend
 Sent when the gesture ends (when there are 1 or 0 fingers touching the surface)
Sample Flow of Events

 1. touchstart for finger 1. Sent when the first finger touches the surface.

 2. gesturestart. Sent when the second finger touches the surface.

 3. touchstart for finger 2. Sent immediately after gesturestart when the second finger touches the surface.

 4. gesturechange for current gesture. Sent when both fingers move while still touching the surface.

 5. gestureend. Sent when the second finger lifts from the surface.

 6. touchend for finger 2. Sent immediately after gestureend when the second finger lifts from the surface.

 7. touchend for finger 1. Sent when the first finger lifts from the surface.
Design Patterns
Use Common Design Patterns
Common designs. Mimicking behaviors in native iPhone applications
Offline Web Applications
Offline
Applications
Offline Cache Manifests
Using the local storage DB
Offline Cache-Manifests
Must be served as text/cache-manifest.



CACHE MANIFEST
demoimages/clownfish.jpg
demoimages/clownfishsmall.jpg
demoimages/flowingrock.jpg
demoimages/flowingrocksmall.jpg
demoimages/stones.jpg
demoimages/stonessmall.jpg



<html manifest=quot;demo.manifestquot;>
Blurring Boundaries
Web Apps as Native Apps
Utilize UIWebView inside of your
        native Applications

Rapid Development
Ship updates w/o Apple Approval
Expand potential developer base
Easier porting to other devices
Using Objective-C in Javascript	
WebScriptObject.h defines methods you can implement in your Objective-C classes to expose their
interfaces to a scripting environment such as JavaScript
@interface BasicAddressBook: NSObject {
}
+ (BasicAddressBook *)addressBook;
- (NSString *)nameAtIndex:(int)index;
@end

BasicAddressBook *littleBlackBook = [BasicAddressBook addressBook];
id win = [webView windowScriptObject];
[win setValue:littleBlackBook forKey:@quot;AddressBookquot;];

function printNameAtIndex(index) {
    var myaddressbook = window.AddressBook;
    var name = myaddressbook.nameAtIndex_(index);
    document.write(name);
}


See Webkit DOM Programming Topics and WebKit Objective-C Framework Reference for more information, available in the developer portal.
Helpful Resources
 http://webkit.org/blog/       http://devloper.apple.com/


                http://blog.joshschumacher.com

Weitere ähnliche Inhalte

Ähnlich wie Advanced iPhone Web Development

Mobile Apps - The Business & Technology
Mobile Apps - The Business & TechnologyMobile Apps - The Business & Technology
Mobile Apps - The Business & TechnologyAndri Yadi
 
De fluwelen revolutie van android
De fluwelen revolutie van androidDe fluwelen revolutie van android
De fluwelen revolutie van androidRemco Bron
 
Call for Gunslingers to tame Mobzilla
Call for Gunslingers to tame MobzillaCall for Gunslingers to tame Mobzilla
Call for Gunslingers to tame MobzillaPatrice Kerremans
 
Phones are the new PCs. & the Red Fez Sketchbook, November 2010
Phones are the new PCs. & the Red Fez Sketchbook, November 2010Phones are the new PCs. & the Red Fez Sketchbook, November 2010
Phones are the new PCs. & the Red Fez Sketchbook, November 2010Harald Felgner, PhD
 
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für TabletsiEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für TabletsIndiginox
 
HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기JungHyuk Kwon
 
Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1iStrategy
 
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für TabletsiEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für TabletsStefan Kolb
 
The future is mobile
The future is mobileThe future is mobile
The future is mobileShannon Smith
 
Email Design for All Devices
Email Design for All DevicesEmail Design for All Devices
Email Design for All DevicesSilverpop
 
HTML5 & CSS3 "Mobile": PhoneGap
HTML5 & CSS3 "Mobile": PhoneGapHTML5 & CSS3 "Mobile": PhoneGap
HTML5 & CSS3 "Mobile": PhoneGapAndrea Cannella
 
Lill Cecilie Bølstad - NetCom
Lill Cecilie Bølstad - NetComLill Cecilie Bølstad - NetCom
Lill Cecilie Bølstad - NetComMobile Oslo
 
Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1iStrategy
 
Australian broadcasting summit 2011
Australian broadcasting summit 2011Australian broadcasting summit 2011
Australian broadcasting summit 2011Lauren Oldham
 
Cross platform mobile developement introduction
Cross platform mobile developement   introductionCross platform mobile developement   introduction
Cross platform mobile developement introductionMarcel de Vries
 
Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...
Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...
Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...Shane Church
 
Pick Your Poison – Mobile Web, Native or Hybrid?
Pick Your Poison – Mobile Web, Native or Hybrid?Pick Your Poison – Mobile Web, Native or Hybrid?
Pick Your Poison – Mobile Web, Native or Hybrid?Effective
 

Ähnlich wie Advanced iPhone Web Development (20)

Mobile Apps - The Business & Technology
Mobile Apps - The Business & TechnologyMobile Apps - The Business & Technology
Mobile Apps - The Business & Technology
 
De fluwelen revolutie van android
De fluwelen revolutie van androidDe fluwelen revolutie van android
De fluwelen revolutie van android
 
webOS Introduction
webOS IntroductionwebOS Introduction
webOS Introduction
 
Call for Gunslingers to tame Mobzilla
Call for Gunslingers to tame MobzillaCall for Gunslingers to tame Mobzilla
Call for Gunslingers to tame Mobzilla
 
Phones are the new PCs. & the Red Fez Sketchbook, November 2010
Phones are the new PCs. & the Red Fez Sketchbook, November 2010Phones are the new PCs. & the Red Fez Sketchbook, November 2010
Phones are the new PCs. & the Red Fez Sketchbook, November 2010
 
Blog Talk 2010 | Apps are Bad
Blog Talk  2010 | Apps are BadBlog Talk  2010 | Apps are Bad
Blog Talk 2010 | Apps are Bad
 
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für TabletsiEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML-5 zum Unternehmens-Dashboard für Tablets
 
HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기
 
Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1
 
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für TabletsiEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
iEnterprise - Mit HTML5 zum Unternehmens-Dashboard für Tablets
 
The future is mobile
The future is mobileThe future is mobile
The future is mobile
 
Email Design for All Devices
Email Design for All DevicesEmail Design for All Devices
Email Design for All Devices
 
HTML5 & CSS3 "Mobile": PhoneGap
HTML5 & CSS3 "Mobile": PhoneGapHTML5 & CSS3 "Mobile": PhoneGap
HTML5 & CSS3 "Mobile": PhoneGap
 
Lill Cecilie Bølstad - NetCom
Lill Cecilie Bølstad - NetComLill Cecilie Bølstad - NetCom
Lill Cecilie Bølstad - NetCom
 
Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1Hot house istrategy_presentation_february_2012_original-1
Hot house istrategy_presentation_february_2012_original-1
 
Australian broadcasting summit 2011
Australian broadcasting summit 2011Australian broadcasting summit 2011
Australian broadcasting summit 2011
 
Cross platform mobile developement introduction
Cross platform mobile developement   introductionCross platform mobile developement   introduction
Cross platform mobile developement introduction
 
Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...
Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...
Pick Your Poison – Mobile Web, Native, or Hybrid? - Denver Startup Week - Oct...
 
Pick Your Poison – Mobile Web, Native or Hybrid?
Pick Your Poison – Mobile Web, Native or Hybrid?Pick Your Poison – Mobile Web, Native or Hybrid?
Pick Your Poison – Mobile Web, Native or Hybrid?
 
DDive- Giuseppe Grasso - mobile su Lotus
DDive- Giuseppe Grasso - mobile su LotusDDive- Giuseppe Grasso - mobile su Lotus
DDive- Giuseppe Grasso - mobile su Lotus
 

Kürzlich hochgeladen

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Kürzlich hochgeladen (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Advanced iPhone Web Development

  • 1. Advanced iPhone Web Development Josh Schumacher Treemo Labs email: Josh.Schumacher@gmail.com web: http://blog.joshschumacher.com
  • 2. iPhone Symbian Windows Mobile Blackberry Palm Linux Blackberry Windows Mobile 20% 13% Mobile Palm 1% Smartphone Linux 8% Market Share Q4 2008 iPhone 11% Symbian 48%
  • 3. iPhone Android Java ME Symbian Win Mo Blackberry Palm Palm Win Mo 2% 6% Blackberry 3% Symbian 7% Mobile Devices Java ME By Internet Usage 8% April 2009 Android 9% iPhone 65%
  • 4. Topics of Discussion Meta Tags Webkit CSS Extensions Webkit DOM Additions Design Patterns Offline Web Applications Blurring Boundaries, Web Apps as Native Apps Helpful Resources
  • 6. Useful <meta> tags <meta name=quot;viewportquot; content=quot;width=device-width, user- scalable=no initial-scale = 1.0quot; /> <link rel=quot;apple-touch-iconquot; href=quot;/my_custom_icon.pngquot;/> <meta name=quot;apple-mobile-web-app-status-bar-stylequot; content=quot;blackquot; /> <meta name=quot;apple-mobile-web-app-capablequot; content=quot;yesquot; /> <body onorientationchange=quot;myOrientationChangeFunction()quot;> <meta name=quot;format-detectionquot; content=quot;telephone=noquot; />
  • 7. <meta name=quot;apple-mobile-web-app- capablequot; content=quot;yesquot; /> window.navigator.standalone read-only JavaScript Boolean if window is currently in fullscreen mode <meta name=quot;apple-mobile-web- app-status-bar-stylequot; content=quot;blackquot; /> Has no effect unless launched from home screen link Can be set to translucent to hide the status bar
  • 9. Some Must Have CSS Rules text-shadow text-fill-color text-stroke -webkit-tap-highlight-color -webkit-box-shadow -webkit-border-radius -webkit-border-image
  • 10. Getting Really Fancy Gradients Masks Reflections Transitions Animations Transforms
  • 11. Gradients (Coming Soon to iPhone) background: -webkit-gradient( linear, left top, left bottom, from(#333), color-stop(0.8, #bbb), to(#333) );
  • 12. CSS Transitions .fade-away { opacity: 0; -webkit-transition: opacity 1s ease-out 20ms; } <p onclick=quot;className='fade-away';quot;>Click Me To Fade Away</p>
  • 13. Transforms #banner { -webkit-transform: rotate(-45deg); width: 150px; position: absolute; top: 20px; left: 0px; background: red; padding: 4px; text-align: center; border: solid 1px #333; margin-left: -50px; }
  • 15. Multi-Touch Interactions Touches Events Gesture Events Touches are important for keeping track of how many fingers are on the screen, where they are, and what they’re doing. Gestures are important for determining what the user is doing when they have two fingers on the screen and are either pinching, pushing, or rotating them.
  • 16. Touches Events touchstart Happens every time a finger is placed on the screen touchend Happens every time a finger is removed from the screen touchmove Happens as a finger already placed on the screen is moved across the screen touchcancel
  • 17. Gesture Events gesturestart Sent when two or more fingers touch the surface gesturechange Sent when fingers are moved during a gesture gestureend Sent when the gesture ends (when there are 1 or 0 fingers touching the surface)
  • 18. Sample Flow of Events 1. touchstart for finger 1. Sent when the first finger touches the surface. 2. gesturestart. Sent when the second finger touches the surface. 3. touchstart for finger 2. Sent immediately after gesturestart when the second finger touches the surface. 4. gesturechange for current gesture. Sent when both fingers move while still touching the surface. 5. gestureend. Sent when the second finger lifts from the surface. 6. touchend for finger 2. Sent immediately after gestureend when the second finger lifts from the surface. 7. touchend for finger 1. Sent when the first finger lifts from the surface.
  • 20. Use Common Design Patterns Common designs. Mimicking behaviors in native iPhone applications
  • 23. Offline Cache-Manifests Must be served as text/cache-manifest. CACHE MANIFEST demoimages/clownfish.jpg demoimages/clownfishsmall.jpg demoimages/flowingrock.jpg demoimages/flowingrocksmall.jpg demoimages/stones.jpg demoimages/stonessmall.jpg <html manifest=quot;demo.manifestquot;>
  • 25. Utilize UIWebView inside of your native Applications Rapid Development Ship updates w/o Apple Approval Expand potential developer base Easier porting to other devices
  • 26. Using Objective-C in Javascript WebScriptObject.h defines methods you can implement in your Objective-C classes to expose their interfaces to a scripting environment such as JavaScript @interface BasicAddressBook: NSObject { } + (BasicAddressBook *)addressBook; - (NSString *)nameAtIndex:(int)index; @end BasicAddressBook *littleBlackBook = [BasicAddressBook addressBook]; id win = [webView windowScriptObject]; [win setValue:littleBlackBook forKey:@quot;AddressBookquot;]; function printNameAtIndex(index) { var myaddressbook = window.AddressBook; var name = myaddressbook.nameAtIndex_(index); document.write(name); } See Webkit DOM Programming Topics and WebKit Objective-C Framework Reference for more information, available in the developer portal.
  • 27. Helpful Resources http://webkit.org/blog/ http://devloper.apple.com/ http://blog.joshschumacher.com

Hinweis der Redaktion