Developing applications using Embedded Rich Client Platform (eRCP)


Published on

A quick introduction to eRCP development. Presented on EclipseCon 2008

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Unlike Workbench in RCP where applications are standalone applications. eWorkbench ensures that the UI is shared between multiple applications through their views.
  • A bundle Activator is a class implementing an org.osgi.framework.BundleActivator interface for the created plug-in. Plug-ins should implement this interface if they use or provide OSGi-specific functionality. If you are using an eclipse development environment earlier than 3.4 execution environment selection is not part of the Plug-in Project creation wizard. In this case edit the file of your plug-in and add the execution environments required by the plug-in in the Execution Environments pane of the Overview tab of the manifest editor. The environments are CDC-1.1/Foundation 1.1 and OSGi/Minimum 1.1.
  • Developing applications using Embedded Rich Client Platform (eRCP)

    1. 1. Developing applications using Embedded Rich Client Platform (eRCP) Gorkem Ercan, Nokia, Finland Deeptendu Majumder, Nokia, USA
    2. 2. Agenda <ul><li>Introduction to eRCP </li></ul><ul><li>Introduction to eSWT </li></ul><ul><li>Creating an eWorkbench application </li></ul><ul><li>Deploying to a real device </li></ul><ul><li>Advanced eRCP example </li></ul>
    3. 3. What is eRCP <ul><li>eRCP is the embedded version of the Rich Client Platform </li></ul><ul><li>Project was launched by Nokia, IBM and Motorola </li></ul><ul><li>Utilizes standard OSGi Service Platform </li></ul><ul><li>Reduces RCP size and functionality to fit on devices </li></ul><ul><li>Pushes requirements/patches back to core components </li></ul><ul><ul><li>Enable running core components on JME CDC/Foundation Profile </li></ul></ul><ul><ul><li>Keep dependencies in check </li></ul></ul><ul><li>Adds components to enable application binary compatibility across a range of devices </li></ul>
    4. 4. Architecture <ul><li>OSGi underpinnings </li></ul><ul><li>Applications and services run in the same JVM instance </li></ul><ul><li>eRCP applications can launched from a workbench or be integrated into the native desktop </li></ul><ul><li>Deployable to a range of devices </li></ul><ul><ul><li>Desktops, cell phones, handhelds, internet tablets etc. </li></ul></ul><ul><ul><li>eRCP applications can also run on RCP </li></ul></ul><ul><li>It is also possible to have stand-alone eSWT applications and MIDlets </li></ul>
    5. 5. Parts of eRCP <ul><li>eWorkbench: Responsible for managing the GUI thread and provides the main “container” for application views that are created by eRCP applications. </li></ul><ul><li>eSWT: Embedded Standard Widget Toolkit. This is the embedded version of the SWT found in (RCP). </li></ul><ul><li>eJFace: Provides a set of ready-to-use complex graphical components on top of eSWT, makes the development of sophisticated UI applications easier. </li></ul><ul><li>Core Runtime: Built around OSGi framework, provides extension point framework. </li></ul><ul><li>eUpdate: Provides the capability to download, install, and update eRCP software as Eclipse features. </li></ul>
    6. 6. Relating eRCP to RCP
    7. 7. Introduction to eSWT <ul><li>Subset of SWT and additional mobile specific widgets </li></ul><ul><li>Provides efficient, portable access to the user interface facilities of the operating system </li></ul><ul><li>Consists of 3 packages </li></ul><ul><ul><li>SWT subset divided into two </li></ul></ul><ul><ul><ul><li>core package </li></ul></ul></ul><ul><ul><ul><li>expanded package </li></ul></ul></ul><ul><ul><li>mobile package - new eSWT components defined for mobile world </li></ul></ul>
    8. 8. eSWT API
    9. 9. How does SWT widgets look on a device
    10. 10. Mobile extensions - MobileShell <ul><li>A device tailored Shell that can change the trimmings dynamically </li></ul><ul><ul><li>Top-level shell </li></ul></ul><ul><ul><li>Full screen mode </li></ul></ul><ul><ul><li>Allows key press polling </li></ul></ul><ul><li>Introduces status pane styles </li></ul><ul><ul><li>NO_STATUS_PANE </li></ul></ul><ul><ul><li>SMALL_STATUS_PANE </li></ul></ul><ul><ul><li>LARGE_STATUS_PANE </li></ul></ul>
    11. 11. Mobile extensions - Basic controls <ul><li>ConstrainedText </li></ul><ul><li>DateEditor </li></ul><ul><li>HyperLink </li></ul><ul><li>TextExtension </li></ul><ul><li>CaptionedControl </li></ul><ul><li>SortedList </li></ul><ul><li>TaskTip </li></ul><ul><ul><li>Suitable for providing info on long running tasks </li></ul></ul><ul><ul><li>Text and optional ProgressBar </li></ul></ul>
    12. 12. Mobile extensions - Advanced Controls <ul><li>ListBox : A list control with enhanced capabilities to display icons </li></ul><ul><li>ListView : Selectable control that can display items in a multi-column way </li></ul><ul><li>MultipageDialog : A tabbed dialog </li></ul>
    13. 13. Mobile Extensions – Dialogs <ul><li>QueryDialog: Several query types </li></ul><ul><ul><li>STANDARD: alphanumeric input </li></ul></ul><ul><ul><li>NUMERIC </li></ul></ul><ul><ul><li>TIME </li></ul></ul><ul><ul><li>DATE </li></ul></ul><ul><ul><li>PASSWORD </li></ul></ul><ul><li>TimedMessageBox: </li></ul><ul><ul><li>4 Different system Icons (working, information, warning, error ) </li></ul></ul><ul><ul><li>Icons can be replaced </li></ul></ul>
    14. 14. Mobile Extensions – Commands <ul><li>Maps to a specific mechanism depending upon device capabilities </li></ul><ul><li>Has logical types that are typically mapped to Soft keys (GENERAL, SELECT, OK, CANCEL, DELETE, BACK, EXIT, STOP, HELP) </li></ul><ul><ul><li>COMMANDGROUP can contain other sub-commands </li></ul></ul><ul><ul><li>S60 implementation maps DELETE commands to ‘C’ clear key. </li></ul></ul><ul><li>Bound to focus context </li></ul>
    15. 15. Mobile Extensions – MobileDevice, Screen & Input <ul><li>MobileDevice </li></ul><ul><ul><li>Discover device capabilities and characteristics </li></ul></ul><ul><ul><li>Register listeners for changes in input, screen capabilities </li></ul></ul><ul><li>Screen </li></ul><ul><ul><li>Query the capabilities of the screen(s) </li></ul></ul><ul><li>Input </li></ul><ul><ul><li>Determine input device capabilities </li></ul></ul>
    16. 16. Tips: Building mobile applications using eSWT <ul><li>Do not rely on Shell trimmings some platforms do not support trimmings like SWT.CLOSE </li></ul><ul><li>Do not use deep menu hierarchies. </li></ul><ul><li>Use Commands in relation with the focus context to avoid the soft keys getting crowded </li></ul><ul><li>Use MobileDevice, Screen, and Input to adjust the behavior at runtime </li></ul><ul><ul><li>Active screens, active input methods may change </li></ul></ul><ul><li>Use layout managers </li></ul><ul><li>Check the computed layout size and add scrollbars if greater than screen size </li></ul><ul><li>Tailor your application according to aspect ratios </li></ul>
    17. 17. Right input widget is VERY important
    18. 18. Using eSWT with Java ME Midlets <ul><li>Java ME MIDP is the most common computing platform </li></ul><ul><ul><li>700+ million java enabled phones </li></ul></ul><ul><ul><li>635+ java enabled phone models from 35+ vendors </li></ul></ul><ul><li>Alternate UI toolkit for Java ME applications </li></ul><ul><li>Available on all Nokia S60 3 rd Ed. FP2 devices </li></ul>
    19. 19. Using eSWT with a JavaME Midlets <ul><li>Required Software </li></ul><ul><ul><li>Eclipse IDE </li></ul></ul><ul><ul><li>EclipseME plug-in ( </li></ul></ul><ul><ul><li>Nokia S60 3.2 SDK ( </li></ul></ul><ul><li>HelloWorld Midlet available in eRCP project’s wiki </li></ul><ul><ul><li> </li></ul></ul><ul><li>You can use NetBeans as well ?? </li></ul>
    20. 20. eWorkbench <ul><li>Provides the main “container” for application views that are created by eRCP applications </li></ul><ul><li>Responsible for managing the UI thread </li></ul><ul><li>Applications and services run in the same JVM instance </li></ul><ul><ul><li>Fewer resources than separate JVMs </li></ul></ul><ul><ul><li>Allows sharing of services </li></ul></ul><ul><ul><li>Enables variety of life cycle models </li></ul></ul><ul><li>eRCP applications are created as Eclipse plug-ins for the eWorkbench </li></ul>
    21. 21. Adding applications to eWorkbench <ul><li>Plug-ins intended to run in the eWorkbench are required to contribute extensions towards the following extension points </li></ul><ul><li>org.eclipse.ui.views </li></ul><ul><ul><li>This extension point allows applications to provide their views </li></ul></ul><ul><li>org.eclipse.ercp.eworkbench.applications </li></ul><ul><ul><li>Introduces applications to eWorkbench </li></ul></ul><ul><ul><li>To accommodate with devices with multiple displays, it can have three types of views – Normal, Large and Status. Only the Normal view is required. Each view type is defined into separate view element </li></ul></ul>
    22. 22. Required development tools <ul><li>Eclipse 3.3 or later with Plug-in development environment (PDE) </li></ul><ul><ul><li> </li></ul></ul><ul><li>eRCP distribution for Windows Desktop </li></ul><ul><ul><li> </li></ul></ul><ul><li>And a java runtime </li></ul><ul><ul><li> </li></ul></ul>
    23. 23. Setting up Eclipse PDE for eRCP development <ul><li>Unzip eRCP distribution for Windows Desktop </li></ul><ul><li>Set Plug-in Development target platform to be eRCP </li></ul><ul><ul><li>Window -> Preferences </li></ul></ul><ul><ul><li>expand the Plug-in Development node and choose the Target Platform sub-node </li></ul></ul><ul><ul><li>In the Location field, specify the <ercp_installation_dir>win32eRCP directory </li></ul></ul>
    24. 24. HelloWorld eWorkbench application (1) <ul><li>Create a plug-in project </li></ul><ul><ul><li>Call File -> New -> Project and choose the Plug-in Project </li></ul></ul><ul><ul><li>A bundle Activator is not needed for this plug-in unselect it. </li></ul></ul><ul><ul><li>Select the execution environment as OSGi Minimum 1.1 (available in wizard only after 3.4) </li></ul></ul><ul><ul><li>Select Finish. </li></ul></ul><ul><li>Add required dependencies </li></ul><ul><ul><li>org.eclipse.core.runtime </li></ul></ul><ul><ul><li>org.eclipse.ui </li></ul></ul><ul><ul><li>org.eclipse.ercp.eworkbench </li></ul></ul>
    25. 25. HelloWorld eWorkbench application (2) <ul><li>Create org.eclipse.ui.views </li></ul><ul><ul><li>Add from the Extensions tab select the org.eclipse.ui.views </li></ul></ul><ul><ul><li>To add a view right click on the org.eclipse.ui.views extension point and choose New -> view from the menu that appears </li></ul></ul><ul><ul><li>Create a new class that extends org.eclipse.ui.part.ViewPart </li></ul></ul><ul><li>Extend org.eclipse.ercp.eworkbench.applications </li></ul><ul><ul><li>add this extension point similar to above step </li></ul></ul><ul><ul><li>Fill in the properties of the application and views elements </li></ul></ul>
    26. 26. Testing the HelloWorld <ul><li>Call Run->Run Configurations </li></ul><ul><li>Create a new Eclipse Application configuration </li></ul><ul><li>Choose org.eclipse.ercp.eworkbench.eWorkbench for Run an Application option </li></ul>
    27. 27. Deploying to Device <ul><li>Features and deployment via update sites is supported by all target environments </li></ul><ul><li>Create a feature </li></ul><ul><ul><li>File ->New -> Project -> Feature Project </li></ul></ul><ul><ul><li>Select your plug-in </li></ul></ul><ul><li>Create update site </li></ul><ul><ul><li>File ->New -> Project -> Update Site Project </li></ul></ul><ul><ul><li>Add your feature </li></ul></ul>
    28. 28. Conclusion <ul><li>eRCP brings the RCP paradigm to mobile devices </li></ul><ul><li>Website </li></ul><ul><ul><li> </li></ul></ul><ul><li>Newsgroups </li></ul><ul><ul><li>news:// </li></ul></ul><ul><li>Always looking for contributors! </li></ul>