SlideShare a Scribd company logo
1 of 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

More Related Content

Similar to 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
 

Similar to 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
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

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

Editor's Notes