SlideShare a Scribd company logo
1 of 45
Download to read offline
iPhone Ajax Push With ICEfaces


Ted Goddard, Ph.D.
ICEsoft Technologies, Inc.


ICESOFT TECHNOLOGIES INC.                           www.icefaces.org   1
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
Where the Mobile Web Went Wrong

       • WAP
                 – subset of XHTML, WAP 1.0 required “WAP gateway”


       • Should we have additional mobile web standards?
                 – Focus on how the mobile web is different?


       • The iPhone browser succeeds because it is a desktop
         browser (on a small screen)

       • The iPhone initiated the convergence of the mobile
         web and the desktop web
       • The mobile web is not constrained by software

ICESOFT TECHNOLOGIES INC.                                      www.icefaces.org   3
Actual Mobile Device Constraints
  • Hardware constraints
           – RAM, Persistent storage, CPU


  •      Battery Power
          – The CPU may be fast, but cycles are still limited


  • Wireless Network Bandwidth, Latency, Connectivity
           – Application load time
           – Interaction delays
           – Loss of connectivity


  • UI Differences
           – Small screen
           – Touch or stylus based input
           – Cumbersome text input

ICESOFT TECHNOLOGIES INC.                                       www.icefaces.org
Addressing the Constraints

  • Hardware Constraints
           – Small JavaScript implementation
  •      Battery power
          – Delegate application execution to the server
  • Wireless Network Bandwidth, Latency, Connectivity
           –     Small JavaScript shortens load time
           –     Incremental page updates
           –     Ajax Push can hide latency, simplify user interaction
           –     Intermittent connectivity to be addressed


  • UI Differences
           – Simplify UI Controls and stylesheets
           – Modify the page according to input
           – Recommended list of controls



ICESOFT TECHNOLOGIES INC.                                                www.icefaces.org
Suitable Mobile Browsers


       • “Modern” browsers are available on a number of
         platforms:

       •      Safari/iPhone
       •      RIM Browser/BlackBerry Bold
       •      Opera Mobile/Windows Mobile (not Opera Mini)
       •      Nokia Browser (Gecko)/N95
       •      Samsung Browser (WebKit)/Instinct

       • ?WebKit Browser/Android (works in simulator)


ICESOFT TECHNOLOGIES INC.                          www.icefaces.org   6
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
Developing for Mobile and Desktop

       •      How much code re-use is possible?
       •      Model (JavaBeans) can be completely shared
       •      Most pages will work
       •      But you want an insanely great mobile experience
       •      Some things to avoid:
                 –     large images
                 –     clutter
                 –     drag and drop
                 –     list selection
                 –     scrolling
       • Help the user
                 – use Ajax to present just relevant options


ICESOFT TECHNOLOGIES INC.                                      www.icefaces.org   8
Browser detection



 public boolean isMobile() {

          HttpServletRequest request = (HttpServletRequest)
                  FacesContext.getCurrentInstance()
                      .getExternalContext().getRequest();

          String agent = request.getHeader(quot;user-agentquot;).toLowerCase();

          if ((agent.indexOf(quot;safariquot;) != -1 && agent.indexOf(quot;mobilequot;) != -1) ||
              (agent.indexOf(quot;operaquot;) != -1 && agent.indexOf(quot;240x320quot;) != -1)) {
 !           mobile = true;
          }

          return mobile;
 }




ICESOFT TECHNOLOGIES INC.                                     www.icefaces.org   9
Avoiding Large Images


       • Scale images down for mobile users


  BufferedImage bdest = new BufferedImage((int)(ourWidth*aspectWidth),
          (int)(ourHeight*aspectHeight), BufferedImage.TYPE_INT_RGB);

  Graphics2D g = bdest.createGraphics();

  AffineTransform at = AffineTransform.getScaleInstance(aspectWidth, aspectHeight);

  g.drawRenderedImage(bsrc, at);
  ImageIO.write(bdest, quot;JPGquot;, new File(“mobile”, imageName);



       • Scaled images are saved in an alternate directory
       • URL is adjusted for mobile users


ICESOFT TECHNOLOGIES INC.                                      www.icefaces.org   10
Avoiding Clutter
       • Switch off decorative elements ...




ICESOFT TECHNOLOGIES INC.                     www.icefaces.org   11
Avoiding Clutter

       • ... for mobile users




ICESOFT TECHNOLOGIES INC.       www.icefaces.org   12
Avoiding Clutter

       • Switch off decorative elements via rendered=

                 <div class=quot;presentationDIVquot;>
                     <ui:include src=quot;presentation.jspxquot;/>
                 </div>
                 <div class=quot;participantsChatDIVquot;>
                     <ice:panelGroup rendered=quot;#{!participant.mobile}quot;>
                 ! !     <img src=quot;resources/images/logo_reflection.jpgquot; />
                 ! !     <img src=quot;resources/images/part_tab.jpgquot;/>
                     </ice:panelGroup>
                     <ui:include src=quot;participants.jspxquot;/>
                     <ui:include src=quot;popups.jspxquot; />
                 ! <ice:panelGroup rendered=quot;#{!participant.mobile}quot;
                 !                  style=quot;padding-top: 15px;quot;>
                 !      <img src=quot;resources/images/chat_tab.gifquot;/>
                 ! </ice:panelGroup>
                 ! <ui:include src=quot;chat.jspxquot;/>
                 </div>



ICESOFT TECHNOLOGIES INC.                                     www.icefaces.org   13
Mobile UI Considerations




       • Dragging in Safari on the iPhone scrolls the page

       • Selection by dragging is difficult
                 – prefer selection from a list rather than a drop-down menu


       • Pixels are limited
                 – prefer simple interfaces without decoration




ICESOFT TECHNOLOGIES INC.                                        www.icefaces.org   14
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
WebMC Demo




ICESOFT TECHNOLOGIES INC.   www.icefaces.org   16
Avoiding Scrolling


  <meta name=quot;viewportquot;
        content=quot;width=480; initial-scale=1.0;maximum-scale=1.0;quot; />


  width, height: size in pixels of the web page

  initial-scale, maximum-scale, minimum-scale, user-scalable
  scaling parameters


  symbolic constants are also available and preferred:
  device-width,device-height


  <meta name=quot;viewportquot;     content=quot;width=device-widthquot; />




ICESOFT TECHNOLOGIES INC.                                www.icefaces.org   17
Help the user

       • Incrementally present only relevant options




ICESOFT TECHNOLOGIES INC.                       www.icefaces.org   18
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
Server-mediated Collaboration




                                                            External Application



                                    Server


                            • User Initiated
                   User
                  Push                                          Push
                                                                Push
                  Action    • Application Initiated


                   Micha                                         Ted




ICESOFT TECHNOLOGIES INC.                             www.icefaces.org
Applications in the Participation Age                           8


   Application-mediated communication.
>     Distance learning
>     Collaborative authoring
>     Auctions
>     Shared WebDAV filesystem
>     Blogging and reader comments
>     SIP-coordinated mobile applications
>     Hybrid chat/email/discussion forums
>     Customer assistance on sales/support pages
>     Multi-step business process made collaborative
>     Shared trip planner or restaurant selector with maps
>     Shared calendar, “to do” list, project plan
>     Games
>     Enterprise shared record locking and negotiation
ICESOFT TECHNOLOGIES INC.                       www.icefaces.org
18


Ajax Poll vs Ajax Push
Bending the rules of HTTP.




ICESOFT TECHNOLOGIES INC.    www.icefaces.org
Ajax Push
HTTP message flow inversion.


         GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1
         Accept: */*
         Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4
         Connection: keep-alive
         Host: vorlon.ice:18080
                                                   Chat message “Howdy”
         HTTP/1.1 200 OK
         Content-Type: text/xml;charset=UTF-8
         Content-Length: 180
         Date: Thu, 27 Apr 2006 16:45:25 GMT
         Server: Apache-Coyote/1.1

         <updates>
          <update address=quot;_id0:_id5:0:chatTextquot;>
           <span id=quot;_id0:_id5:0:chatTextquot;>Howdy</span>
          </update>
         </updates>




ICESOFT TECHNOLOGIES INC.                                         www.icefaces.org
ICEfaces
Preserve MVC with Transparent Ajax.

                 PageBean.java                    Page.xhtml

public class PageBean {            <f:view
   String message;                    xmlns:f=“http://java.sun.com/jsf/core”
                                      xmlns:h=quot;http://java.sun.com/jsf/html“ >
    public String getMessage() {
       return message;               <html>
    }                                  <body>
                                         <h:form>
    public void                             <h:inputText
    setMessage(String message) {               value=“#{pageBean.message}” />
       this.message = message;           </h:form>
    }                                  </body>
                                     </html>
}
                                   </f:view>

          Presentation Model               Declarative User Interface


     A language for Ajax Push that preserves Designer
        and Developer roles

ICESOFT TECHNOLOGIES INC.                              www.icefaces.org
More Case Studies and Demos

  • C3 Solutions
           – Yard Smart truck dock management system
           – Desktop and Mobile GUIs
           – Opera Mobile Browser, Win CE device




  • Taxi Dispatch Demo
           – Collaborative mobile application
           – iPhone



                 http://www.icefaces.org/main/demos/mobile-ajax.iface

ICESOFT TECHNOLOGIES INC.                                    www.icefaces.org
C3 Solutions Yard Smart Application




ICESOFT TECHNOLOGIES INC.              www.icefaces.org   26
Taxi Demo




ICESOFT TECHNOLOGIES INC.   www.icefaces.org   27
AuctionMonitor Mobile Chat




ICESOFT TECHNOLOGIES INC.     www.icefaces.org   28
Which Components for Mobile Devices?




ICESOFT TECHNOLOGIES INC.            www.icefaces.org   29
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
WebMC




ICESOFT TECHNOLOGIES INC.   www.icefaces.org   31
ICEfaces
High level push.


To update all users in the application:
 SessionRenderer.render(SessionRenderer.ALL_SESSIONS);

Or to keep track of groups of users:
 SessionRenderer.addCurrentSession(“chat”);

Asynchronously and elsewhere in the application ...
 message.setValue(“Howdy”);
 SessionRenderer.render(“chat”);


  The JSF lifecycle runs and each user’s page is updated
  from the component tree and current model state.


ICESOFT TECHNOLOGIES INC.                             www.icefaces.org
webmc.jspx

  <f:view xmlns:f=quot;http://java.sun.com/jsf/corequot;
           xmlns:h=quot;http://java.sun.com/jsf/htmlquot;>
  <html>
    <head> <title>WebMC</title> </head>
    <body>
      <h3>WebMC</h3>
      <h:form>
         <h:panelGrid columns=quot;1quot;>
           <h:outputText value=quot;Presentationquot;/>
           <h:graphicImage value=quot;#{user.slideURL}quot;/>
         </h:panelGrid>
         <h:panelGrid columns=quot;1quot; >
           <h:outputText value=quot;Chatquot;/>
           <h:outputText value=quot;#{user.chatLog}quot;/>
           <h:inputText value=quot;#{user.chatInput}quot;/>
           <h:commandButton actionListener=quot;#{user.submit}quot;/>
         </h:panelGrid>



ICESOFT TECHNOLOGIES INC.                          www.icefaces.org   33
UserBean.java
          public class UserBean {

                    public String getSlideURL() {
                        return slideURL;                Set by presentation
                                                        moderator slide controls
                    }

                    public String getChatLog() {
                        return chatLog;
                    }

                    public String getChatInput() {
                        return chatInput;
                    }

                    public void setChatInput(String text) {
                        chatInput = text;
                        append(chatLog, text);
                    }
          }

ICESOFT TECHNOLOGIES INC.                                      www.icefaces.org   34
UserBean.java (Ajax Push)

     import org.icefaces.x.core.push.SessionRenderer;

     public class UserBean {
         String presentationName;

               public UserBean() {
                   presentationName = LoginBean.getPresentationName();
                   SessionRenderer.addCurrentSession(presentationName);
               }

               public void submit() {
                   SessionRenderer.render(presentationName);
               }
     }




ICESOFT TECHNOLOGIES INC.                                 www.icefaces.org   35
Ajax Push API: RenderManager IntervalRenderer

                            public ClockBean() {
                                state = PersistentFacesState.getInstance();
                                AuctionBean.incrementUsers();
                            }

                            public void setRenderManager(RenderManager manager) {
                                if (manager != null) {
                                    clock = manager.getIntervalRenderer(“clock”);
                                    clock.setInterval(pollInterval);
                                    clock.add(this);
                                    clock.requestRender();
                                                            Ajax Push
                                }
                            }


                            public PersistentFacesState getState() {
                                return state;
                            }




ICESOFT TECHNOLOGIES INC.                                                www.icefaces.org   36
Ajax Push API: RenderManager IntervalRenderer



            public void renderingException(RenderingException renderingException) {
               if (renderingException instanceof FatalRenderingException) {
                    performCleanup();
                }
            }

            protected boolean performCleanup() {
                if (clock != null && clock.contains(this)) {
                    clock.remove(this);
                }
            }

            public void dispose() throws Exception {
                performCleanup();
            }




ICESOFT TECHNOLOGIES INC.                                      www.icefaces.org   37
Ajax Push API: RenderManager IntervalRenderer


               <managed-bean>
                   <managed-bean-name>rmanager</managed-bean-name>
                   <managed-bean-class>
                       com.icesoft.faces.async.render.RenderManager
                   </managed-bean-class>
                   <managed-bean-scope>application</managed-bean-scope>
               </managed-bean>

               <managed-bean>
                   <managed-bean-name>ClockBean</managed-bean-name>
                   <managed-bean-class>
                       com.icesoft.applications.faces.auctionMonitor.beans.ClockBean
                   </managed-bean-class>
                   <managed-bean-scope>request</managed-bean-scope>
                   <managed-property>
                       <property-name>renderManager</property-name>
                       <value>#{rmanager}</value>
                   </managed-property>
               </managed-bean>




ICESOFT TECHNOLOGIES INC.                                           www.icefaces.org   38
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
Native Mobile Applications

       • How does JSF for mobile devices compare with
         “native” mobile development

       • Only recently does iPhone SDK NDA allow discussion

       • Will your application be rejected by the App Store?

       • Code signing is tedious but automated

       • Development language is Objective C

       • Access to accelerometer, multi-touch, OpenGL
ICESOFT TECHNOLOGIES INC.                        www.icefaces.org   40
Agenda

       >      The Mobile Web
       >      Developing for Mobile and Desktop
       >      Mobile Push Demo
       >      Ajax Push
       >      Code Walkthrough
       >      Native Applications
       >      Conclusion




ICESOFT TECHNOLOGIES INC.                         www.icefaces.org
ICEfaces Mobile Roadmap

    • Core framework unchanged

    • Optimize Renderkit output – Bandwidth Reduction

    • Mobile Component Suite

    • Intermittent Network Connection Management
              – optimize heartbeat and connection sharing for low power
                and reduced bandwidth


    • Additional Mobile Browser Support


ICESOFT TECHNOLOGIES INC.                                   www.icefaces.org
Mobile Future (or alternate universe?)

       • Google Gears and HTML5 Client-side Database allow
         data to be stored offline
                 – but where is the application? Implemented in JavaScript?


       • Client-side Java would allow JSF on the device
                 – prohibited by iPhone SDK license
                 – this was one of the original ICEfaces design goals


       • The stack could be streamlined
                 –     client-side database online/offline aware
                 –     single user “Servlet” engine
                 –     no JSP
                 –     device loopback network


ICESOFT TECHNOLOGIES INC.                                          www.icefaces.org   43
Summary
The Mobile and Desktop Web are Unified

  > Standard browser capability will rapidly be commonplace

  > Ajax is essential for building streamlined user interfaces

  > JSF page modularity is an excellent approach for
    spanning the mobile and desktop web




ICESOFT TECHNOLOGIES INC.                      www.icefaces.org
Thank You




      Ted Goddard, Ph.D., Senior Architect
      ICEsoft Technologies Inc.
      TedGoddard@icesoft.com
      (403) 663-3322

      Join us at: www.icefaces.org




                             42,000


ICESOFT TECHNOLOGIES INC.                    www.icefaces.org

More Related Content

Similar to Ajax Push ICEfaces Ted Goddard

Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Jon Arne Sæterås
 
Developing the MIT Mobile Web
Developing the MIT Mobile WebDeveloping the MIT Mobile Web
Developing the MIT Mobile Webshu beta
 
SmartPhone Design and Delivery
SmartPhone Design and DeliverySmartPhone Design and Delivery
SmartPhone Design and DeliveryJason Diehl
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009sullis
 
Mobile html5 today
Mobile html5 todayMobile html5 today
Mobile html5 todayIdo Green
 
Mobile internet campaigns
Mobile internet campaignsMobile internet campaigns
Mobile internet campaignsReinoud Bosman
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Atos_Worldline
 
Skill Session - Web Multi Device
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Devicefilirom1
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...David Kaneda
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008Vando Batista
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App DevelopmentChris Morrell
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileTerry Ryan
 
V Legakis Presentation
V Legakis PresentationV Legakis Presentation
V Legakis PresentationVLegakis
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedpgt technology scouting GmbH
 

Similar to Ajax Push ICEfaces Ted Goddard (20)

Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013Mobile is slow - Over the Air 2013
Mobile is slow - Over the Air 2013
 
Developing the MIT Mobile Web
Developing the MIT Mobile WebDeveloping the MIT Mobile Web
Developing the MIT Mobile Web
 
SmartPhone Design and Delivery
SmartPhone Design and DeliverySmartPhone Design and Delivery
SmartPhone Design and Delivery
 
Ajax World Fall08
Ajax World Fall08Ajax World Fall08
Ajax World Fall08
 
ICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFishICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFish
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009
 
Mobile html5 today
Mobile html5 todayMobile html5 today
Mobile html5 today
 
Mobile internet campaigns
Mobile internet campaignsMobile internet campaigns
Mobile internet campaigns
 
Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...Responsive web design & mobile web development - a technical and business app...
Responsive web design & mobile web development - a technical and business app...
 
Skill Session - Web Multi Device
Skill Session - Web Multi DeviceSkill Session - Web Multi Device
Skill Session - Web Multi Device
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008"JavaME + Android in action" CCT-CEJUG Dezembro 2008
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery Mobile
 
V Legakis Presentation
V Legakis PresentationV Legakis Presentation
V Legakis Presentation
 
Javaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learnedJavaland 2014 / GWT architectures and lessons learned
Javaland 2014 / GWT architectures and lessons learned
 
Service worker API
Service worker APIService worker API
Service worker API
 
Mobile ux sot a and challenges
Mobile ux sot a and challengesMobile ux sot a and challenges
Mobile ux sot a and challenges
 
Mobile UX Challenges
Mobile UX ChallengesMobile UX Challenges
Mobile UX Challenges
 

More from rajivmordani

Web 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With JsfWeb 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With Jsfrajivmordani
 
X Aware Ajax World V1
X Aware Ajax World V1X Aware Ajax World V1
X Aware Ajax World V1rajivmordani
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
Tripit Ajaxworld V5
Tripit Ajaxworld V5Tripit Ajaxworld V5
Tripit Ajaxworld V5rajivmordani
 
Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081rajivmordani
 
Sue Googe Spice Up Ux
Sue Googe Spice Up UxSue Googe Spice Up Ux
Sue Googe Spice Up Uxrajivmordani
 
Social Networking Intranet
Social Networking IntranetSocial Networking Intranet
Social Networking Intranetrajivmordani
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svenssonrajivmordani
 
Server Side Javascript
Server Side JavascriptServer Side Javascript
Server Side Javascriptrajivmordani
 
Slow Cool 20081009 Final
Slow Cool 20081009 FinalSlow Cool 20081009 Final
Slow Cool 20081009 Finalrajivmordani
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax Wrajivmordani
 
I Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor FinalI Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor Finalrajivmordani
 
Netapp Michael Galpin
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpinrajivmordani
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008rajivmordani
 
Mike Grushin Developing Ugc Sites That Scale
Mike Grushin    Developing Ugc Sites That ScaleMike Grushin    Developing Ugc Sites That Scale
Mike Grushin Developing Ugc Sites That Scalerajivmordani
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1rajivmordani
 
Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockfordrajivmordani
 

More from rajivmordani (20)

Web 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With JsfWeb 2 0 Data Visualization With Jsf
Web 2 0 Data Visualization With Jsf
 
X Aware Ajax World V1
X Aware Ajax World V1X Aware Ajax World V1
X Aware Ajax World V1
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
Tripit Ajaxworld V5
Tripit Ajaxworld V5Tripit Ajaxworld V5
Tripit Ajaxworld V5
 
Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081Turbo Enterprise Web 2.0 Ajax World 20081
Turbo Enterprise Web 2.0 Ajax World 20081
 
Sue Googe Spice Up Ux
Sue Googe Spice Up UxSue Googe Spice Up Ux
Sue Googe Spice Up Ux
 
Social Networking Intranet
Social Networking IntranetSocial Networking Intranet
Social Networking Intranet
 
Ssjs Presentation
Ssjs PresentationSsjs Presentation
Ssjs Presentation
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
Server Side Javascript
Server Side JavascriptServer Side Javascript
Server Side Javascript
 
Ria Enterprise
Ria EnterpriseRia Enterprise
Ria Enterprise
 
Slow Cool 20081009 Final
Slow Cool 20081009 FinalSlow Cool 20081009 Final
Slow Cool 20081009 Final
 
Pushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax WPushing Datatothe Browserwith Comet Ajax W
Pushing Datatothe Browserwith Comet Ajax W
 
I Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor FinalI Phone Dev Summit Prezo Guy Naor Final
I Phone Dev Summit Prezo Guy Naor Final
 
Netapp Michael Galpin
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpin
 
Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008Laird Best Practices Ajax World West2008
Laird Best Practices Ajax World West2008
 
Mike Grushin Developing Ugc Sites That Scale
Mike Grushin    Developing Ugc Sites That ScaleMike Grushin    Developing Ugc Sites That Scale
Mike Grushin Developing Ugc Sites That Scale
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
 
Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockford
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[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.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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...apidays
 
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
 
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
 
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
 
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...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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 MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
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
 
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
 
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
 
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...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Ajax Push ICEfaces Ted Goddard

  • 1. iPhone Ajax Push With ICEfaces Ted Goddard, Ph.D. ICEsoft Technologies, Inc. ICESOFT TECHNOLOGIES INC. www.icefaces.org 1
  • 2. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 3. Where the Mobile Web Went Wrong • WAP – subset of XHTML, WAP 1.0 required “WAP gateway” • Should we have additional mobile web standards? – Focus on how the mobile web is different? • The iPhone browser succeeds because it is a desktop browser (on a small screen) • The iPhone initiated the convergence of the mobile web and the desktop web • The mobile web is not constrained by software ICESOFT TECHNOLOGIES INC. www.icefaces.org 3
  • 4. Actual Mobile Device Constraints • Hardware constraints – RAM, Persistent storage, CPU • Battery Power – The CPU may be fast, but cycles are still limited • Wireless Network Bandwidth, Latency, Connectivity – Application load time – Interaction delays – Loss of connectivity • UI Differences – Small screen – Touch or stylus based input – Cumbersome text input ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 5. Addressing the Constraints • Hardware Constraints – Small JavaScript implementation • Battery power – Delegate application execution to the server • Wireless Network Bandwidth, Latency, Connectivity – Small JavaScript shortens load time – Incremental page updates – Ajax Push can hide latency, simplify user interaction – Intermittent connectivity to be addressed • UI Differences – Simplify UI Controls and stylesheets – Modify the page according to input – Recommended list of controls ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 6. Suitable Mobile Browsers • “Modern” browsers are available on a number of platforms: • Safari/iPhone • RIM Browser/BlackBerry Bold • Opera Mobile/Windows Mobile (not Opera Mini) • Nokia Browser (Gecko)/N95 • Samsung Browser (WebKit)/Instinct • ?WebKit Browser/Android (works in simulator) ICESOFT TECHNOLOGIES INC. www.icefaces.org 6
  • 7. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 8. Developing for Mobile and Desktop • How much code re-use is possible? • Model (JavaBeans) can be completely shared • Most pages will work • But you want an insanely great mobile experience • Some things to avoid: – large images – clutter – drag and drop – list selection – scrolling • Help the user – use Ajax to present just relevant options ICESOFT TECHNOLOGIES INC. www.icefaces.org 8
  • 9. Browser detection public boolean isMobile() { HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance() .getExternalContext().getRequest(); String agent = request.getHeader(quot;user-agentquot;).toLowerCase(); if ((agent.indexOf(quot;safariquot;) != -1 && agent.indexOf(quot;mobilequot;) != -1) || (agent.indexOf(quot;operaquot;) != -1 && agent.indexOf(quot;240x320quot;) != -1)) { ! mobile = true; } return mobile; } ICESOFT TECHNOLOGIES INC. www.icefaces.org 9
  • 10. Avoiding Large Images • Scale images down for mobile users BufferedImage bdest = new BufferedImage((int)(ourWidth*aspectWidth), (int)(ourHeight*aspectHeight), BufferedImage.TYPE_INT_RGB); Graphics2D g = bdest.createGraphics(); AffineTransform at = AffineTransform.getScaleInstance(aspectWidth, aspectHeight); g.drawRenderedImage(bsrc, at); ImageIO.write(bdest, quot;JPGquot;, new File(“mobile”, imageName); • Scaled images are saved in an alternate directory • URL is adjusted for mobile users ICESOFT TECHNOLOGIES INC. www.icefaces.org 10
  • 11. Avoiding Clutter • Switch off decorative elements ... ICESOFT TECHNOLOGIES INC. www.icefaces.org 11
  • 12. Avoiding Clutter • ... for mobile users ICESOFT TECHNOLOGIES INC. www.icefaces.org 12
  • 13. Avoiding Clutter • Switch off decorative elements via rendered= <div class=quot;presentationDIVquot;> <ui:include src=quot;presentation.jspxquot;/> </div> <div class=quot;participantsChatDIVquot;> <ice:panelGroup rendered=quot;#{!participant.mobile}quot;> ! ! <img src=quot;resources/images/logo_reflection.jpgquot; /> ! ! <img src=quot;resources/images/part_tab.jpgquot;/> </ice:panelGroup> <ui:include src=quot;participants.jspxquot;/> <ui:include src=quot;popups.jspxquot; /> ! <ice:panelGroup rendered=quot;#{!participant.mobile}quot; ! style=quot;padding-top: 15px;quot;> ! <img src=quot;resources/images/chat_tab.gifquot;/> ! </ice:panelGroup> ! <ui:include src=quot;chat.jspxquot;/> </div> ICESOFT TECHNOLOGIES INC. www.icefaces.org 13
  • 14. Mobile UI Considerations • Dragging in Safari on the iPhone scrolls the page • Selection by dragging is difficult – prefer selection from a list rather than a drop-down menu • Pixels are limited – prefer simple interfaces without decoration ICESOFT TECHNOLOGIES INC. www.icefaces.org 14
  • 15. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 16. WebMC Demo ICESOFT TECHNOLOGIES INC. www.icefaces.org 16
  • 17. Avoiding Scrolling <meta name=quot;viewportquot; content=quot;width=480; initial-scale=1.0;maximum-scale=1.0;quot; /> width, height: size in pixels of the web page initial-scale, maximum-scale, minimum-scale, user-scalable scaling parameters symbolic constants are also available and preferred: device-width,device-height <meta name=quot;viewportquot; content=quot;width=device-widthquot; /> ICESOFT TECHNOLOGIES INC. www.icefaces.org 17
  • 18. Help the user • Incrementally present only relevant options ICESOFT TECHNOLOGIES INC. www.icefaces.org 18
  • 19. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 20. Server-mediated Collaboration External Application Server • User Initiated User Push Push Push Action • Application Initiated Micha Ted ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 21. Applications in the Participation Age 8 Application-mediated communication. > Distance learning > Collaborative authoring > Auctions > Shared WebDAV filesystem > Blogging and reader comments > SIP-coordinated mobile applications > Hybrid chat/email/discussion forums > Customer assistance on sales/support pages > Multi-step business process made collaborative > Shared trip planner or restaurant selector with maps > Shared calendar, “to do” list, project plan > Games > Enterprise shared record locking and negotiation ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 22. 18 Ajax Poll vs Ajax Push Bending the rules of HTTP. ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 23. Ajax Push HTTP message flow inversion. GET /auctionMonitor/block/receive-updates?icefacesID=1209765435 HTTP/1.1 Accept: */* Cookie: JSESSIONID=75CF2BF3E03F0F9C6D2E8EFE1A6884F4 Connection: keep-alive Host: vorlon.ice:18080 Chat message “Howdy” HTTP/1.1 200 OK Content-Type: text/xml;charset=UTF-8 Content-Length: 180 Date: Thu, 27 Apr 2006 16:45:25 GMT Server: Apache-Coyote/1.1 <updates> <update address=quot;_id0:_id5:0:chatTextquot;> <span id=quot;_id0:_id5:0:chatTextquot;>Howdy</span> </update> </updates> ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 24. ICEfaces Preserve MVC with Transparent Ajax. PageBean.java Page.xhtml public class PageBean { <f:view String message; xmlns:f=“http://java.sun.com/jsf/core” xmlns:h=quot;http://java.sun.com/jsf/html“ > public String getMessage() { return message; <html> } <body> <h:form> public void <h:inputText setMessage(String message) { value=“#{pageBean.message}” /> this.message = message; </h:form> } </body> </html> } </f:view> Presentation Model Declarative User Interface A language for Ajax Push that preserves Designer and Developer roles ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 25. More Case Studies and Demos • C3 Solutions – Yard Smart truck dock management system – Desktop and Mobile GUIs – Opera Mobile Browser, Win CE device • Taxi Dispatch Demo – Collaborative mobile application – iPhone http://www.icefaces.org/main/demos/mobile-ajax.iface ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 26. C3 Solutions Yard Smart Application ICESOFT TECHNOLOGIES INC. www.icefaces.org 26
  • 27. Taxi Demo ICESOFT TECHNOLOGIES INC. www.icefaces.org 27
  • 28. AuctionMonitor Mobile Chat ICESOFT TECHNOLOGIES INC. www.icefaces.org 28
  • 29. Which Components for Mobile Devices? ICESOFT TECHNOLOGIES INC. www.icefaces.org 29
  • 30. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 31. WebMC ICESOFT TECHNOLOGIES INC. www.icefaces.org 31
  • 32. ICEfaces High level push. To update all users in the application: SessionRenderer.render(SessionRenderer.ALL_SESSIONS); Or to keep track of groups of users: SessionRenderer.addCurrentSession(“chat”); Asynchronously and elsewhere in the application ... message.setValue(“Howdy”); SessionRenderer.render(“chat”); The JSF lifecycle runs and each user’s page is updated from the component tree and current model state. ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 33. webmc.jspx <f:view xmlns:f=quot;http://java.sun.com/jsf/corequot; xmlns:h=quot;http://java.sun.com/jsf/htmlquot;> <html> <head> <title>WebMC</title> </head> <body> <h3>WebMC</h3> <h:form> <h:panelGrid columns=quot;1quot;> <h:outputText value=quot;Presentationquot;/> <h:graphicImage value=quot;#{user.slideURL}quot;/> </h:panelGrid> <h:panelGrid columns=quot;1quot; > <h:outputText value=quot;Chatquot;/> <h:outputText value=quot;#{user.chatLog}quot;/> <h:inputText value=quot;#{user.chatInput}quot;/> <h:commandButton actionListener=quot;#{user.submit}quot;/> </h:panelGrid> ICESOFT TECHNOLOGIES INC. www.icefaces.org 33
  • 34. UserBean.java public class UserBean { public String getSlideURL() { return slideURL; Set by presentation moderator slide controls } public String getChatLog() { return chatLog; } public String getChatInput() { return chatInput; } public void setChatInput(String text) { chatInput = text; append(chatLog, text); } } ICESOFT TECHNOLOGIES INC. www.icefaces.org 34
  • 35. UserBean.java (Ajax Push) import org.icefaces.x.core.push.SessionRenderer; public class UserBean { String presentationName; public UserBean() { presentationName = LoginBean.getPresentationName(); SessionRenderer.addCurrentSession(presentationName); } public void submit() { SessionRenderer.render(presentationName); } } ICESOFT TECHNOLOGIES INC. www.icefaces.org 35
  • 36. Ajax Push API: RenderManager IntervalRenderer public ClockBean() { state = PersistentFacesState.getInstance(); AuctionBean.incrementUsers(); } public void setRenderManager(RenderManager manager) { if (manager != null) { clock = manager.getIntervalRenderer(“clock”); clock.setInterval(pollInterval); clock.add(this); clock.requestRender(); Ajax Push } } public PersistentFacesState getState() { return state; } ICESOFT TECHNOLOGIES INC. www.icefaces.org 36
  • 37. Ajax Push API: RenderManager IntervalRenderer public void renderingException(RenderingException renderingException) { if (renderingException instanceof FatalRenderingException) { performCleanup(); } } protected boolean performCleanup() { if (clock != null && clock.contains(this)) { clock.remove(this); } } public void dispose() throws Exception { performCleanup(); } ICESOFT TECHNOLOGIES INC. www.icefaces.org 37
  • 38. Ajax Push API: RenderManager IntervalRenderer <managed-bean> <managed-bean-name>rmanager</managed-bean-name> <managed-bean-class> com.icesoft.faces.async.render.RenderManager </managed-bean-class> <managed-bean-scope>application</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>ClockBean</managed-bean-name> <managed-bean-class> com.icesoft.applications.faces.auctionMonitor.beans.ClockBean </managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>renderManager</property-name> <value>#{rmanager}</value> </managed-property> </managed-bean> ICESOFT TECHNOLOGIES INC. www.icefaces.org 38
  • 39. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 40. Native Mobile Applications • How does JSF for mobile devices compare with “native” mobile development • Only recently does iPhone SDK NDA allow discussion • Will your application be rejected by the App Store? • Code signing is tedious but automated • Development language is Objective C • Access to accelerometer, multi-touch, OpenGL ICESOFT TECHNOLOGIES INC. www.icefaces.org 40
  • 41. Agenda > The Mobile Web > Developing for Mobile and Desktop > Mobile Push Demo > Ajax Push > Code Walkthrough > Native Applications > Conclusion ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 42. ICEfaces Mobile Roadmap • Core framework unchanged • Optimize Renderkit output – Bandwidth Reduction • Mobile Component Suite • Intermittent Network Connection Management – optimize heartbeat and connection sharing for low power and reduced bandwidth • Additional Mobile Browser Support ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 43. Mobile Future (or alternate universe?) • Google Gears and HTML5 Client-side Database allow data to be stored offline – but where is the application? Implemented in JavaScript? • Client-side Java would allow JSF on the device – prohibited by iPhone SDK license – this was one of the original ICEfaces design goals • The stack could be streamlined – client-side database online/offline aware – single user “Servlet” engine – no JSP – device loopback network ICESOFT TECHNOLOGIES INC. www.icefaces.org 43
  • 44. Summary The Mobile and Desktop Web are Unified > Standard browser capability will rapidly be commonplace > Ajax is essential for building streamlined user interfaces > JSF page modularity is an excellent approach for spanning the mobile and desktop web ICESOFT TECHNOLOGIES INC. www.icefaces.org
  • 45. Thank You Ted Goddard, Ph.D., Senior Architect ICEsoft Technologies Inc. TedGoddard@icesoft.com (403) 663-3322 Join us at: www.icefaces.org 42,000 ICESOFT TECHNOLOGIES INC. www.icefaces.org