Android and OSGi: Can they Work Together?

Similar documents
Dependencies, dependencies, dependencies

Breaking Apart the Monolith with Modularity and Microservices CON3127

Equinox Framework: How to get Hooked

A Framework for Evaluating Mobile App Repackaging Detection Algorithms

Extending the JavaScript Development Toolkit

Jigsaw and OSGi: What the Heck Happens Now?

API Tooling in the Eclipse SDK

GlassFish V3. Jerome Dochez. Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net. Session ID YOUR LOGO HERE

Introduction to OSGi. Marcel Offermans. luminis

Do you really get classloaders?

Leverage Rational Application Developer v8 to develop OSGi application and test with Websphere Application Server v8

Using Apache Felix: OSGi best practices. Marcel Offermans luminis

Wednesday, June 23, JBoss Users & Developers Conference. Boston:2010

OSGi In Action: Creating Modular Applications In Java By Richard Hall, Karl Pauls READ ONLINE

Equinox OSGi: Pervasive Componentization

Getting to the Next Level with Eclipse Concierge

EMFT Mint (Incubation) 0.7 Ganymede Simultaneous Release Review

Towards A Common Build Infrastructure: Designing For Reusability

EMF Compare Ganymede Simultaneous Release

IF61. IBM Data Capture and Delivery Platform. User s Guide

Creating Custom Dojo Widgets Using WTP

Building Secure OSGi Applications. Karl Pauls Marcel Offermans. luminis

JBoss Transactions 4.2.2

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015

Class Dependency Analyzer CDA Developer Guide

TPF Toolkit for WebSphere Studio V3 V Using an Internal Update Site

TDD who pays? Test Driven Development in embedded java projects an unusual insight in usage scenarios and budgets

Modularity in Java. With OSGi. Alex Docklands.LJC January Copyright 2016 Alex Blewitt

IBM Operational Decision Manager Version 8 Release 5. Configuring Operational Decision Manager on Java SE

EMF Compare Galileo Simultaneous Release

Tuscany: Applying OSGi modularity after the fact

Java 2 Programmer Exam Cram 2

Using Smartphone devices with IBM WebSphere Portlet Factory

Liberate your components with OSGi services

Lotus Technical Night School XPages and RDBMS

Managing Installations and Provisioning of OSGi Applications. Carsten Ziegeler

Europe on a Disk Geodata Processing with Eclipse and OSGi. Harald Wellmann 10 Nov 2008

Developing Java Applications with OSGi Capital District Java Developers Network. Michael P. Redlich March 20, 2008

The Harmony Framework.

Extending TPTP for Database Unit Testing

MethodHandle Introspection: Internals

Equinox Project Update

The Terminator to Android Hardening Services. Yueqian Zhang, Xiapu Luo, Haoyang Yin Department of Computing The Hong Kong Polytechnic University

Lecture 08. Android Permissions Demystified. Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner. Operating Systems Practical

Oracle R Enterprise. New Features in Oracle R Enterprise 1.5. Release Notes Release 1.5

Importing an SNA Custom Handshake Class

Extending the liberty profile

Eclipse PDE and Bndtools

WSDM = Web Services Distributed Management, an open standard/specified ratified by OASIS

Tivoli Web Solutions. Upgrade Notes

Gcj: the new ABI and its implications

Entwicklercamp Track 3 Session 4. XPages und Domino App Dev Erweiterungen. Philippe Riand, IBM Niklas Heidloff, IBM

Brekeke PBX Version 2 ARS Plug-in Developer s Guide Brekeke Software, Inc.

Ensuring a smooth upgrade to Sametime and IFR 1

OSGi on the Server. Martin Lippert (it-agile GmbH)

SAP Edge Services, cloud edition Edge Services Predictive Analytics Service Guide Version 1803

Apache Geronimo 3.0 Deep Dive

Brekeke SIP Server Version 2 Authentication Plug-in Developer s Guide Brekeke Software, Inc.

Christopher Frost Virgo Committer Martin Lippert Lead, Spring Development Tools SpringSource, a division of VMware 3rd November 2011

[cover art/text goes here] [vertical list of authors] Copyright,.

IBM Operational Decision Manager. Version Sample deployment for Operational Decision Manager for z/os artifact migration

Lotus Learning Management System R1

Server for IBM i. Dawn May Presentation created by Tim Rowe, 2008 IBM Corporation

Make. Release 11.5/Composer

Mobiliser CODE GENERATION - DAO-2-Service

Chapter 4 Java Language Fundamentals

OSGi. Building and Managing Pluggable Applications

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists

Creating Jar Files. Based on slides by: Jin Hung, Gregory Olds, George Blank, Sun Java Web Site

Pause-Less GC for Improving Java Responsiveness. Charlie Gracie IBM Senior Software charliegracie

Page 1 of 6. tpfdf/rt/readme_sdo.txt. Service Data Objects (SDO) Access to z/tpfdf - PUT 05

Effective PMR Submission Best Practice. IBM Learn Customer Support

Using JBoss and Ingres. March 2009 David Turner

bbc Content Repository Connector for Adobe LiveCycle ES4 Configure Content Repository Connector APPLIES TO CONTENTS

Topics Augmenting Application.cfm with Filters. What a filter can do. What s a filter? What s it got to do with. Isn t it a java thing?

HP Business Availability Center

Apache Felix Shell. Apache Felix Shell. Overview. How the Shell Service Works. package org.apache.felix.shell;

Reconstructing DALVIK. Applications. Marc Schönefeld CANSECWEST 2009, MAR18

Tools for mobile Linux Release Review Dec 2009

What is a VM? Categories of Virtual Machines. Process Virtual Machine 11/17/2010

Orbix 3.0 for Windows Installation Guide

We will see how this Android SDK class. public class OpenSSLX509Certificate extends X509Certificate {

AppDev StudioTM 3.2 SAS. Migration Guide

ULC Test Framework Guide. Canoo RIA-Suite 2014 Update 4

Certified Core Java Developer VS-1036

Oracle Agile Engineering Data Management

Apache Quarks & Raspberry Pi

Asynchronous OSGi: Promises for the masses. Tim Ward.

Boost your JAVA Code with the OpenNTF API. Oliver Busse We4IT GmbH, Germany March 17, 2016

Building LinkedIn's Next Generation Architecture with OSGI

WebSphere MQ Telemetry Java Classes Version 1.1

Discover Our Update Site for Eclipse-Based U2 DBTools. Ben Wedewer Quality Control Engineer, U2 Lab

Paul Sabanal IBM X-Force Advanced Research. Hiding Behind ART IBM Corporation

Project Capuchin Bridging Flash Lite and Java ME in Sony Ericsson phones

Intel Stereo 3D SDK Developer s Guide. Alpha Release

Red Hat JBoss Fuse 6.1

EMF Ganymede Simultaneous Release

IKAN ALM Architecture. Closing the Gap Enterprise-wide Application Lifecycle Management

Static analysis for quality mobile applications

We will see how this Android SDK class. public class OpenSSLX509Certificate extends X509Certificate {

Transcription:

Android and OSGi: Can they Work Together? BJ Hargrave Senior Technical Staff Member, IBM Lotus Neil Bartlett Java Developer and Consultant

Yes!

Any Questions?

Motivation

Different Models JVM DVM DVM App App App App App App DVM OSGi Android

Benefits of OSGi

App Invoke App Cheap

App App lib lib lib lib Possible

Benefits of Android

App App Safe

App App Safe

Finding the right granularity

Prior work

Felix on Android Marcel Offermans (Luminis) Karl Pauls (Luminis)

http://blog.luminis.nl/luminis/entry/ osgi_on_google_android_using (repeated on last slide)

Our Goal Equinox Concierge

1. Concierge

First step: Start Framework

Dexification

dx --dex --output=classes.dex foo.jar aapt add foo.jar classes.dex

Code changes Required

Next Step: Adding a Bundle

ClassLoader.defineClass() does not work

Use android.dalvik.dexfile

private final DexFile df; DexHelper(File file) throws Exception { df = new DexFile(file); } Class defineclass(classloader cl, String name) { String dexname = name.replace('.', '/'); try { Class c = df.loadclass(dexname, cl); return c; } } catch (Exception e) { // log error return null; }

Patch Limitations Simple bundle classpath only, i.e. Bundle-ClassPath:. No nested JARs No directory bundles

Android doesn t like this: ClassLoader.loadClass(clazz, true) true triggers ClassLoader.resolveClass(), which fails => call ClassLoader.loadClass(clazz) false is the default

Success!

DEMO

2. Equinox

First Step: Start Framework

Somewhat Harder

Equinox uses CodeSource to configure some properties On Android, ProtectionDomain is null so no CodeSource => Supply properties explicitly

-Dosgi.framework=file:/data/equinox org.eclipse.osgi_3.4.0.jar -Dosgi.install.area=file:/data/equinox

ClassLoader.getResource() is used to return list of Hook configuration property files Android always return an empty enum => Manually list hooks in config.ini

osgi.hook.configurators=org.eclipse.osgi. internal.baseadaptor.basehookconfigurator,org.eclipse.core.runtime.internal.adapto r.eclipseloghook,org.eclipse.core.runtime.internal.adaptor.eclipselazystarter,org. eclipse.core.runtime.internal.adaptor.ecl ipsestoragehook

Strange VerifyError on a framework internal class => Turn off the verifier Is this a dexifier bug?

Next Step: Adding a Bundle

Same need for DexHelper

Same Limitations

boot?? ext java.* app Framework bundle bundle bundle

boot dummy ext java.* app Framework bundle bundle bundle

Cannot find java.lang.object!

-Dosgi.parentClassloader=ext

boot ext java.* app Framework bundle bundle bundle

Success!

DEMO

Possible Next Steps A proper hook for dex file loading Full Bundle-ClassPath support JIT dexification of JARs in the hook? Equinox incubator?

Getting Started All changes available as patches against Concierge, Equinox Subversion repository: http://www.osgi.org/svn/public/trunk/eclipsecon/2008/ androidosgi

ProSyst http://www.adon-line.de/kunden/prosystblog/?p=24

Links Felix on Android http://blog.luminis.nl/luminis/entry/osgi_on_google_android_using Our Repository: http://www.osgi.org/svn/public/trunk/eclipsecon/2008/androidosgi ProSyst Announcement: http://www.adon-line.de/kunden/prosystblog/?p=24

Legal Notices IBM and the IBM logo are trademarks or registered trademarks of IBM Corporation, in the United States, other countries or both. Java and all Java-based marks, among others, are trademarks or registered trademarks of Sun Microsystems in the United States, other countries or both. Eclipse and the Eclipse logo are trademarks of Eclipse Foundation, Inc. Other company, product and service names may be trademarks or service marks of others. THE INFORMATION DISCUSSED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, SUCH INFORMATION. ANY INFORMATION CONCERNING IBM'S PRODUCT PLANS OR STRATEGY IS SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.