SlideShare a Scribd company logo
iLabs mobile toolbox:  Java ME applications without intolerable pain. Content is available under  Creative Commons, Attribution 3.0 license Describes version 0.53b of the toolkit
iLabs Research project at Telenor R&I Three year funding, 1 year left. Focus: How to develop new forms of collaboration through open source. Method: Get dirty Real open source project: ilabs mobile toolbox Be analytical Think about both concrete and abstract issues. Report to everyone Top management, peers, nerds, suits, ..
Speakers Bjørn Remseth. Cand. Scient. Research scientist at Telenor Research & Innovation.   Bjørn has more than twenty years of  experience as a sysadmin, developer, systems architect and research scientist. Stian Børresen MSc. Ten years experience  in 3D graphics, web, mobile and rich client development. He is currently working as a consultant specializing in mobile application development using java. Else Nordhagen.  Dr. Scient. Research Scientist at Telenor Research & Innovation. More than thirty years of experience with object oriented design and implementation, 3D graphics, theoretical computer science and GUI design (from Smalltalk in  the  late seventies, to JME today).
Outline of this talk: Why  we are doing this, history so far,  design goals. ” Hello GUI” –  simple example application A tiny bit of detail: Important classes and object structures “ Application style” examples OpenMiniChatter – XMPP chat OpenMiniBlogger – blog to blogger /blogspot. OpenMiniBrowser – simple HTML rendering “ Widget style” example A Twitter client. Links and contact info Questions
Why iLabs Toolbox? Øystein Myhre (original author)  with project manager Hilde Lovett En early facebook/gtalk client. We like mobile applications, would like to have more, but they painful to write, so we would like to: Make it  easy :  Remove stupid technical barriers. Be inspiring :  Facilitate and motivate the production of useful mobile services. Current core developers
In short It should be as simple to write an app that works on a mobile phone as it is to make content for the web We’re not quite there yet ;)
History so far: Telenor R&I had several closed source  Social Networking example applications written in JME. First open source release June 07, second massively reworked release  in March 2008.  Bimonthly release cycle (java.net, freshmeat, sourceforge).  August 08: 0.52 U sed by iLabs and some other projects, e.g. Facebook client at the University of Colorado Green touch, application at the Oslo  School of Architecture Vaccination registration application for  HISP,  developed at the Informatics Department at  U niv. Of Oslo WellCom controlling set top boxes from your phone developed at Telenor R&I  in a EUREKA project.
Java  versions
Design goals: Hide heterogeneity of devices One binary per application (no conditional compilation!) Remove common JME pitfalls. Screen handling (Forms, Canvas) Event handling (Buttons, Menus) Simplify layout control of subwindows Simplify drawing of text, pictures etc. Adding  real  menus, tabbed views etc. Do not require an external proxy Leverage existing code for HTML ,  XMPP, ATOMS, Blogger...   !Challenged!
Development model Main license : Lesser Gnu Public License (LGPL) To allow derivative works. Contributors : 2-3 full time developers internally in Telenor R&I Handful contributors worldwide. Openness : We accept anything that is remotely useful. If we ever get to the point where we have to reject something, we will start rejecting things but we are not there yet. Subversion repository : Used religiously. Java coding standard/checkstyle : Used but with some lapses. Issue tracker :  Read continously by developers.  Telenor team decides what is  done by Telenor team. Everyone else decides what they do. Scholarships : We do scholarships. Talk to us if you have a cool project and you are a student. ;)
Example 1: How to make your own app (HelloGUI1). public   final class  HelloGUI  extends  AbstractIlabsMIDlet  { public  HelloGUI() { } public   void initialize() {    ApplicationView view =  new   ApplicationView("Hello GUI!"); setCanvas(  new   ViewCanvas(getDisplay(),view));   view.setRightSoftbuttonAction( new  ExitAction("Exit")); getCanvas().show(); } } Create a new midlet by subclassing  AbstractILabsMidlet   Override method “ initialize”  in your midlet Set up your main view, and a canvas to draw on.  Add  menu items (Action instances) if any. Show the canvas That wasn’t very painful was it?
Example 2: (HelloGui3):
class  HelloGUI3  extends AbstractILabsMidlet  public final  void  initialize() { ApplicationView view = new ApplicationView("Hello GUI 3!"); view.addMenuItem(new ShowSelection("Item 1")); view.addMenuItem(new ShowSelection("Item 2")); view.addMenuItem(new ShowSelection("Item 3")); view.addMenuItem(new ShowSelection("Item 4")); view.setRightSoftbuttonAction(new ExitAction("Exit")); setCanvas(new ViewCanvas(getDisplay(), view)); getCanvas().show(); } User provided Built in
Action that change Canvas: class  ShowSelection  extends  DisplayChangeAction { ShowSelection( final  String label) {  super(label); } protected   void  onExecute() { final  Alert alert = new  Alert("Hello GUI3 alert", "You selected : " + getLabel(), null, AlertType.INFO); alert.setTimeout(Alert.FOREVER); setCurrent(alert, getCanvas()); } }
Boilerplate to get things going: /** * Creates a new instance of HelloGUI3. */ public  HelloGUI3() { }
Important concepts (abstract) Graphics item  – Something that can be drawn. (interface) InputHandler  – Something that interprets user  input . View  – Something  on the screen that can respond to User input.  Often hierarchical.  Often both GraphicsItem and InputHandler. Action  – Command pattern that does something
HelloGUI3, hierarchical decomposition ApplicationView Title B ar MenuView PopUpMenu Clock Action 4 Action 3 Action 2 Action 1 SimpleList View
Example 3: OpenMiniChatter A Google Talk client Introducing features: Menus Forms Username /Password Tabbed view Switching between chats HtmlView  for chat content XMPP  Network protocol XML parsing:  MarkupReader - a pull parser MarkupElement - creates an object structure Persistent storage, simple extention to JME Cool
OpenMiniChatter – dry run:
OpenMiniChatter - dry run  - use of TabView
Example 4: OpenMiniBlogger General  components + Feed protocol Used towards {Blogger,blogspot}.com Phone-specific browser extension:  Camera input plugin XML parsing:  MarkupReader - a pull parser MarkupElement - creates an object structure Persistent storage, simple extention to JME Error handling mechanism that avoid the need to create ”millions” of different types of exception classes. URL encoding and parsing …  Cool
Blogger – dry run
What the HTML renderer sees < form   action =“&quot;  id =&quot;cameraform&quot;  method =&quot;post&quot;  enctype =&quot;multipart/form-data&quot;> < object   name =&quot;image_file&quot;  classid = &quot;clsid:1b9982cf-4be8-42dd-9599-d0f6786d128d&quot;    width =&quot;60&quot;    height =&quot;80&quot;> </ object > < input   type =&quot;submit&quot;  name =&quot;update&quot;  value =&quot;Update&quot;/> </ form >   What you see Live camera view
Blogger –  upload and view:
Example 4: OpenMiniBrowser Fast Simple Simple Html rendering No  css tables scripting But with  Forms cookies With extensions..
Example 4: OpenMiniBrowser public void  initialize()  { mView  =  new  ApplicationView(&quot;Open Minibrowser&quot;); mCanvas  =  new  ViewCanvas(Display.getDisplay(this), mView); mHtmlView  =  new  HtmlView(this);  mView.setMainAreaView(mHtmlView); mHtmlView.setMargins(2, Font.getDefaultFont().charWidth(' ')); mView.addMenuItem(new OpenURLAction(mHtmlView, mHomePage, &quot;Home&quot;)); mView.addMenuItem(new EnterURLAction(mHtmlView, &quot;Open url&quot;)); mView.addMenuItem(new BackUrlAction(mHtmlView, &quot;Back&quot;)); mView.addMenuItem(new ExitAction(&quot;Exit&quot;)); //a clock, displaying hours and seconds. mClock = new Clock(System.currentTimeMillis(), false); mView.addClock(mClock); mView.layout(0, 0, mCanvas.getWidth(), mCanvas.getHeight()); mCanvas.show(); // Start a timer, update the clock once every minute. final Timer timer = new Timer(); timer.scheduleAtFixedRate(new ClockTask(),  MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MINUTE); mHtmlView.open(mHomePage); }
Lessons so far
Lesson I: It’s not that hard to write useful, portable JME programs anymore ;) Most layout code in our demo programs end up being based on HTML, even when we’re not really doing web browsing. But we can make it even easier:
Where we started - where we ended up: Plain JME programming Social Networking : easiest to render HTML content from others HTML : also used to make the user interface AHA: nice, UI just like the web :-) => Server side scripting as mobile programming method. Enabling developer to make their own mobile applications without writing JME JME app. .jad&.jar UI elements .html
J2ME programs vs. server side XML xml & html J2ME App. J2ME Widger App. App. App. Widgets J2ME App. J2ME App. .jad and .jar files .jad&.jar
WIDGER: Widlets through markup  A  Widger   (an application)  that runs runs  Widlets (pieces of functionality living in the widger sandbox) that holds  Views  (showing some kind of content) that have  Actions  (that makes  things happen).  Documentation :  http:// demo.ilabs.no/widgerdoc/index.php
UngWeb in  Møre og Romsdal  Fylkeskommune
UngeWeb: Widlet for ONE news item:
XML for widlet for one news item: <? xml  version = &quot;1.0&quot;  encoding = &quot;windows-1252&quot; ?> < widlet  ver = &quot;0.2&quot;  id = ”tabbednyhet&quot; > < view  type = &quot;tabs&quot;   id = &quot;main&quot; > < view  type = &quot;panel&quot;   id = &quot;panel1&quot;  title = &quot;Nyhet 1&quot;  icon = &quot;/img/FolderExplorer.png&quot;  show = &quot;true&quot; > < view  type = &quot;web&quot;   id = &quot;web1&quot;  url = &quot;nyhet1.html&quot; ></ view > < action  type = &quot;loadiwg&quot;  label = &quot;Nyheter&quot;  url = &quot;nyheter.iwg&quot;  button = &quot;right&quot; /> </ view > < view  type = &quot;panel&quot;   id = &quot;panel2&quot;  title = &quot;Kommentarer&quot;  icon = &quot;resource://FolderExplorer.png&quot; > < view  type = &quot;web&quot;   id = &quot;web2&quot;  url = &quot;nyhet1_kommentarer.html&quot; ></ view > < action  type = &quot;reloadurl&quot;  label = &quot;Oppdater&quot;  for = &quot;web2&quot;  /> < action  type = &quot;loadiwg&quot;  label = &quot;Nyheter&quot;  url = &quot;nyheter.iwg&quot;  button = &quot;right&quot; /> </ view > < view  type = &quot;panel&quot;   id = &quot;panel3&quot;  title = &quot;Skriv selv&quot;  icon = &quot;resource://BlogView.png&quot; > < view  type = &quot;web&quot;   id = &quot;web3&quot;  url = &quot;nyhet1_skrivSelv.html&quot; ></ view > < action  type = &quot;loadiwg&quot;  label = &quot;Nyheter&quot;  url = &quot;nyheter.iwg&quot;  button = &quot;right&quot; /> </ view > </ view > </ widlet >
Integrate with authoring tools: UngWeb Edit with eZ publish Generates HTML and .iwg Widger
Lesson II: Supporting protocols is  hard Protocol code is  painful and error prone to write in JME,  e.g. HTTPS :-( FaceBook, Twitter, FEIDE (ID login), ... Protocols change over time Workaround: exernal proxies that offload complexity Proxy Widger The service server
Two servers and one client: The Twitter Server Widger/Twitter adapter  (in example  demo running on an  iLabs server) Widger running the Twitter Widlet
Widget Twitter dry run: Server side login and formatting using forms and simple html. In this case all pages are created on our server, not twitter s . Saves bytes  and  fixes problems with phone heterogeneity and weaknesses.
Server-side scripting: Advantages and Disadvantages: Advantages Shorter development time Simpler client programs handles more phones smaller faster No need to download & install application again when updating service. Less network traffic on client due to tailored content on your server Better tools on server side for program development than JME... Easy to upgrade application Disadvantages You need a server .. that scales Need to handle security issues on the server Limited functionality on widger, today, but you can always extend it since it is open source  
WIDGER: Widgets through markup  A  Widger   (an application)  that runs  Widgets (pieces of functionality living in the widger sandbox) that holds  Views  (showing some kind of content) that have  Actions  (that makes  things happen).  Documentation :  http://demo.ilabs.no/widgerdoc/index.php
Example 5: Browser Widget : <?xml  version=&quot;1.0&quot; encoding =&quot; windows-1252&quot; ?> <widget  ver=&quot;0.2&quot; id=&quot;httpwidget&quot; >  <view  id=&quot;mainview&quot; type=&quot;application&quot; >    <titlebar  title=&quot;Http widget&quot; />    <subview  type=&quot;web&quot; id=&quot;web1&quot;    url=&quot;resource://widgets/httpwidgetindex.html&quot; > </subview>    <action  type=&quot;openurl&quot; label=&quot;Home&quot;  url=&quot;resource://widgets/httpwidgetindex.html&quot;for=&quot;web1&quot; />    <action  type=&quot;enterurl&quot; label=&quot;Open url...&quot;  for=&quot;web1&quot; />    <action  type=&quot;backurl&quot; label=&quot;Back&quot; for=&quot;web1&quot;  button=&quot;right&quot; />    <action  type=&quot;exit&quot; label=&quot;Exit&quot; />    </view> </widget>  Browser specific actions, built into widger Default exit action
Result: v.s: Just another widget Hand crafted  JME application
Example 6: The Twitter Widget
Two servers and one client: Twitter Widget  (in Widger) Widger/Twitter adapter  (in example  demo running on an  iLabs server) Twitter server
Widget Twitter client: <widget> < view  name =&quot;twitterview&quot;   type =&quot;appview&quot; > <titlebar  title=&quot;TwitterME&quot;   bordercolor=&quot;#000000&quot;   bgcolor = &quot;#94E4E8&quot;  textcolor = &quot;#ffffff&quot;/> <view  type =&quot;web&quot;  name =&quot;web1&quot;  url =” [...] /twitterlogin.html&quot;> </view> <action  type =&quot;exit&quot;  label =&quot;Exit&quot;/> </view> </widget> [...] == long url
Widget Twitter client: < widget  ver=&quot;0.2&quot; id=&quot;twitter&quot;>     < view  type=&quot;application&quot; id=&quot;main&quot;>         < titlebar  title=&quot;TwitterME&quot;  …         < subview  type=&quot;web&quot; name=&quot;web1&quot; url=&quot;resource://widgets/twitterlogin.html&quot;> </ subview >        < action  type=&quot;loadiwg&quot;  label=&quot;Widgets&quot; url=&quot;resource://widgets/masterwidget.iwg&quot;/>         < action  type=&quot;exit&quot; label=&quot;Exit&quot;/>      </ view > </ widget >   Colors removed
twitterlogin.html  (Plain old  HTML, no surprises): <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>  <html>  <head> <title>Twitter</title>  <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;> </head> <body> <p><img src=&quot;twitter.png&quot;/></p> <form action=&quot;http://demo.ilabs.no/test/widgets/twitter/twitter.php&quot; id=&quot;signinform&quot; method=&quot;post&quot;> <p><b>Username:</b><br> <input name=&quot;username&quot; type=&quot;text&quot; title=&quot;Enter username&quot; value=&quot;&quot; /> </p> <p> <b>Password:</b><br> <input type='password' name=&quot;pwd&quot; title=&quot;Enter password&quot; value=&quot;&quot; /> </p> <p> <input type=&quot;submit&quot; name=&quot;signin&quot; value=&quot;signin&quot; /> </p> <p><center><img src=&quot;/widger/img/twitterbird.png&quot;/></center></p> <p>Twitter is a service for friends, family, and co-workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?</p> </form> </body> </html>  Nothing exiting happening here please move on
twitterME user interface  (Plain old  HTML,  one  small surprise): <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;> <html>  … <textarea name=&quot;status&quot;></textarea> <!-- <INPUT TYPE=&quot;file&quot; name=&quot;image_file&quot; id=&quot;image_file&quot;/> -->  <object name=&quot;image_file&quot; classid=&quot;clsid:1b9982cf-4be8-42dd-9599-d0f6786d128d&quot; width=&quot;60&quot; height=&quot;80&quot;> </object> <input type=&quot;submit&quot; name=&quot;update&quot; value=&quot;Update&quot;/> </form> <hr> </p> <h3>Showing the latest private posts</h3><hr> <p><img src=&quot;http://s3.amazonaws.com/twitter_production/profile_images/55933057/cnn.twitter_normal.gif&quot;/><b>cnnbrk : </b><br>Embattled … Camera input
Widget Twitter dry run: Server side login and formatting using forms and simple html. In this case all pages are created on our server, not twitter s . Saves bytes  and  fixes problems with phone heterogeneity and weaknesses.
Where we are now.. And where to go.. It works! on a lot of phones. Its rather clean, easy to use and extend. Documentation in the code and examples - and working applications. But no tutorials. A handful of users outside of the core team.   Server side configuration enables new groups to make applications for mobile phones! Improve look & feel (CSS, simple tables, etc.) Lots of ideas for making it better! Extend with phone specific functions, like the camera plugin, and telco assets  (OMTP  standardization initiative) Further develop the server side configuration idea Report progress and grow the developer community (that’s why we are here ;)
Tested for devices: SonyEricsson, typical phones:  k660i (Java platform 8) w880i (Java platform 7) k550i (Java platform 7) w810i (Java platform 6) : camera ”strange” K530i Nokia  Series 60 N93, Nokia N9, N73, N63, E51, E61 Series 40: They all have limited memory and usually have problems reading large web-pages, in particular if there are large pictures 6131 6280 – did NOT work, at least with models with early firmware HTC  all models, limited functionality for  versions with no camera a c cess from JME Motorola – newer phones, require separate build Others – not tested
How do we compare with other toolkits? JME out of the box We are better in every way ;) We have a a browser ;) JME Polish (http://www.j2mepolish.org/cms/) They have nicer layout, CSS-like stylesheets They use conditional compilation (one binary per configuration) They have less flexible dynamic structure (e.g. variable  no. Of tabs, -only- build time configuration!) LWUIT (Lightweight UI Toolkit, https://lwuit.dev.java.net/) They are more heavyweight   They do look nice. They borrow some elements from Swing, but isn’t quite Swing. They are supported by Sun (but in a strange way, no JCP, etc.)
Links: iLabs main page:  http://www.ilabs.no/ Toolkit homepage:  https://ilabsmobiletoolbox.dev.java.net/ Subversion repository homepage :  https://ilabsmobiletoolbox.dev.java.net/source/browse/ilabsmobiletoolbox/ Issue tracker:  https://ilabsmobiletoolbox.dev.java.net/servlets/ProjectIssues Promotion:   http://freshmeat.net/projects/ilabstoolbox / Downloads http://sourceforge.net/projects/ilabsmobiletool/ Demo applications downloadable from phones: http://m.ilabs.no
Questions? Please ..    ?
Thank you for your attention
XTRA
Example XML for a browser: <wid let > <view name=&quot;ONM08&quot; type=&quot; appview &quot;> <titlebar title=&quot;ONM 08&quot;  bordercolor=&quot;#FF9900&quot; bgcolor=&quot;#444444&quot; textcolor=&quot;#ffffff&quot;/> <view type=&quot; web &quot; name=&quot;web1&quot; url=&quot;http:// ... .html&quot;></view> <action type=&quot; openurl &quot;  l abel=&quot;Home”   url=&quot;http:// ... .html&quot; control=&quot;web1&quot;/> <action type=&quot; useropenurl &quot;   label=&quot;Open  url&quot; control=&quot;web1&quot;/> <action type=&quot; backurl &quot;   label=&quot;Back&quot;  control=&quot;web1&quot;/> <action type=&quot; exit &quot;  label=&quot;Exit&quot;/> </view> </wid let >

More Related Content

PDF
Online News Portal System
PDF
Synopsis on android application
DOC
PROJECT REPORT
PPTX
Android task manager project presentation
RTF
Android App Development Project in College
DOCX
Mobile/Web App Development Project Report
PDF
Quiz app (android) Documentation
PPTX
News portal
Online News Portal System
Synopsis on android application
PROJECT REPORT
Android task manager project presentation
Android App Development Project in College
Mobile/Web App Development Project Report
Quiz app (android) Documentation
News portal

What's hot (20)

DOCX
Internship Project Report
PPTX
.Net presentation
PDF
Newleaks
PDF
online news portal system
PDF
Android Capstone Project, Final Deliverable Documentation
PDF
mLearn Project 2012 Full Report
PDF
Automate+ Final Report
PDF
Synopsis on android nougat
PDF
Create yourfirstandroidapppdf
PDF
Android quiz application
DOCX
Webface - Passion is Innovation
DOCX
Usability evaluation of the RunKeeper Application
DOCX
PROJECT FOR CSE BY TUSHAR DHOOT
PDF
Modern JavaScript Applications: Design Patterns
PDF
Java Technical Design Document
DOCX
Critical Analysis of SW Development tool/methodology
PDF
Project report | Major Project | Engineering | Devansh Koolwal
PDF
Training android
Internship Project Report
.Net presentation
Newleaks
online news portal system
Android Capstone Project, Final Deliverable Documentation
mLearn Project 2012 Full Report
Automate+ Final Report
Synopsis on android nougat
Create yourfirstandroidapppdf
Android quiz application
Webface - Passion is Innovation
Usability evaluation of the RunKeeper Application
PROJECT FOR CSE BY TUSHAR DHOOT
Modern JavaScript Applications: Design Patterns
Java Technical Design Document
Critical Analysis of SW Development tool/methodology
Project report | Major Project | Engineering | Devansh Koolwal
Training android
Ad

Similar to iLabs Toolbox Javashare 2008 (20)

PDF
Introduction to Docker and Containers- Learning Simple
PPTX
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
PPTX
Lecture #3 activities and intents
PDF
VIRTUAL LAB
DOCX
RakeshKushwaha
PPTX
CodeCamp general info
PDF
PPTX
Empower individuals with autism through coding
PDF
Java Is A Programming Dialect And Registering Stage Essay
PPT
Techniques For A Modern Web UI (With Notes)
PDF
Platform Independent App design
PDF
Top 7 Angular Best Practices to Organize Your Angular App
PDF
Get started with meteor | designveloper software agency meteor prime partner
PPT
Teamwork Presentation
PPT
Best Practices in Mobile Development: Building Your First jQuery Mobile App
PDF
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
PPTX
How to build your own Android App -Step by Step Guide
PDF
GSOC 2016 mifos
PPTX
iOS Development at Scale @Chegg
PPTX
Building a scalable app factory with Appcelerator Platform
Introduction to Docker and Containers- Learning Simple
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Lecture #3 activities and intents
VIRTUAL LAB
RakeshKushwaha
CodeCamp general info
Empower individuals with autism through coding
Java Is A Programming Dialect And Registering Stage Essay
Techniques For A Modern Web UI (With Notes)
Platform Independent App design
Top 7 Angular Best Practices to Organize Your Angular App
Get started with meteor | designveloper software agency meteor prime partner
Teamwork Presentation
Best Practices in Mobile Development: Building Your First jQuery Mobile App
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
How to build your own Android App -Step by Step Guide
GSOC 2016 mifos
iOS Development at Scale @Chegg
Building a scalable app factory with Appcelerator Platform
Ad

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Spectroscopy.pptx food analysis technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
The AUB Centre for AI in Media Proposal.docx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
sap open course for s4hana steps from ECC to s4
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectroscopy.pptx food analysis technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf

iLabs Toolbox Javashare 2008

  • 1. iLabs mobile toolbox: Java ME applications without intolerable pain. Content is available under Creative Commons, Attribution 3.0 license Describes version 0.53b of the toolkit
  • 2. iLabs Research project at Telenor R&I Three year funding, 1 year left. Focus: How to develop new forms of collaboration through open source. Method: Get dirty Real open source project: ilabs mobile toolbox Be analytical Think about both concrete and abstract issues. Report to everyone Top management, peers, nerds, suits, ..
  • 3. Speakers Bjørn Remseth. Cand. Scient. Research scientist at Telenor Research & Innovation.   Bjørn has more than twenty years of  experience as a sysadmin, developer, systems architect and research scientist. Stian Børresen MSc. Ten years experience  in 3D graphics, web, mobile and rich client development. He is currently working as a consultant specializing in mobile application development using java. Else Nordhagen.  Dr. Scient. Research Scientist at Telenor Research & Innovation. More than thirty years of experience with object oriented design and implementation, 3D graphics, theoretical computer science and GUI design (from Smalltalk in  the  late seventies, to JME today).
  • 4. Outline of this talk: Why we are doing this, history so far, design goals. ” Hello GUI” – simple example application A tiny bit of detail: Important classes and object structures “ Application style” examples OpenMiniChatter – XMPP chat OpenMiniBlogger – blog to blogger /blogspot. OpenMiniBrowser – simple HTML rendering “ Widget style” example A Twitter client. Links and contact info Questions
  • 5. Why iLabs Toolbox? Øystein Myhre (original author) with project manager Hilde Lovett En early facebook/gtalk client. We like mobile applications, would like to have more, but they painful to write, so we would like to: Make it easy : Remove stupid technical barriers. Be inspiring : Facilitate and motivate the production of useful mobile services. Current core developers
  • 6. In short It should be as simple to write an app that works on a mobile phone as it is to make content for the web We’re not quite there yet ;)
  • 7. History so far: Telenor R&I had several closed source Social Networking example applications written in JME. First open source release June 07, second massively reworked release in March 2008. Bimonthly release cycle (java.net, freshmeat, sourceforge). August 08: 0.52 U sed by iLabs and some other projects, e.g. Facebook client at the University of Colorado Green touch, application at the Oslo School of Architecture Vaccination registration application for HISP, developed at the Informatics Department at U niv. Of Oslo WellCom controlling set top boxes from your phone developed at Telenor R&I in a EUREKA project.
  • 9. Design goals: Hide heterogeneity of devices One binary per application (no conditional compilation!) Remove common JME pitfalls. Screen handling (Forms, Canvas) Event handling (Buttons, Menus) Simplify layout control of subwindows Simplify drawing of text, pictures etc. Adding real menus, tabbed views etc. Do not require an external proxy Leverage existing code for HTML , XMPP, ATOMS, Blogger... !Challenged!
  • 10. Development model Main license : Lesser Gnu Public License (LGPL) To allow derivative works. Contributors : 2-3 full time developers internally in Telenor R&I Handful contributors worldwide. Openness : We accept anything that is remotely useful. If we ever get to the point where we have to reject something, we will start rejecting things but we are not there yet. Subversion repository : Used religiously. Java coding standard/checkstyle : Used but with some lapses. Issue tracker : Read continously by developers. Telenor team decides what is done by Telenor team. Everyone else decides what they do. Scholarships : We do scholarships. Talk to us if you have a cool project and you are a student. ;)
  • 11. Example 1: How to make your own app (HelloGUI1). public final class HelloGUI extends AbstractIlabsMIDlet { public HelloGUI() { } public void initialize() { ApplicationView view = new ApplicationView(&quot;Hello GUI!&quot;); setCanvas( new ViewCanvas(getDisplay(),view)); view.setRightSoftbuttonAction( new ExitAction(&quot;Exit&quot;)); getCanvas().show(); } } Create a new midlet by subclassing AbstractILabsMidlet Override method “ initialize” in your midlet Set up your main view, and a canvas to draw on. Add menu items (Action instances) if any. Show the canvas That wasn’t very painful was it?
  • 13. class HelloGUI3 extends AbstractILabsMidlet public final void initialize() { ApplicationView view = new ApplicationView(&quot;Hello GUI 3!&quot;); view.addMenuItem(new ShowSelection(&quot;Item 1&quot;)); view.addMenuItem(new ShowSelection(&quot;Item 2&quot;)); view.addMenuItem(new ShowSelection(&quot;Item 3&quot;)); view.addMenuItem(new ShowSelection(&quot;Item 4&quot;)); view.setRightSoftbuttonAction(new ExitAction(&quot;Exit&quot;)); setCanvas(new ViewCanvas(getDisplay(), view)); getCanvas().show(); } User provided Built in
  • 14. Action that change Canvas: class ShowSelection extends DisplayChangeAction { ShowSelection( final String label) { super(label); } protected void onExecute() { final Alert alert = new Alert(&quot;Hello GUI3 alert&quot;, &quot;You selected : &quot; + getLabel(), null, AlertType.INFO); alert.setTimeout(Alert.FOREVER); setCurrent(alert, getCanvas()); } }
  • 15. Boilerplate to get things going: /** * Creates a new instance of HelloGUI3. */ public HelloGUI3() { }
  • 16. Important concepts (abstract) Graphics item – Something that can be drawn. (interface) InputHandler – Something that interprets user input . View – Something on the screen that can respond to User input. Often hierarchical. Often both GraphicsItem and InputHandler. Action – Command pattern that does something
  • 17. HelloGUI3, hierarchical decomposition ApplicationView Title B ar MenuView PopUpMenu Clock Action 4 Action 3 Action 2 Action 1 SimpleList View
  • 18. Example 3: OpenMiniChatter A Google Talk client Introducing features: Menus Forms Username /Password Tabbed view Switching between chats HtmlView for chat content XMPP Network protocol XML parsing: MarkupReader - a pull parser MarkupElement - creates an object structure Persistent storage, simple extention to JME Cool
  • 20. OpenMiniChatter - dry run - use of TabView
  • 21. Example 4: OpenMiniBlogger General components + Feed protocol Used towards {Blogger,blogspot}.com Phone-specific browser extension: Camera input plugin XML parsing: MarkupReader - a pull parser MarkupElement - creates an object structure Persistent storage, simple extention to JME Error handling mechanism that avoid the need to create ”millions” of different types of exception classes. URL encoding and parsing … Cool
  • 23. What the HTML renderer sees < form action =“&quot; id =&quot;cameraform&quot; method =&quot;post&quot; enctype =&quot;multipart/form-data&quot;> < object name =&quot;image_file&quot; classid = &quot;clsid:1b9982cf-4be8-42dd-9599-d0f6786d128d&quot; width =&quot;60&quot; height =&quot;80&quot;> </ object > < input type =&quot;submit&quot; name =&quot;update&quot; value =&quot;Update&quot;/> </ form > What you see Live camera view
  • 24. Blogger – upload and view:
  • 25. Example 4: OpenMiniBrowser Fast Simple Simple Html rendering No css tables scripting But with Forms cookies With extensions..
  • 26. Example 4: OpenMiniBrowser public void initialize() { mView = new ApplicationView(&quot;Open Minibrowser&quot;); mCanvas = new ViewCanvas(Display.getDisplay(this), mView); mHtmlView = new HtmlView(this); mView.setMainAreaView(mHtmlView); mHtmlView.setMargins(2, Font.getDefaultFont().charWidth(' ')); mView.addMenuItem(new OpenURLAction(mHtmlView, mHomePage, &quot;Home&quot;)); mView.addMenuItem(new EnterURLAction(mHtmlView, &quot;Open url&quot;)); mView.addMenuItem(new BackUrlAction(mHtmlView, &quot;Back&quot;)); mView.addMenuItem(new ExitAction(&quot;Exit&quot;)); //a clock, displaying hours and seconds. mClock = new Clock(System.currentTimeMillis(), false); mView.addClock(mClock); mView.layout(0, 0, mCanvas.getWidth(), mCanvas.getHeight()); mCanvas.show(); // Start a timer, update the clock once every minute. final Timer timer = new Timer(); timer.scheduleAtFixedRate(new ClockTask(), MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MINUTE); mHtmlView.open(mHomePage); }
  • 28. Lesson I: It’s not that hard to write useful, portable JME programs anymore ;) Most layout code in our demo programs end up being based on HTML, even when we’re not really doing web browsing. But we can make it even easier:
  • 29. Where we started - where we ended up: Plain JME programming Social Networking : easiest to render HTML content from others HTML : also used to make the user interface AHA: nice, UI just like the web :-) => Server side scripting as mobile programming method. Enabling developer to make their own mobile applications without writing JME JME app. .jad&.jar UI elements .html
  • 30. J2ME programs vs. server side XML xml & html J2ME App. J2ME Widger App. App. App. Widgets J2ME App. J2ME App. .jad and .jar files .jad&.jar
  • 31. WIDGER: Widlets through markup A Widger (an application) that runs runs Widlets (pieces of functionality living in the widger sandbox) that holds Views (showing some kind of content) that have Actions (that makes things happen). Documentation : http:// demo.ilabs.no/widgerdoc/index.php
  • 32. UngWeb in Møre og Romsdal Fylkeskommune
  • 33. UngeWeb: Widlet for ONE news item:
  • 34. XML for widlet for one news item: <? xml version = &quot;1.0&quot; encoding = &quot;windows-1252&quot; ?> < widlet ver = &quot;0.2&quot; id = ”tabbednyhet&quot; > < view type = &quot;tabs&quot; id = &quot;main&quot; > < view type = &quot;panel&quot; id = &quot;panel1&quot; title = &quot;Nyhet 1&quot; icon = &quot;/img/FolderExplorer.png&quot; show = &quot;true&quot; > < view type = &quot;web&quot; id = &quot;web1&quot; url = &quot;nyhet1.html&quot; ></ view > < action type = &quot;loadiwg&quot; label = &quot;Nyheter&quot; url = &quot;nyheter.iwg&quot; button = &quot;right&quot; /> </ view > < view type = &quot;panel&quot; id = &quot;panel2&quot; title = &quot;Kommentarer&quot; icon = &quot;resource://FolderExplorer.png&quot; > < view type = &quot;web&quot; id = &quot;web2&quot; url = &quot;nyhet1_kommentarer.html&quot; ></ view > < action type = &quot;reloadurl&quot; label = &quot;Oppdater&quot; for = &quot;web2&quot; /> < action type = &quot;loadiwg&quot; label = &quot;Nyheter&quot; url = &quot;nyheter.iwg&quot; button = &quot;right&quot; /> </ view > < view type = &quot;panel&quot; id = &quot;panel3&quot; title = &quot;Skriv selv&quot; icon = &quot;resource://BlogView.png&quot; > < view type = &quot;web&quot; id = &quot;web3&quot; url = &quot;nyhet1_skrivSelv.html&quot; ></ view > < action type = &quot;loadiwg&quot; label = &quot;Nyheter&quot; url = &quot;nyheter.iwg&quot; button = &quot;right&quot; /> </ view > </ view > </ widlet >
  • 35. Integrate with authoring tools: UngWeb Edit with eZ publish Generates HTML and .iwg Widger
  • 36. Lesson II: Supporting protocols is hard Protocol code is painful and error prone to write in JME, e.g. HTTPS :-( FaceBook, Twitter, FEIDE (ID login), ... Protocols change over time Workaround: exernal proxies that offload complexity Proxy Widger The service server
  • 37. Two servers and one client: The Twitter Server Widger/Twitter adapter (in example demo running on an iLabs server) Widger running the Twitter Widlet
  • 38. Widget Twitter dry run: Server side login and formatting using forms and simple html. In this case all pages are created on our server, not twitter s . Saves bytes and fixes problems with phone heterogeneity and weaknesses.
  • 39. Server-side scripting: Advantages and Disadvantages: Advantages Shorter development time Simpler client programs handles more phones smaller faster No need to download & install application again when updating service. Less network traffic on client due to tailored content on your server Better tools on server side for program development than JME... Easy to upgrade application Disadvantages You need a server .. that scales Need to handle security issues on the server Limited functionality on widger, today, but you can always extend it since it is open source 
  • 40. WIDGER: Widgets through markup A Widger (an application) that runs Widgets (pieces of functionality living in the widger sandbox) that holds Views (showing some kind of content) that have Actions (that makes things happen). Documentation : http://demo.ilabs.no/widgerdoc/index.php
  • 41. Example 5: Browser Widget : <?xml version=&quot;1.0&quot; encoding =&quot; windows-1252&quot; ?> <widget ver=&quot;0.2&quot; id=&quot;httpwidget&quot; >  <view id=&quot;mainview&quot; type=&quot;application&quot; >    <titlebar title=&quot;Http widget&quot; />    <subview type=&quot;web&quot; id=&quot;web1&quot; url=&quot;resource://widgets/httpwidgetindex.html&quot; > </subview>    <action type=&quot;openurl&quot; label=&quot;Home&quot; url=&quot;resource://widgets/httpwidgetindex.html&quot;for=&quot;web1&quot; />    <action type=&quot;enterurl&quot; label=&quot;Open url...&quot; for=&quot;web1&quot; />    <action type=&quot;backurl&quot; label=&quot;Back&quot; for=&quot;web1&quot; button=&quot;right&quot; />    <action type=&quot;exit&quot; label=&quot;Exit&quot; />    </view> </widget> Browser specific actions, built into widger Default exit action
  • 42. Result: v.s: Just another widget Hand crafted JME application
  • 43. Example 6: The Twitter Widget
  • 44. Two servers and one client: Twitter Widget (in Widger) Widger/Twitter adapter (in example demo running on an iLabs server) Twitter server
  • 45. Widget Twitter client: <widget> < view name =&quot;twitterview&quot; type =&quot;appview&quot; > <titlebar title=&quot;TwitterME&quot; bordercolor=&quot;#000000&quot; bgcolor = &quot;#94E4E8&quot; textcolor = &quot;#ffffff&quot;/> <view type =&quot;web&quot; name =&quot;web1&quot; url =” [...] /twitterlogin.html&quot;> </view> <action type =&quot;exit&quot; label =&quot;Exit&quot;/> </view> </widget> [...] == long url
  • 46. Widget Twitter client: < widget ver=&quot;0.2&quot; id=&quot;twitter&quot;>     < view type=&quot;application&quot; id=&quot;main&quot;>         < titlebar title=&quot;TwitterME&quot; …         < subview type=&quot;web&quot; name=&quot;web1&quot; url=&quot;resource://widgets/twitterlogin.html&quot;> </ subview >        < action type=&quot;loadiwg&quot; label=&quot;Widgets&quot; url=&quot;resource://widgets/masterwidget.iwg&quot;/>         < action type=&quot;exit&quot; label=&quot;Exit&quot;/>      </ view > </ widget > Colors removed
  • 47. twitterlogin.html (Plain old HTML, no surprises): <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;> <html> <head> <title>Twitter</title> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;> </head> <body> <p><img src=&quot;twitter.png&quot;/></p> <form action=&quot;http://demo.ilabs.no/test/widgets/twitter/twitter.php&quot; id=&quot;signinform&quot; method=&quot;post&quot;> <p><b>Username:</b><br> <input name=&quot;username&quot; type=&quot;text&quot; title=&quot;Enter username&quot; value=&quot;&quot; /> </p> <p> <b>Password:</b><br> <input type='password' name=&quot;pwd&quot; title=&quot;Enter password&quot; value=&quot;&quot; /> </p> <p> <input type=&quot;submit&quot; name=&quot;signin&quot; value=&quot;signin&quot; /> </p> <p><center><img src=&quot;/widger/img/twitterbird.png&quot;/></center></p> <p>Twitter is a service for friends, family, and co-workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?</p> </form> </body> </html> Nothing exiting happening here please move on
  • 48. twitterME user interface (Plain old HTML, one small surprise): <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;> <html> … <textarea name=&quot;status&quot;></textarea> <!-- <INPUT TYPE=&quot;file&quot; name=&quot;image_file&quot; id=&quot;image_file&quot;/> --> <object name=&quot;image_file&quot; classid=&quot;clsid:1b9982cf-4be8-42dd-9599-d0f6786d128d&quot; width=&quot;60&quot; height=&quot;80&quot;> </object> <input type=&quot;submit&quot; name=&quot;update&quot; value=&quot;Update&quot;/> </form> <hr> </p> <h3>Showing the latest private posts</h3><hr> <p><img src=&quot;http://s3.amazonaws.com/twitter_production/profile_images/55933057/cnn.twitter_normal.gif&quot;/><b>cnnbrk : </b><br>Embattled … Camera input
  • 49. Widget Twitter dry run: Server side login and formatting using forms and simple html. In this case all pages are created on our server, not twitter s . Saves bytes and fixes problems with phone heterogeneity and weaknesses.
  • 50. Where we are now.. And where to go.. It works! on a lot of phones. Its rather clean, easy to use and extend. Documentation in the code and examples - and working applications. But no tutorials. A handful of users outside of the core team.  Server side configuration enables new groups to make applications for mobile phones! Improve look & feel (CSS, simple tables, etc.) Lots of ideas for making it better! Extend with phone specific functions, like the camera plugin, and telco assets (OMTP standardization initiative) Further develop the server side configuration idea Report progress and grow the developer community (that’s why we are here ;)
  • 51. Tested for devices: SonyEricsson, typical phones: k660i (Java platform 8) w880i (Java platform 7) k550i (Java platform 7) w810i (Java platform 6) : camera ”strange” K530i Nokia Series 60 N93, Nokia N9, N73, N63, E51, E61 Series 40: They all have limited memory and usually have problems reading large web-pages, in particular if there are large pictures 6131 6280 – did NOT work, at least with models with early firmware HTC all models, limited functionality for versions with no camera a c cess from JME Motorola – newer phones, require separate build Others – not tested
  • 52. How do we compare with other toolkits? JME out of the box We are better in every way ;) We have a a browser ;) JME Polish (http://www.j2mepolish.org/cms/) They have nicer layout, CSS-like stylesheets They use conditional compilation (one binary per configuration) They have less flexible dynamic structure (e.g. variable no. Of tabs, -only- build time configuration!) LWUIT (Lightweight UI Toolkit, https://lwuit.dev.java.net/) They are more heavyweight  They do look nice. They borrow some elements from Swing, but isn’t quite Swing. They are supported by Sun (but in a strange way, no JCP, etc.)
  • 53. Links: iLabs main page: http://www.ilabs.no/ Toolkit homepage: https://ilabsmobiletoolbox.dev.java.net/ Subversion repository homepage : https://ilabsmobiletoolbox.dev.java.net/source/browse/ilabsmobiletoolbox/ Issue tracker: https://ilabsmobiletoolbox.dev.java.net/servlets/ProjectIssues Promotion: http://freshmeat.net/projects/ilabstoolbox / Downloads http://sourceforge.net/projects/ilabsmobiletool/ Demo applications downloadable from phones: http://m.ilabs.no
  • 55. Thank you for your attention
  • 56. XTRA
  • 57. Example XML for a browser: <wid let > <view name=&quot;ONM08&quot; type=&quot; appview &quot;> <titlebar title=&quot;ONM 08&quot; bordercolor=&quot;#FF9900&quot; bgcolor=&quot;#444444&quot; textcolor=&quot;#ffffff&quot;/> <view type=&quot; web &quot; name=&quot;web1&quot; url=&quot;http:// ... .html&quot;></view> <action type=&quot; openurl &quot; l abel=&quot;Home” url=&quot;http:// ... .html&quot; control=&quot;web1&quot;/> <action type=&quot; useropenurl &quot; label=&quot;Open url&quot; control=&quot;web1&quot;/> <action type=&quot; backurl &quot; label=&quot;Back&quot; control=&quot;web1&quot;/> <action type=&quot; exit &quot; label=&quot;Exit&quot;/> </view> </wid let >

Editor's Notes

  • #2: Welcome folks. This presentation will describe a toolkit built on top of the JME software platform for mobile phones. There are several hundre million mobile phones out there with JME software installed, and we would really like more of them to more useful things than playing the same old little games. We would like to see rich applications connecting people doing all the weird things that web pages do today. If powerpoint had been able to include web content, this is the code we would have used to link to our license: &lt;a rel=&amp;quot;license&amp;quot; href=&amp;quot;http://creativecommons.org/licenses/by/3.0/no/&amp;quot;&gt;&lt;img alt=&amp;quot;Creative Commons License&amp;quot; style=&amp;quot;border-width:0&amp;quot; src=&amp;quot;http://i.creativecommons.org/l/by/3.0/no/88x31.png&amp;quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span xmlns:dc=&amp;quot;http://purl.org/dc/elements/1.1/&amp;quot; property=&amp;quot;dc:title&amp;quot;&gt;iLabs mobile toolbox: JME applications without intolerable pain.&lt;/span&gt; by &lt;a xmlns:cc=&amp;quot;http://creativecommons.org/ns#&amp;quot; href=&amp;quot;http://www.ilabs.no/&amp;quot; property=&amp;quot;cc:attributionName&amp;quot; rel=&amp;quot;cc:attributionURL&amp;quot;&gt;Bj&amp;#248;rn Remseth, Else Nordhagen, Stian B&amp;#248;rresen&lt;/a&gt; is licensed under a &lt;a rel=&amp;quot;license&amp;quot; href=&amp;quot;http://creativecommons.org/licenses/by/3.0/no/&amp;quot;&gt;Creative Commons Attribution 3.0 Norway License&lt;/a&gt;.