• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Funambol  JavaME Messaging Client: Lessons Learned - JavaONE 2008
 

Funambol JavaME Messaging Client: Lessons Learned - JavaONE 2008

on

  • 2,125 views

 

Statistics

Views

Total Views
2,125
Views on SlideShare
2,122
Embed Views
3

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 3

http://www.slideshare.net 2
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Funambol  JavaME Messaging Client: Lessons Learned - JavaONE 2008 Funambol JavaME Messaging Client: Lessons Learned - JavaONE 2008 Presentation Transcript

    • Funambol Java™ Platform, Java ME Technology-Based Open-Source Messaging Client: Lessons Learned Edoardo Schepis, Java ME Tech Lead Session: TS-4992
    • What developers should know about building open source Java Platform, Micro Edition (Java ME platform) messaging applications for the mass market How to build synchronization clients for Java ME technology-based devices, starting from the Funambol Java ME SDK 2008 JavaOneSM Conference | java.sun.com/javaone | 2
    • Agenda Introduction Funambol Java ME SDK Push E-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 3
    • Agenda Introduction Funambol Java ME SDK Push e-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 4
    • Synchronization Data synchronization is the process of making two sets of data look identical Which means • Exchange data modifications • Conflict resolution Synchronization Protocol Features • Define a method for establishing a synchronization session and communicating modifications • Record naming and identification • Define protocol commands 2008 JavaOneSM Conference | java.sun.com/javaone | 5
    • Synchronization Why do we need it? • PDA, Handsets, iPod, Outlook, Thunderbird, Skype, Gmail, Yahoo, Jajah, Facebook, Web... • Mail, Contacts, Calendar • But also bookmarks, SMS, MP3, documents, files... • Mobile field work force The common usage • PC Suite, Bluetooth, Active Sync, iSync: wired and PC Over the Air is the key • Data plans • It just works • Wider support 2008 JavaOneSM Conference | java.sun.com/javaone | 6
    • OTA Synchronization with mobile devices OMA DS (former SyncML) • Platform independent • Open Uses SyncML to automatically synchronize • Contacts (address book), including photos • Calendar • Tasks and notes • Additional and custom data types Server maintains backup of PIM data Data can be accessed via web Full capabilities for mobile backup service 2008 JavaOneSM Conference | java.sun.com/javaone | 7
    • Native sync or not? Native is good, but... • Not always available (branding phones...) • Native clients not so easy to configure (even to find...) Do not reinvent the wheel, just make it better • For all the handsets • Java ME Platform, Windows Mobile, Linux, Blackberry, Android, iPhone • For all the clients • Outlook, Thunderbird, Evolution • For all the Mail/PIM servers • POP, IMAP, Exchange... 2008 JavaOneSM Conference | java.sun.com/javaone | 8
    • Funambol Software Overview Push • e-mail, contacts and calendar Mobile Backup & PIM Sync Mobile Device Management Mobilizing Data & Applications 2008 JavaOneSM Conference | java.sun.com/javaone | 9
    • Funambol Software Overview Funambol Portal 1.5B+ Devices Email/PIM Nokia POP/IMAP Motorola Yahoo! Sony Ericsson Hotmail Samsung Gmail LG AOL SyncML Outlook Win Mobile Exchange* Java ME Domino* iPhone Push PIM OTA Mobile Thunderbird* Android* Email Sync Config Platform Custom/3rd party Funambol Server *Community project 2008 JavaOneSM Conference | java.sun.com/javaone | 10
    • Agenda Introduction Funambol Java ME SDK Push E-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 11
    • Funambol Java ME SDK MIDP 2.0, CLDC 1.0, WMA 1.1 SyncML API (∼24kb) • Transport • Sync Protocol • Sync Source Sync Application Mail API (∼15kb) • MIME std parser • Multipart support SyncML Mail Common (∼30kb) Common • Push • SMS JavaME API • TCP/IP • Storage • FileSystem • RMS / Blackberry • Utils 2008 JavaOneSM Conference | java.sun.com/javaone | 12
    • Funambol SyncML API - 1/2 Sync Application SyncML Mail SyncManager Common • Handles communication and protocol JavaME API Sync Source • Client database: handles items to send and to store SyncItem • Abstracts objects to sync Sync Modes • Two way, one way • Refresh SyncListener • Notifies upper layers Transport • Http/s, Socket, Bluetooth 2008 JavaOneSM Conference | java.sun.com/javaone | 13
    • Funambol SyncML API - 2/2 Data Synchronization Layer Class Diagram SyncManager - config: SyncConfig SyncSource + SyncManager(config: SyncConfig) + getNextItem(): SyncItem + getNextNewItem(): SyncItem + sync(source: SyncSource): void + getNextUpdatedItem(): SyncItem + getNextDeletedItem(): SyncItem + setItemStatus(key:String, status: int) + addItem(item: SyncItem): int + updateItem(item: SyncItem): int + deleteItem(item: SyncItem): int SyncItem + beginSync() + SyncItem(key: String) + endSync() > key: String + getName() > type: String + getSourceURI() > state: char + getType() > content: byte[] + getEncoding() + getSyncMode() SyncConfig DeviceConfig BaseSyncSource SourceConfig +BaseSyncSource(sc: SourceConfig) 2008 JavaOneSM Conference | java.sun.com/javaone | 14
    • Funambol Mail API Sync Application SyncML Mail Message • Multipart Common Mime Formatter and Parser JavaME API • RFC 2045, 2046 Folders Flags Message Message Header attributes Header attributes To: <monty@funambol.com> To: <monty@funambol.com> Subject: Today's meeting Subject: Today's meeting Content-Type: text/plain; Content-Type: ... multipart/mixed;... Body Body Multipart BodyPart Hello, World! Hello, World! BodyPart <br>Hello... BodyPart [attachment] 2008 JavaOneSM Conference | java.sun.com/javaone | 15
    • Funambol Common Libraries Sync Application SyncML Mail Push • SMS OTA service Common • TCP/IP service JavaME API • Server Alert Notification (SAN) • OTA Configuration Storage • RMS / Blackberry • File System Utils • Logging • Base64 and QuotedPrintable • ThreadPool • Serialization 2008 JavaOneSM Conference | java.sun.com/javaone | 16
    • How to build a sync-based application Prepare your SyncSource • Create a configuration for synchronization • Implement sync Items database Start the sync with SyncManager • Mapping and modifications Optional: • Create a configuration • Device capabilities (manufacturer, sw, hw, fw, utc support, ...) • Connect a SyncListener Sync Application • Notify upper layers • Filtering SyncML Mail • Size, age and more Common JavaME API 2008 JavaOneSM Conference | java.sun.com/javaone | 17
    • Let's sync our contacts Vcard + JSR75 File format standard for electronic business cards • RFC 2425 and RFC 2426 • V2.1 Specification from the Internet Mail Consortium • V3.0 Specification approved by the IETF Java Specification Request (JSR) 75 (PIM package) BEGIN:VCARD VERSION:2.1 N:Schepis;Edoardo FN:Edoardo Schepis ORG:Funambol TITLE:JavaME Tech Lead TEL;WORK;VOICE:+1 (650) 701 1450 ADR;WORK:;;643 Bair Island Road, Suite 305;Redwood City;CA;94063;United States of America URL;WORK:http://www.edschepis.net EMAIL;PREF;INTERNET:schepis@funambol.com REV:20080309T150456Z END:VCARD 2008 JavaOneSM Conference | java.sun.com/javaone | 18
    • Let's sync our contacts JSR75 – get Contact from a VCard public Contact getContact(byte[] vCard) { ByteArrayInputStream bis = new ByteArrayInputStream(vCard); PIMItem[] items = pim.fromSerialFormat(bis, “UTF-8”); return ((Contact) items[0]); } 2008 JavaOneSM Conference | java.sun.com/javaone | 19
    • Let's sync our contacts JSR75 – get Vcard from a Contact ... ContactList contactList = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE); ... public byte[] getVCard(Contact c) { ByteArrayOutputStream os = new ByteArrayOutputStream(); PIM.getInstance(). toSerialFormat(c, os, “UTF-8”, “VCARD/2.1”); return os.toByteArray(); } 2008 JavaOneSM Conference | java.sun.com/javaone | 20
    • Let's sync our contacts Synchronize Contact ... SyncConfig conf = new SyncConfig(); conf.syncUrl = "http://somewhere.com"; conf.username = "user"; conf.password = "pass"; SourceConfig sc = ClientStore.loadMySourceConfig(); ContactSyncSource css = new ContactSyncSource(sc); SyncManager sm = new SyncManager(conf); sm.sync(sc); ClientStore.saveMySourceConfig(); ... 2008 JavaOneSM Conference | java.sun.com/javaone | 21
    • Let's sync our contacts SyncML content ... <SyncBody> ... <!-- status commands --> <Sync><CmdID>3</CmdID> <!-- client side changes --> <Target><LocURI>addressbook</LocURI></Target> <Source><LocURI>addressbook</LocURI></Source> <Replace><CmdID>4</CmdID> <!-- one client side change --> <Meta xmlns="syncml:metinf"> <Type>text/x-vcard</Type><Format>b64</Format> </Meta> <Item> <Source><LocURI>1</LocURI></Source> <!-- LUID --> <Data>... base 64 encoded content ...</Data> </Item> </Replace> </Sync> <Final/> </SyncBody> ... 2008 JavaOneSM Conference | java.sun.com/javaone | 22
    • Agenda Introduction Funambol Java ME SDK Push E-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 23
    • Push E-mail Client 1/2 E-mail on mass market handsets • Java ME Platform • Blackberry too All standard e-mail functionality Push • SMS and TCP based Advanced features e.g. • Send Photo • Call sender • Integrated address book eliminates typing of e-mail addresses on phone Advertising 2008 JavaOneSM Conference | java.sun.com/javaone | 24
    • Push E-mail Client 2/2 2008 JavaOneSM Conference | java.sun.com/javaone | 25
    • Push Implementation Client waits for server push • The ds-server detects updates on mail server and notifies the registered client Using SMS (also with app. off) • The app is registered with PushRegistry for incoming SMS Using Socket (only with app. on) • CTP • The app manages a socket open with the server (CTP server) that uses it for sending notifications • STP • The app starts a serversocket and waits for server notifications • IP natting, proxies and gateways • Socket and PushRegistry • Specs are always right... but app. closed means no connection on many devices and therefore no IP address 2008 JavaOneSM Conference | java.sun.com/javaone | 26
    • Agenda Introduction Funambol Java ME SDK Push E-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 27
    • ObjectOriented vs. Performance and Fragmentation How much does OO still flows in our veins? • Fat classes • “if” vs. polymorphism • Preprocessing • Antenna Provide the best User Experience with • 800kb of Heap space... • 512kb of RMS • 100kb of jar (suggested) Fragmentation • Targeting consumers means building many bundles • Platforms: the latest not always means the best • Branding phones: same device but with fw variant 2008 JavaOneSM Conference | java.sun.com/javaone | 28
    • Certification process - 1/2 Trusted 3rd party Certification • to avoid requests for permissions to the user • network, multimedia, PIM and filesystem access, SMS usage, autostart • to bypass security restriction of carrier-branded phones • To access restricted API Verisign/Thawte • Developers own private key • Certificate in chain • Very popular • Pay once in a year Java Platform Verified Program • GeoTrust • Pay per device/per release • Testing house applies UTI general criteria (don't mind if the sync works) • The only viable solution for Motorola devices 2008 JavaOneSM Conference | java.sun.com/javaone | 29
    • Certification process - 2/2 Carriers security restrictions • No “Ask Once” for network connections: client-server apps become impractical and unrealistic • No Push Registration • No JSR 75 access • ... some carriers avoid also to play a MIDI file (!) Need an agreement with mobile operators or manufacturers to enter in operator/manufacturer trusted domain • Full access to all the API • No user prompts 2008 JavaOneSM Conference | java.sun.com/javaone | 30
    • Agenda Introduction Funambol Java ME SDK Push E-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 31
    • Funambol is Mobile Open Source Community Edition • AGPLv3 (Affero GPL) • Fixing the ASP loophole (SaaS): • “If you change or add to the code and you use the software as the basis of an Internet or network-based service, you must publish your code or buy a commercial license” • http://www.fsf.org/licensing/licenses/agpl-3.0.html Funambol CommEd Contains: • A data synchronization (DS) server that works on Linux and Windows • Mobile device clients e.g. Windows Mobile, Java ME Platform, Outlook, iPod • E-mail connector that supports POP and IMAP e-mail systems • Administrator tool • Software development kits and interfaces • Documentation • Community projects, support for Exchange, Domino, BlackBerry and more 2008 JavaOneSM Conference | java.sun.com/javaone | 32
    • Why Open Source in mobile matters? Broadest device compatibility First to market advantage Largest mobile open source community Mobile innovation, resources and support Complete code transparency Reduced risk Low cost 2008 JavaOneSM Conference | java.sun.com/javaone | 33
    • Developing open source software Everybody watches you! (therefore write good code) You belong to a Company and to a Community Everyone is in the spotlight Communities need frameworks - Customers need products 2008 JavaOneSM Conference | java.sun.com/javaone | 34
    • Community Programs Code Sniper • Awards bounties of up to several thousand dollars for the development of connectors, plug-ins, client and synclets by Community Members • Enable the Community to influence the direction and reach of the Funambol Project through direct contribution of open source code • New: connectors for Social Networking Phone Sniper • Awards bounties to Community Members for testing Funambol on mobile devices 2008 JavaOneSM Conference | java.sun.com/javaone | 35
    • Funambol Community Hall of Fame Carlo Codega (Italy) Mike Taczak, Nguyen Mai http://sazilla.blogspot.com (USA) • Mozilla Sync http://www.mailtrust.com • Android Sync • Blackberry Plugin • iPhone Paulo Sergio (Portugal) • Gmail Sync Plugin Patrick Ohly (Germany) http://sf.net/projects/funambol-gmail http://www.estamos.de • Yahoo Sync Plugin • SyncEvolution http://sf.net/projects/funambolyahoo • iPhone 2008 JavaOneSM Conference | java.sun.com/javaone | 36
    • Agenda Introduction Funambol Java ME SDK Push E-mail Client Write Once... Mobile Open Source On the edge 2008 JavaOneSM Conference | java.sun.com/javaone | 37
    • The new generation of clients Android iPhone Linux Devices: OpenMoko, Qtopia Symbian 2008 JavaOneSM Conference | java.sun.com/javaone | 38
    • Android To make a sync application for Android, you should have: • An Activity controlling the main UI (start sync, choose items) • Some other activities for Settings, About, etc. • A Service to actually doing the sync When the user starts the sync: • The Activity trigger the service using startService() with an Intent • The service is started and the method onStart() is called The Service talks back to the app using Intent to notify the sync progress http://code.google.com/p/funambol/ 2008 JavaOneSM Conference | java.sun.com/javaone | 39
    • iPhone a Safari browser web app for all users a native app for developers and advanced users that have "jailbroken" their iPhone • Based on SyncEvolution • Compiled for iPhone and connected to the (undocumented) AddressBook interface • A simple COCOA user interface and the game is done! We are designing the new version of the client, based on the Apple SDK http://www.funambol.com/solutions/iphone.php 2008 JavaOneSM Conference | java.sun.com/javaone | 40
    • For More Information Funambol Open Source • http://www.funambol.com/opensource Funambol SDK and Documentation • http://www.funambol.com/opensource/downloads.php Code Sniper • http://www.funambol.com/opensource/codesniper.php SyncML - Data Synchronization and Device Management • http://www.openmobilealliance.org/syncml/ 2008 JavaOneSM Conference | java.sun.com/javaone | 41
    • my.funambol.com Simple set-up of phones for mobile e-mail and PIM sync Supports over 700 device models Sync, view, edit PIM dataList 2008 JavaOneSM Conference | java.sun.com/javaone | 42
    • Summary Synchronization • Work in any environment with any device, efficiently and without configuration/upgrades hassle Funambol SDK • Fast development of your sync-applications Open Source • The key to beat fragmentation We are looking for snipers 2008 JavaOneSM Conference | java.sun.com/javaone | 43
    • 2008 JavaOneSM Conference | java.sun.com/javaone | 44
    • Edoardo Schepis, Java ME Tech Lead edoardo.schepis@funambol.com 2008 JavaOneSM Conference | java.sun.com/javaone | 45