integration of osgi and user friendly ui application - akira moriguchi

19
COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved Integration of OSGi and User Friendly UI Application Akira Moriguchi OSGi Alliance Marketing © 2008-2010 . All Rights Reserved Page 1 R&D department Hitachi Solutions ,Ltd 2011/09/21 11:10 11:30

Upload: mfrancis

Post on 28-Jan-2015

108 views

Category:

Technology


1 download

DESCRIPTION

User friendly UI applications which use home control protocols (DLNA, Zigbee, Z-Wave, etc.) are essential to promote OSGi to Smart Home and HEMS markets. These applications are developed by creative application developers with various UI libraries, as applications on mobile platforms including Android and Windows Mobile. Therefore, best practice is to integrate OSGi with mobile platforms, that is, to run UI on mobile platforms and export OSGi's home control features to them. In order for application developers to use features of OSGi bundles easily, we developed OSGi UI Bridge by exploiting R-OSGi which allows calling OSGi methods from UI platforms as if they were called as Java local methods. To evaluate the feasibility, we measured overheads in RPC between a mobile UI application and an OSGi bundle, and developed example applications on an Android platform. We found that the overheads are acceptable when small numbers of bundles are used, and practical DLNA applications such as DMC and DMP can be implemented by calling methods of DLNA OSGi bundle from mobile platform.

TRANSCRIPT

Page 1: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved

Integration of OSGi and

User Friendly UI Application

Akira Moriguchi

OSGi Alliance Marketing © 2008-2010 .

All Rights Reserved

Page 1

R&D department

Hitachi Solutions ,Ltd

2011/09/21 11:10 – 11:30

Page 2: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 2

1. Introduction

Outline

2. Problems in existing methods

3. Mobile R-OSGi

4. Evaluation

5. Summary

Page 3: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 3

1-1 Introduction

⇒ Integration of OSGi with mobile UI applications is required.

・ User-friendly UI applications are essential to Smart Home services.

・ OSGi is the most promising application platform for Home Gateway (HGW). - remote management, software modularity and strong access control

・ Mobile platforms provide UI APIs and many documents.

Therefore, developers can produce various user-friendly applications.

Mobile Device

as Controller(DMC)

OSGi HGW

Renderer

(DMR)

Server

(DMS)

DLNA bundle runs

control

control

(1) Select a video

displayed on UI

・ An example of OSGi and mobile UI integration

(2) Play a selected video control

End-User

- However, OSGi HGW has no UI.

Page 4: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 4

1-2 Purpose of this study

Home

Devices

OSGi HGW Various Mobile Devices

(J2ME, Android, Windows Phone, etc)

Many developers produce

various UI applications

Use OSGi methods

Control via DLNA, Zigbee,

Z-wave

・ There are various mobile platforms such as J2ME, Android, and

Windows Phone.

・What we want to do :

- To provide an easy way to call OSGi methods from various mobile

platforms

Page 5: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 5

1. Introduction

Outline

2. Problems in existing methods

3. Mobile R-OSGi

4. Evaluation

5. Summary

Page 6: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 6

2-1 Web API ・ UI applications call methods of OSGi bundles using XML over HTTP.

XML message UI

Application

OSGi Framework

Web API Bundle

Java VM

Mobile

Device

Control via DLNA, Zigbee,

Z-wave

HGW

Various Mobile Platform (J2ME Windows Phone,

Android, etc.)

Zigbee

Bundle

DLNA

Bundle

Z-wave

Bundle

Home

Devices

parse XML messages and call methods of bundles

generate and send XML messages

・ Problem

- Implementations of XML parsing and generation are troublesome.

- Web API can be called only with primitive parameters (int, char, etc.) .

- Developers can not use all of OSGi methods.

Page 7: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 7

2-2 R-OSGi

HGW

・ R-OSGi is a technology enabling bundles to call methods of remote

bundles the same as calling local methods.

RPC

Mobile Device

Control via DLNA, Zigbee,

Z-wave

OSGi Framework

R-OSGi Bundle

Java VM

Zigbee

Bundle

DLNA

Bundle

Z-wave

Bundle

OSGi Framework

R-OSGi Bundle

Java VM

UI Application

(Bundle)

Home

Devices

generate RPC messages on behalf of UI application

parse RPC messages and call methods of bundles

・ Problem

- R-OSGi can’t run on mobile devices without Java VM.

Page 8: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 8

1. Introduction

Outline

2. Problems in existing methods

3. Mobile R-OSGi

4. Evaluation

5. Summary

Page 9: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 9

3-1 Idea : Mobile R-OSGi

HGW

UI Application

Mobile Device

Without Java VM

OSGi Framework

R-OSGi Bundle

Java VM

Zigbee

Bundle

DLNA

Bundle

Z-wave

Bundle

Non-Java Platform

Mobile R-OSGi

UI Application

J2ME

R-OSGi

J2ME Device

・ Mobile R-OSGi enables developers of non-Java platform applications to use

remote OSGi methods as same way of using local methods.

Java method

Dalvik method

C# method

RPC

Page 10: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 10

a a a a

3-2 Requirements of Mobile R-OSGi

1. generate

and load

R-OSGi Bundle

UI Application(Bundle)

R-OSGi Bundle

Bundle

Proxy Generator 2. generate

and load

4. RPC

Mobile Device with Java VM HGW

3. local method call

Proxy Class

5. return value

- Proxy Generator dynamically generates Proxy Class.

1. request

- Proxy Class has the same interface as the remote bundle and handles RPC.

・ Dependencies to Java : (a) Proxy Class is composed of Java byte code.

(b) Parameters and return values are transferred over RPC using Java

serialization format.

・ The Architecture of R-OSGi bundle:

・ To realize Mobile R-OSGi,

dependencies to Java need to be removed from R-OSGi.

Page 11: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 11

a a a

3-3 The Architecture of Mobile R-OSGi

(b) Object Convertor :

converts serialization format of objects into the mobile platform format.

1. generate

and load

Mobile R-OSGi

UI Application

R-OSGi Bundle

Bundle

Proxy Generator

2. generate

and load

4. RPC

Mobile Device Without Java VM HGW

(a) Extended Proxy Generator:

generates the mobile platform binary of Proxy Class.

Proxy Class

3. local method call 5. return value

Object Convertor

Extend Add

(b) convert parameters and return value

(a) The mobile platform binary

1. request

・ Extended Proxy Generator and Object Convertor are needed for each mobile

platform.

Page 12: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 12

1. Introduction

Outline

2. Problems in existing methods

3. Mobile R-OSGi

4. Evaluation

5. Summary

Page 13: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 13

4-1 Experimental Setup

Android

(ODROID-7)

・ Environment

・ Evaluation items :

(1) To confirm that OSGi method calls from mobile applications work

without problems

(2) To measure overheads in RPC between mobile UI applications and

OSGi bundles

Laptop PC

as HGW Home

Devices

- CPU : Cortex-A8 1Ghz

- Memory : 512MB

- OS : Android ver 2.2

- CPU : Intel Core i5 2.40Ghz

- Memory : 2.98GB

- OS : Windows XP

- Runtime : J2SE1.4.2

Use OSGi

functions Control

Page 14: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 14

4-2 Implementation for evaluation

・ For feasibility studies, we implemented Mobile R-OSGi for Android

⇒ This is not needed for Android,

because Java and Dalvik have the same serialization format.

(1) Converts generated Java bytecode into Dalvik bytecode using

Android Dex convertor included in Android SDK

(2) loads Dalvik bytecode using DexClassLoader,

which is the classloader for Dalvik

(a) Proxy Generator :

(b) Object Convertor

Page 15: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 15

DLNA Bundle

4-3 Running a UI application using methods of bundles

Android

(DMC) PC

(HGW and DMS)

TV

(DMR)

・ We developed a UI application that works as DMC by calling DLNA bundle

Call “dlna.browse;”

OSGi Framework

R-OSGi Bundle

Java VM

- “Browse” is the method for getting list of contents stored on DMS

- “Play” is the method for playing contents on DMR

Call “dlna.play;”

- UI application calls “Browse” and “Play” methods of DLNA bundle

(1) displays the list of contents stored on PC (DMS) by “Browse” method call

(2) sends a content selected by users to TV (DMR) by “Play” method call

- UI application process :

Browse

Play

Page 16: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 16

4-4 Measurement of Overheads in RPC

(1) Setup ・ Proxy class generation and loading

- 450 ms/service

Call Remote

Method [ms]

Call Local

Method [ms]

Overhead

[ms]

Method A 13 8 5

Method B 75 72 3

Method C 703 694 9

(2) Method Call

・ Comparison of processing times between RPC and local method call

- The overheads are less than 10 ms.

⇒ It has no problem in practical use.

Page 17: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 17

1. Introduction

Outline

2. Problems in existing methods

3. Mobile R-OSGi

4. Evaluation

5. Summary

Page 18: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 18

5. Summary and future works

・ Conclusion

・ Future works

- Mobile developers can use OSGi methods in the same way as using Dalvik

local methods.

- We proposed Mobile R-OSGi that enables UI applications on various

mobile platforms to use home control features on OSGi using local

method calls, and evaluated Mobile R-OSGi for Android.

- To develop Mobile R-OSGi for other mobile platforms such as Windows Phone

- To enhance security in order to prevent malicious mobile applications

using home control features

- The overheads in RPC are acceptable.

- Mobile R-OSGi realized an mobile application using home control

features, which satisfies the following features :

Page 19: Integration of OSGi and User Friendly UI Application - Akira Moriguchi

OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved Page 19

Thank you !

Hitachi Solutions, Ltd.

Akira Moriguchi

DLNA is a registered trademark of Digital Living Network Alliance.

Android is a registered trademark of Google Inc.

Zigbee is a registered trademark of Zigbee Alliance

Z-wave is a registered trademark of Zensys Inc.

All other trademarks or registered trademarks are the property of their respective owners.