SlideShare a Scribd company logo
1 of 62
Download to read offline
Jay Balunas | JBoss, By Red Hat


The Mobile Web Revealed For
    The Java Developer
Who am I

• RichFaces Project Lead
• JBoss Core Developer
• JSF 2.2 Expert Group
• Red Hat W3C Member
TweetStream
• RichFaces 4.0 + JSF 2
• Built to support mobile
  webkit devices
• No 3rd party front end
  frameworks
• Completely driven by
  JBoss tech
Check It Out For Yourself
Hosted on OpenShift:
 http://bit.ly/tweetstream2

Matching Tweets Tags:
   #JBoss
   #RichFaces
   #JAXConf
   #JSFSummit
Source on GitHub:
 https://github.com/richfaces/tweetstream
Are You A Mobile
  Developer?
Mobile Developer?
• Do you have mobile requirements today?
• How about the near future?
• Will your boss know what he/she wants?
• Will you be ready for it?
Even if you said NO

The answer is probably YES
Why?
        • 1 billion smart phones today
        • 2014 mobile internet > desktop internet
        • End of 2010 53% of companies will have
              deployed iPhones
        • Tablet revenue to surpass $49B by 2015
        • And on, and on, and on...

http://www.thefonestuff.com/news/10/Mobile-Phone-Facts-2011.html
Aberdeen Group dec 2009
So Now What?
What you need to know
• Native, Web, Hybrid Applications
• The Mobile Web
• HTML5 Influence
• Framework Support
• Links & Wrap Up
A Mobile Device Is:
• Smartphone & tablet devices
• Support complex native        Not
  applications
• Access to the standard web
  via advanced browsers
Native, Mobile Web, Hybrid
• Whats the difference, and why I care?

• What can the apps do?

• Can I use the skills I already have?

• How can I maintain it?
Native
• Full access to device features
  –Software & hardware
• Performance
• Advanced graphics
• Easy offline support
• Built in market place and purchasing
• Developer tools from venders
Native
• New languages & APIs
• Controlled marketplace & process
• Upgrading
• Porting to multiple devices
• Lock in
Mobile Web
• Write/host once, run anywhere*
• Upgrades = refresh
• Creative freedom
• Use skills you already have
• Same back end services you already have
• Easy intranet as well as Internet
Mobile Web
• Limited access to device features
• Performance & graphics concerns
• Cross browser support issues
• Quirky network connections
• Limited offline support
• Market Awareness
Hybrid Apps
• Mixes native & web technologies
• Many vendors are offering solutions
• Claims “best of both”
• Lots of variations
• Usually boils down to a native application
Hybrid App Variations
• Native app that pulls in web content
• Native app “compiled” from web
 technologies
• Native app shell around a browser
  –Varying degrees
The Spectrum




                                               mixed
                Appcelerator
native                                    custom web
                                wrapper
                    RhoMobile
                                                desktop web
         mash-ups
                          phone gap
So how do you choose?
What you need to know
• Native, Web, Hybrid Applications
• The Mobile Web
• HTML5 Influence
• Framework Support
• Links & Wrap Up
Great Time For The Mobile Web
         • Billions in revenue, and investments

         • Device makers & carriers are driving technology

         • HTML 5 technologies advancing

         • Near native application support is possible

         • Huge developer base with existing skills

         • Native apps are increasingly silo’ed tech
http://www.gomonews.com/mobile-web-application-development-platforms-will-generate-2-6-billion-by-201/
http://venturebeat.com/2011/04/07/how-html5-will-kill-the-native-app/
Why The Enterprise Needs
          The Mobile Web
• You’re not making the next angry birds!
• Large investments & requirements already in place
• Intranet support can be a blocker for many
• You don’t target the device the device targets you
• Transactions, security, messaging, persistence
• Cloud functionality only strengthens the argument
Different Mobile Webs?
• Standard web site with compatibility

• Minor variations for compatibility

• One page using Markup/CSS to adjust content

• Device/format specific pages with advanced
 support for app like behaviors
Things to consider

• Context and Navigation

• Design & Usability Tips

• Device/feature detection

• Orientation layout support
Context and Navigation
• Define your use-cases
• Why is the user accessing your site
  – From where?
  – From what?
• Is functionality different:
  – Desktop?
  – Device type?
• Limit transitions, and clicks
• Don’t offer the world, offer workflows
Design & Usability
• Use view port & scaling
• Load only data that is needed
• Don’t rely too heavily on resolution
• Don’t bunch controls
• Avoid internal scrollbars
• Avoid fluff & complex branding
• Don’t launch new pages
• Limit input text that is needed
Device & Feature Detection
Header Inspection
HTTP_HOST == myproxylists.com
HTTP_USER_AGENT == Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-
us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7
Safari/6533.18.5
HTTP_ACCEPT == application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_LANGUAGE == en-us
HTTP_ACCEPT_ENCODING == gzip, deflate
HTTP_CONNECTION == keep-alive
REMOTE_ADDR == xx.xxx.x.xxx
REMOTE_PORT == 53298
REQUEST_METHOD == GET
REQUEST_URI == /my-http-headers
REQUEST_TIME == 1304015649
REMOTE_HOST == pool-xx-xxx-x-xxx.fios.verizon.net
COUNTRY == [US] UNITED STATES



            iPad Request
            Header
What Can We Tell?

• Operating system
• Browser type & version
• IP address
• Can infer
   – Carrier
   – Country
   – Device brand & model
How do I do that?
//Retrieve and parse the header
FacesContext facesContext = FacesContext.getCurrentInstance();

Map<String, String> headerList = facesContext.
                    getExternalContext().getRequestHeaderMap
();

String UserAgent = headerList.get("user-agent");

//Parse, and manage everything.....

                                      Don’t do
                                      this to
                                      yourself
Help Is Out There

                 • MobileESP

                                   Single Class
                                   User-Agent
                                   Processor
                 • WURFL APIs


Wireless Universal Resource File
TweetStream & Mobile ESP
@Named("userAgent")
@RequestScoped
public class UserAgentProcessor
{
   @PostConstruct
   public void init()
   {
      ....
      userAgentStr = request.getHeader("user-agent");
      httpAccept = request.getHeader("Accept");
      uAgentTest = new UAgentInfo(userAgentStr, httpAccept);
   }


            http://bit.ly/twstr_useragent
Mobile ESP
    public boolean isPhone()
    {
       //Detects a whole tier of phones that support
       // similar functionality as the iphone
       return uAgentTest.detectTierIphone();
    }

    public boolean isTablet()
    {
       //Detect ipads, xooms, blackberry tablets
       // but not galaxy - they use a strange user-agent
       return uAgentTest.detectTierTablet();
    }
}
            http://bit.ly/twstr_useragent
Bookmarks

– Are your pages “bookmarkable” ?

– Does the one URL handle all devices?

– Can the user choose the format?
home.xhtml
                                            Single Point of Entry
 <c:choose>
    <c:when test="#{userAgent.phone}">
       <ui:include src="phoneHome.xhtml"/>
    </c:when>
    <c:when test="#{userAgent.tablet}">
       <ui:include src="tabletHome.xhtml"/>
    </c:when>
    <c:otherwise>
        <!-- <ui:include src=”desktopHome.xhtml”/>
       <ui:include src="tabletHome.xhtml"/>
    </c:otherwise>
 </c:choose>
                                    Detection Made By
                                    Form-Factor
http://bit.ly/twstr_homexhtml
Feature Detection
• “Future proof”
• Enhances device detection
• JavaScript object, attribute
 checking
• Good for handling the nuances
• Different project & options out there
Modernizr Example
Simple JavaScript File to load

   .multiplebgs div p {
     /* properties for browsers that
        support multiple backgrounds */
   }
   .no-multiplebgs div p {
     /* optional fallback properties
        for browsers that don't */
   }
My Advice

• Device detection = high level content
  form-factor

• Feature detection = nuances within a
  device type
Orientation Layout Changes

• Supported on most
 modern devices
• Optimize your layout
• CSS3 & @media
TweetStream & Orientation

/* catch tablet portrait orientation */
@media all and (orientation:portrait) {}


/* catch tablet landscape orientation */
@media all and (orientation:landscape) {}




   http://bit.ly/twstr_orientation
What you need to know
• Native, Web, Hybrid Applications
• The Mobile Web
• HTML5 Influence
• Framework Support
• Links & Wrap Up
HTML5


"HTML5 is anything you want it to be as
    long as it's new and cool."
-Peter Paul Koch
HTML5
• New semantic tags
  – <header>,<aside>,<section>, etc..
• Video & Audio tags
• New input types, and form elements
  – type=email, date, tel, color, etc...
• Offline Web Cache
Non-HTML5 HTML5
• Canvas 2D
                                   <canvas>
• Geolocation
• Web Storage
                              window.geolocation
• Web Workers
• Web Socket
• Server-side Events
• Device Orientation Events
CSS 3
• Media Queries
  –Display size
                   @media all and
  –Orientation     (orientation:landscape) {
  –Aspect Ratio
• Borders, backgrounds, and colors
  –Gradient colors
  –Rounded corners
• Selectors
Not All Wonderful
• Different vendors have different levels of
 support

• Custom tags, styles for specific browsers

• Specifications are a long way from final

• Some special handling likely always needed
Keep Up On The Latest
            http://quirksmode.org

• Regularly updated browser support tests
• Spans OS’s, Browsers, Devices
• Covers HTML 5, Webkit extensions, and
 more
What you need to know
• Native, Web, Hybrid Applications
• The Mobile Web
• HTML5 Influence
• Framework Support
• Links & Wrap Up
Framework Support
• Home spun markup, custom
 JavaScript, and JQuery
• Google web toolkit ( GWT )
• JSF2 + RichFaces 4
Home Spun
• Amazing flexibility
• Page structure, style, scripts
  all in your control
• Separation of concerns
• jQuery and others to help you
  through
• Detailed optimizations
• Container supported content
  available
Home Spun
• Amazingly flexible
• You own it all
• Extensive HTML,
  JavaScript, CSS skills
• Lots to manage, develop,
  and maintain
• Get wrapped up in the
  details quickly
• Limited MVC support
GWT
• Open source & backed by Google
• Write apps mostly using Java
 – JavaScript compiler
• GWT handles a many x-browser issues
• User agent support determined at
  compile time
• Additional support announced at
  Google IO
• 3rd party projects out there as well
GWT
• Really one vendor
• Non-standard
• Support options are limited
                                  or
• CSS still required for style
• 3rd party projects are either
  immature, or stale.
JSF 2 &
• Standard based
• Full EE6 stack of features
• Balanced between implementation & details
• Backed by many vendors, and options
• Mobile integration today
• Advanced mobile features in development
• Enterprise support available
Complexity When You Need It
• Handle the details
  – Don’t hide them
• Access to JavaScript/CSS
• Use as much or as little of EE
  as you like
• Participate, extend, and
  adjust as needed
JSF 2 & RichFaces
                                    Projects like
                                    RichFaces can
• Specifications can move slowly    lead the way!

• Integrated, advanced mobile support is in
  development
• CSS, XHMTL, and JavaScript skills needed



                                  Nearly full
Functionality based.              functionality
Not too much, not                 available today
too little
So How Do I Choose?
What you need to know

• Native, Web, Hybrid Applications
• The Mobile Web
• HTML5 Influence
• Framework Support
• Links & Wrap Up
For more information
    JBoss Projects                           Specification Info
•   http://jboss.org                         •   http://html5rocks.com
•   http://richfaces.org                     •   http://www.w3c.org
•   http://richfaces.org/showcase            •   http://jcp.org
•   http://jboss.org/errai                   •   http://quirksmode.org


    Mobile Web                               Device Dev Sites
•   http://jquerymobile.com             •   http://developer.apple.com
•   http://sproutcore.com               •   http://developer.android.com
•   http://code.google.com/webtoolkit   •   http://blackberry.com/developers
•   http://wurfl.sourceforge.net        •   http://msdn.microsoft.com/en-us/
•   http://mobileesp.com                    windowsmobile/
•   http://modernizr.com
Q&A

•   http://in.relation.to/Bloggers/Jay
•   http://twitter.com/tech4j
•   http://github.com/balunasj
•   jbalunas@jboss.org

More Related Content

What's hot

Real-world Dojo Mobile
Real-world Dojo MobileReal-world Dojo Mobile
Real-world Dojo Mobile
Andrew Ferrier
 
Creating mobile apps without native code
Creating mobile apps without native codeCreating mobile apps without native code
Creating mobile apps without native code
Joakim Kemeny
 
Webdev battacherjee
Webdev battacherjeeWebdev battacherjee
Webdev battacherjee
RavingTiger
 
Applying Functional Programming to Build Platform-Independent Mobile Applicat...
Applying Functional Programming to Build Platform-Independent Mobile Applicat...Applying Functional Programming to Build Platform-Independent Mobile Applicat...
Applying Functional Programming to Build Platform-Independent Mobile Applicat...
granicz
 
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFOWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
Brian Huff
 

What's hot (20)

Real-world Dojo Mobile
Real-world Dojo MobileReal-world Dojo Mobile
Real-world Dojo Mobile
 
WebCenter Content & Portal Methodology Deep Dive with Case Studies
WebCenter Content & Portal Methodology Deep Dive with Case StudiesWebCenter Content & Portal Methodology Deep Dive with Case Studies
WebCenter Content & Portal Methodology Deep Dive with Case Studies
 
Mobile Web High Performance
Mobile Web High PerformanceMobile Web High Performance
Mobile Web High Performance
 
Creating mobile apps without native code
Creating mobile apps without native codeCreating mobile apps without native code
Creating mobile apps without native code
 
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
 
Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app Anatomy of an HTML 5 mobile web app
Anatomy of an HTML 5 mobile web app
 
Creating and Maintaining An Internationalized Website
Creating and Maintaining An Internationalized WebsiteCreating and Maintaining An Internationalized Website
Creating and Maintaining An Internationalized Website
 
Mobile Web Apps Overview
Mobile Web Apps OverviewMobile Web Apps Overview
Mobile Web Apps Overview
 
MAST Portal: drivers and recommendations
MAST Portal: drivers and recommendations  MAST Portal: drivers and recommendations
MAST Portal: drivers and recommendations
 
Webdev battacherjee
Webdev battacherjeeWebdev battacherjee
Webdev battacherjee
 
Applying Functional Programming to Build Platform-Independent Mobile Applicat...
Applying Functional Programming to Build Platform-Independent Mobile Applicat...Applying Functional Programming to Build Platform-Independent Mobile Applicat...
Applying Functional Programming to Build Platform-Independent Mobile Applicat...
 
Building Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and IonicBuilding Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and Ionic
 
Mobile for the rest of us
Mobile for the rest of usMobile for the rest of us
Mobile for the rest of us
 
Orion Introduction
Orion IntroductionOrion Introduction
Orion Introduction
 
Briding the Gap between Desktop and Mobile publishing
Briding the Gap between Desktop and Mobile publishingBriding the Gap between Desktop and Mobile publishing
Briding the Gap between Desktop and Mobile publishing
 
Synapse india reviews on mobile application development
Synapse india reviews on mobile application developmentSynapse india reviews on mobile application development
Synapse india reviews on mobile application development
 
Oracle ADF Mobile OGh (Oracle User Group Netherlands)
Oracle ADF Mobile OGh (Oracle User Group Netherlands)Oracle ADF Mobile OGh (Oracle User Group Netherlands)
Oracle ADF Mobile OGh (Oracle User Group Netherlands)
 
ADF Mobile - an intro for Developers
ADF Mobile - an intro for DevelopersADF Mobile - an intro for Developers
ADF Mobile - an intro for Developers
 
Accessibility for Fun and Profit
Accessibility for Fun and ProfitAccessibility for Fun and Profit
Accessibility for Fun and Profit
 
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFOWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
 

Viewers also liked

Rich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_boothRich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_booth
balunasj
 

Viewers also liked (6)

Rich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_boothRich faces in_the_cloud_mini_booth
Rich faces in_the_cloud_mini_booth
 
RichFaces 4 Component Deep Dive - JAX/JSFSummit
RichFaces 4 Component Deep Dive - JAX/JSFSummitRichFaces 4 Component Deep Dive - JAX/JSFSummit
RichFaces 4 Component Deep Dive - JAX/JSFSummit
 
A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4
A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4
A Peek At The Future: Going Beyond JavaServer Faces 2.0 With RichFaces 4
 
Realtime web application with java
Realtime web application with javaRealtime web application with java
Realtime web application with java
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar to The Mobile Web Revealed For The Java Developer

Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
Chris Morrell
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
davyjones
 

Similar to The Mobile Web Revealed For The Java Developer (20)

Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
PhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile HackPhoneGap at Facebook Mobile Hack
PhoneGap at Facebook Mobile Hack
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
 
Producing a mobile presence. Timeline: Yesterday...
Producing a mobile presence. Timeline: Yesterday...Producing a mobile presence. Timeline: Yesterday...
Producing a mobile presence. Timeline: Yesterday...
 
Android development workshop
Android development workshopAndroid development workshop
Android development workshop
 
HTML5 or Android for Mobile Development?
HTML5 or Android for Mobile Development?HTML5 or Android for Mobile Development?
HTML5 or Android for Mobile Development?
 
Mobile web or native app
Mobile web or native appMobile web or native app
Mobile web or native app
 
Mobile CMS - CMSExpo 2010
Mobile CMS - CMSExpo 2010Mobile CMS - CMSExpo 2010
Mobile CMS - CMSExpo 2010
 
Mobile Web
Mobile WebMobile Web
Mobile Web
 
Cross Platform Mobile Development
Cross Platform Mobile DevelopmentCross Platform Mobile Development
Cross Platform Mobile Development
 
Philly ete-2011
Philly ete-2011Philly ete-2011
Philly ete-2011
 
Development Workshop on ET1, Android and Motorola RhoElements
Development Workshop on ET1, Android and Motorola RhoElementsDevelopment Workshop on ET1, Android and Motorola RhoElements
Development Workshop on ET1, Android and Motorola RhoElements
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
Mobile Web High Performance
Mobile Web High PerformanceMobile Web High Performance
Mobile Web High Performance
 
Txjs
TxjsTxjs
Txjs
 
chapter2
chapter2chapter2
chapter2
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 

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 Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
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
Enterprise Knowledge
 

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
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.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
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 

The Mobile Web Revealed For The Java Developer

  • 1. Jay Balunas | JBoss, By Red Hat The Mobile Web Revealed For The Java Developer
  • 2. Who am I • RichFaces Project Lead • JBoss Core Developer • JSF 2.2 Expert Group • Red Hat W3C Member
  • 3. TweetStream • RichFaces 4.0 + JSF 2 • Built to support mobile webkit devices • No 3rd party front end frameworks • Completely driven by JBoss tech
  • 4. Check It Out For Yourself Hosted on OpenShift: http://bit.ly/tweetstream2 Matching Tweets Tags: #JBoss #RichFaces #JAXConf #JSFSummit Source on GitHub: https://github.com/richfaces/tweetstream
  • 5.
  • 6. Are You A Mobile Developer?
  • 7. Mobile Developer? • Do you have mobile requirements today? • How about the near future? • Will your boss know what he/she wants? • Will you be ready for it?
  • 8. Even if you said NO The answer is probably YES
  • 9. Why? • 1 billion smart phones today • 2014 mobile internet > desktop internet • End of 2010 53% of companies will have deployed iPhones • Tablet revenue to surpass $49B by 2015 • And on, and on, and on... http://www.thefonestuff.com/news/10/Mobile-Phone-Facts-2011.html Aberdeen Group dec 2009
  • 11. What you need to know • Native, Web, Hybrid Applications • The Mobile Web • HTML5 Influence • Framework Support • Links & Wrap Up
  • 12. A Mobile Device Is: • Smartphone & tablet devices • Support complex native Not applications • Access to the standard web via advanced browsers
  • 13. Native, Mobile Web, Hybrid • Whats the difference, and why I care? • What can the apps do? • Can I use the skills I already have? • How can I maintain it?
  • 14. Native • Full access to device features –Software & hardware • Performance • Advanced graphics • Easy offline support • Built in market place and purchasing • Developer tools from venders
  • 15. Native • New languages & APIs • Controlled marketplace & process • Upgrading • Porting to multiple devices • Lock in
  • 16. Mobile Web • Write/host once, run anywhere* • Upgrades = refresh • Creative freedom • Use skills you already have • Same back end services you already have • Easy intranet as well as Internet
  • 17. Mobile Web • Limited access to device features • Performance & graphics concerns • Cross browser support issues • Quirky network connections • Limited offline support • Market Awareness
  • 18. Hybrid Apps • Mixes native & web technologies • Many vendors are offering solutions • Claims “best of both” • Lots of variations • Usually boils down to a native application
  • 19. Hybrid App Variations • Native app that pulls in web content • Native app “compiled” from web technologies • Native app shell around a browser –Varying degrees
  • 20. The Spectrum mixed Appcelerator native custom web wrapper RhoMobile desktop web mash-ups phone gap
  • 21. So how do you choose?
  • 22. What you need to know • Native, Web, Hybrid Applications • The Mobile Web • HTML5 Influence • Framework Support • Links & Wrap Up
  • 23. Great Time For The Mobile Web • Billions in revenue, and investments • Device makers & carriers are driving technology • HTML 5 technologies advancing • Near native application support is possible • Huge developer base with existing skills • Native apps are increasingly silo’ed tech http://www.gomonews.com/mobile-web-application-development-platforms-will-generate-2-6-billion-by-201/ http://venturebeat.com/2011/04/07/how-html5-will-kill-the-native-app/
  • 24. Why The Enterprise Needs The Mobile Web • You’re not making the next angry birds! • Large investments & requirements already in place • Intranet support can be a blocker for many • You don’t target the device the device targets you • Transactions, security, messaging, persistence • Cloud functionality only strengthens the argument
  • 25. Different Mobile Webs? • Standard web site with compatibility • Minor variations for compatibility • One page using Markup/CSS to adjust content • Device/format specific pages with advanced support for app like behaviors
  • 26. Things to consider • Context and Navigation • Design & Usability Tips • Device/feature detection • Orientation layout support
  • 27. Context and Navigation • Define your use-cases • Why is the user accessing your site – From where? – From what? • Is functionality different: – Desktop? – Device type? • Limit transitions, and clicks • Don’t offer the world, offer workflows
  • 28. Design & Usability • Use view port & scaling • Load only data that is needed • Don’t rely too heavily on resolution • Don’t bunch controls • Avoid internal scrollbars • Avoid fluff & complex branding • Don’t launch new pages • Limit input text that is needed
  • 29. Device & Feature Detection
  • 30. Header Inspection HTTP_HOST == myproxylists.com HTTP_USER_AGENT == Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en- us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5 HTTP_ACCEPT == application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 HTTP_ACCEPT_LANGUAGE == en-us HTTP_ACCEPT_ENCODING == gzip, deflate HTTP_CONNECTION == keep-alive REMOTE_ADDR == xx.xxx.x.xxx REMOTE_PORT == 53298 REQUEST_METHOD == GET REQUEST_URI == /my-http-headers REQUEST_TIME == 1304015649 REMOTE_HOST == pool-xx-xxx-x-xxx.fios.verizon.net COUNTRY == [US] UNITED STATES iPad Request Header
  • 31. What Can We Tell? • Operating system • Browser type & version • IP address • Can infer – Carrier – Country – Device brand & model
  • 32. How do I do that? //Retrieve and parse the header FacesContext facesContext = FacesContext.getCurrentInstance(); Map<String, String> headerList = facesContext. getExternalContext().getRequestHeaderMap (); String UserAgent = headerList.get("user-agent"); //Parse, and manage everything..... Don’t do this to yourself
  • 33. Help Is Out There • MobileESP Single Class User-Agent Processor • WURFL APIs Wireless Universal Resource File
  • 34. TweetStream & Mobile ESP @Named("userAgent") @RequestScoped public class UserAgentProcessor { @PostConstruct public void init() { .... userAgentStr = request.getHeader("user-agent"); httpAccept = request.getHeader("Accept"); uAgentTest = new UAgentInfo(userAgentStr, httpAccept); } http://bit.ly/twstr_useragent
  • 35. Mobile ESP public boolean isPhone() { //Detects a whole tier of phones that support // similar functionality as the iphone return uAgentTest.detectTierIphone(); } public boolean isTablet() { //Detect ipads, xooms, blackberry tablets // but not galaxy - they use a strange user-agent return uAgentTest.detectTierTablet(); } } http://bit.ly/twstr_useragent
  • 36. Bookmarks – Are your pages “bookmarkable” ? – Does the one URL handle all devices? – Can the user choose the format?
  • 37. home.xhtml Single Point of Entry <c:choose> <c:when test="#{userAgent.phone}"> <ui:include src="phoneHome.xhtml"/> </c:when> <c:when test="#{userAgent.tablet}"> <ui:include src="tabletHome.xhtml"/> </c:when> <c:otherwise> <!-- <ui:include src=”desktopHome.xhtml”/> <ui:include src="tabletHome.xhtml"/> </c:otherwise> </c:choose> Detection Made By Form-Factor http://bit.ly/twstr_homexhtml
  • 38. Feature Detection • “Future proof” • Enhances device detection • JavaScript object, attribute checking • Good for handling the nuances • Different project & options out there
  • 39. Modernizr Example Simple JavaScript File to load .multiplebgs div p { /* properties for browsers that support multiple backgrounds */ } .no-multiplebgs div p { /* optional fallback properties for browsers that don't */ }
  • 40. My Advice • Device detection = high level content form-factor • Feature detection = nuances within a device type
  • 41. Orientation Layout Changes • Supported on most modern devices • Optimize your layout • CSS3 & @media
  • 42. TweetStream & Orientation /* catch tablet portrait orientation */ @media all and (orientation:portrait) {} /* catch tablet landscape orientation */ @media all and (orientation:landscape) {} http://bit.ly/twstr_orientation
  • 43. What you need to know • Native, Web, Hybrid Applications • The Mobile Web • HTML5 Influence • Framework Support • Links & Wrap Up
  • 44. HTML5 "HTML5 is anything you want it to be as long as it's new and cool." -Peter Paul Koch
  • 45. HTML5 • New semantic tags – <header>,<aside>,<section>, etc.. • Video & Audio tags • New input types, and form elements – type=email, date, tel, color, etc... • Offline Web Cache
  • 46. Non-HTML5 HTML5 • Canvas 2D <canvas> • Geolocation • Web Storage window.geolocation • Web Workers • Web Socket • Server-side Events • Device Orientation Events
  • 47. CSS 3 • Media Queries –Display size @media all and –Orientation (orientation:landscape) { –Aspect Ratio • Borders, backgrounds, and colors –Gradient colors –Rounded corners • Selectors
  • 48. Not All Wonderful • Different vendors have different levels of support • Custom tags, styles for specific browsers • Specifications are a long way from final • Some special handling likely always needed
  • 49. Keep Up On The Latest http://quirksmode.org • Regularly updated browser support tests • Spans OS’s, Browsers, Devices • Covers HTML 5, Webkit extensions, and more
  • 50. What you need to know • Native, Web, Hybrid Applications • The Mobile Web • HTML5 Influence • Framework Support • Links & Wrap Up
  • 51. Framework Support • Home spun markup, custom JavaScript, and JQuery • Google web toolkit ( GWT ) • JSF2 + RichFaces 4
  • 52. Home Spun • Amazing flexibility • Page structure, style, scripts all in your control • Separation of concerns • jQuery and others to help you through • Detailed optimizations • Container supported content available
  • 53. Home Spun • Amazingly flexible • You own it all • Extensive HTML, JavaScript, CSS skills • Lots to manage, develop, and maintain • Get wrapped up in the details quickly • Limited MVC support
  • 54. GWT • Open source & backed by Google • Write apps mostly using Java – JavaScript compiler • GWT handles a many x-browser issues • User agent support determined at compile time • Additional support announced at Google IO • 3rd party projects out there as well
  • 55. GWT • Really one vendor • Non-standard • Support options are limited or • CSS still required for style • 3rd party projects are either immature, or stale.
  • 56. JSF 2 & • Standard based • Full EE6 stack of features • Balanced between implementation & details • Backed by many vendors, and options • Mobile integration today • Advanced mobile features in development • Enterprise support available
  • 57. Complexity When You Need It • Handle the details – Don’t hide them • Access to JavaScript/CSS • Use as much or as little of EE as you like • Participate, extend, and adjust as needed
  • 58. JSF 2 & RichFaces Projects like RichFaces can • Specifications can move slowly lead the way! • Integrated, advanced mobile support is in development • CSS, XHMTL, and JavaScript skills needed Nearly full Functionality based. functionality Not too much, not available today too little
  • 59. So How Do I Choose?
  • 60. What you need to know • Native, Web, Hybrid Applications • The Mobile Web • HTML5 Influence • Framework Support • Links & Wrap Up
  • 61. For more information JBoss Projects Specification Info • http://jboss.org • http://html5rocks.com • http://richfaces.org • http://www.w3c.org • http://richfaces.org/showcase • http://jcp.org • http://jboss.org/errai • http://quirksmode.org Mobile Web Device Dev Sites • http://jquerymobile.com • http://developer.apple.com • http://sproutcore.com • http://developer.android.com • http://code.google.com/webtoolkit • http://blackberry.com/developers • http://wurfl.sourceforge.net • http://msdn.microsoft.com/en-us/ • http://mobileesp.com windowsmobile/ • http://modernizr.com
  • 62. Q&A • http://in.relation.to/Bloggers/Jay • http://twitter.com/tech4j • http://github.com/balunasj • jbalunas@jboss.org