OpenOffice UNO Application on Android

  • Upload
    imacat-

  • View
    2.123

  • Download
    2

Embed Size (px)

Citation preview

1

OpenOffice UNO Application on Android

imacat

2012/4/12

OpenOffice UNO Application on AndroidCC Attribution-ShareAlike 3.0 Unported

This presentation is in both Chinese and English. You don't have to read both languages. Actually, you have best listen to me than read it.

Apache OpenOffice Project Management Committee

OOo4Kids Development Team

LibreOffice Traditional Chinese Team

Past:OpenOffice.org Traditional Chinese Translation Lead

OpenOffice.org application developer

Oracle/Sun freelance lecturer

OpenOffice History

1984StarDivisionStarOffice

1999Sun MicrosystemsOpenOffice.org

2009OracleOpenOffice.org

2010The Document FoundationLibreOffice

2011Apache Software FoundationApache OpenOffice

Advertising

Volunteer Wanted!

Apache OpenOfficeApache OpenOffice local community need more volunteers.Please come join us!

Introduction

OpenOfficeQuestion:How can you bring OpenOffice onto mobile devices?

There are several efforts

LibreOffice on Android/iOS

The Document Foundation Blog, October 14, 2011LibreOffice port project to Android and iOS, based on the voluntary work of Tor Lillqvist, a SUSE finnish developer know for having ported GIMP to Windows. The LibreOffice Android and iOS port has the objective of bringing the office suite to iPads and Android tablets, and eventually smaller devices. The user interface work has yet to start in earnest but the bulk of the code is compiling.

IBM Lotus Symphony Viewer on Android/iOS

Solutions exist, but none are not fully working yet.

So we wait

Wait

OfficeBut, if we only want some client applications?

(2010-2011)WebOpenOfficeIn the past two years (2010-2011), I tried demonstrating OpenOffice onto mobile using mobile-web applications.

Bringing OpenOffice onto Mobile Devices

Impress

For Impress, a remote presentation controller (2010 COSCUP)

Bringing OpenOffice onto Mobile Devices

Writer

For Writer, a simple document processing system

Bringing OpenOffice onto Mobile Devices

Calc

For Calc, a remote chart report generator

2011 COSCUPAnd I even tried playing some magic (2011 COSCUP)

Playing Presentation Magic

Dealing poker cards

Playing Presentation Magic

Playing rock-paper-scissors

Playing Presentation Magic

CAPTCHA

Running CAPTCHA

Playing Presentation Magic

Displaying real-time information

OpenOffice UNO APIUniversal Network Objects

OpenOffice UNO APIOpenOfficeOpenOffice UNO API makes it very easy to control OpenOffice from outside (and play the magic).

OpenOffice

ImpressCalcWriter

UNOAPI

OpenOffice UNO API

OpenOffice

ImpressCalcWriter

UNOAPI

OpenOffice UNO API

Language Binding

OpenOffice

ImpressCalcWriter

UNOAPI

Language BindingC++JavaOpenOffice UNO API

OpenOffice

ImpressCalcWriter

UNOAPI

Language BindingC++JavaOpenOffice UNO API

PythonPerl

OpenOffice

ImpressCalcWriter

UNOAPI

Language BindingC++JavaOpenOffice UNO API

PythonPerlOLECLICOM

OpenOffice

ImpressCalcWriter

UNOAPI

Language BindingC++JavaOpenOffice UNO API

PythonPerlOLECLICOM

VB.NETC#

OpenOffice

ImpressCalcWriter

UNOAPI

Language BindingC++JavaOpenOffice UNO API

PythonPerlOLECLICOM

AlmostEverything!

VB.NETC#

OpenOffice

ImpressCalcWriter

UNOAPI

Language BindingC++JavaOpenOffice UNO API

PythonPerlOLECLICOM

AlmostEverything!

VB.NETC#NetworkSocket

UNO APIOfficeWe can easily construct cloud client applications upon the networked UNO API

Client Application A

OpenOffice UNO

OpenOffice

Writer

Calc

Impress

UNOAPI

C++

Client Application A

OpenOffice UNO

OpenOffice

Writer

Calc

Impress

UNOAPI

C++

Client Application B

Java

Client Application A

OpenOffice UNO

OpenOffice

Writer

Calc

Impress

UNOAPI

C++

Client Application B

Java

Client Application C

VB.NET

Client A

Server

Client Application A

OpenOffice UNO

OpenOffice

Writer

Calc

Impress

UNOAPI

C++

Client B

Client Application B

Java

Client C

Client Application C

VB.NET

TCP/IPNetwork

Web Officeas web applications.

Mobile Device

Server

Browser

Mobile Web Office Application

OpenOffice

Writer

Calc

Impress

UNOAPI

Mobile Device

Mobile Device

Mobile Web Application

Browser

Browser

TCP/IPNetwork

OfficeBut, what if we create the client application directly?

OfficeMobile Office Application

iOS ^^;Oh, no!Not the iOS application!

iOS
With iOS, you need

A Mac ($$$)

Developer annual license fee ($$)

Objective-C

Picture source: Tarcy Ohttp://www.flickr.com/photos/tracy_olson/61056391/

AndroidWhat about Android?

Android is Free

Android

Android is a system that everyone can freely develop her/his own toys on it.You don't have to pay a fee for your own device.

Android is Accessible

Android is available on Linux/Windows/MacWhere I can work on my free daily Debian Linux desktop PC.

Android is Java

OpenOffice SDKJava UNO

OpenOffice has official Java UNO libraries shipped with OpenOffice SDK.

Android is Java

.jar

Actually, you only need these four OpenOffice UNO .jar libraries.juh.jar

jurt.jar

ridl.jar

unoil.jar

But, life is not always easy

Conversion to Dalvik format failed with error 1.

DalvikUNO Java .jarDalvik class file converter failed to convert the UNO Java libraries!?

GoogleAndroid UNOI Googled everywhere.Since few people tried to build OpenOffice UNO application on Android, nobody has ever discussed this before.

Solution?

Java .jarzipLuckily, we know that Java .jar files are simply zipped files.

% for f in *.jar; do /opt/android-sdk-linux/platform-tools/dx --dex $f || echo "failed in $f"; done; unset f

UNEXPECTED TOP-LEVEL EXCEPTION:com.android.dx.util.ExceptionWithContext: bogus byte value: 128... 14 more...while processing ACTION_DEFAULT B...while processing com/sun/star/datatransfer/dnd/DNDConstants.class

1 error; abortingfailed in unoil.jar%

unoil.jarGood try!We know the problem lies within unoil.jar now.

% mkdir unoil% cd unoil% unzip ../unoil.jar% for f in `find * -name "*.class"`; do /opt/android-sdk-linux/platform-tools/dx --dex $f || echo "failed at $f"; done; unset f (This takes a long time.)UNEXPECTED TOP-LEVEL EXCEPTION:com.android.dx.util.ExceptionWithContext: bogus byte value: 128Caused by: java.lang.IllegalArgumentException: bogus byte value: 128... 13 more...while processing ACTION_DEFAULT B...while processing com/sun/star/datatransfer/dnd/DNDConstants.class

1 error; abortingfailed at com/sun/star/datatransfer/dnd/DNDConstants.class%

com/sun/star/datatransfer/dnd/DNDConstants.classcom.sun.star.datatransfer.dnd.DNDConstantsSo the problem lies within com/sun/star/datatransfer/dnd/DNDConstants.class,which belongs to com.sun.star.datatransfer.dnd.DNDConstants.

We don't need it for our application.So lets remove it for now.

% rm -f com/sun/star/datatransfer/dnd/DNDConstants.class% rm -f ../unoil.jar% zip -9 -r ../unoil.jar *%

It works now!

Demonstration

Presentation Controller

Dais PCOpenOfficeinServerMode

MobileDevice

ProjectorTCP/IPWireless

OpenOffice UNOon AndroidPresentation

Working Model

Client A

Server

Client Application A

OpenOffice UNO

OpenOffice

Writer

Calc

Impress

UNOAPI

C++

Client B

Client Application B

Java

Client C

Client Application C

VB.NET

TCP/IPNetwork


Download the Source

https://github.com/imacat/mpresent-android

OpenOffice Developers' GuideFor more information, check the OpenOffice Developers' Guide.

Thank you!Questions?