Weitere ähnliche Inhalte Ähnlich wie Integration of OSGi and User Friendly UI Application - Akira Moriguchi (20) Kürzlich hochgeladen (20) Integration of OSGi and User Friendly UI Application - Akira Moriguchi1. Integration of OSGi and
User Friendly UI Application
Akira Moriguchi
R&D department
Hitachi Solutions ,Ltd
2011/09/21 11:10 – 11:30
OSGi Alliance Marketing © 2008-2010 . 1
Page
COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved
All Rights Reserved
3. 1-1 Introduction
・ OSGi is the most promising application platform for Home Gateway (HGW).
- remote management, software modularity and strong access control
・ User-friendly UI applications are essential to Smart Home services.
- However, OSGi HGW has no UI.
・ Mobile platforms provide UI APIs and many documents.
Therefore, developers can produce various user-friendly applications.
⇒ Integration of OSGi with mobile UI applications is required.
・ An example of OSGi and mobile UI integration
End-User
DLNA bundle runs control Renderer
(DMR)
(1) Select a video
displayed on UI
control control (2) Play a selected video
OSGi HGW
Mobile Device Server
as Controller(DMC) (DMS)
Page 3 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
4. 1-2 Purpose of this study
・ 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
Many developers produce
various UI applications
Control via
Use OSGi DLNA, Zigbee,
methods Z-wave
Various Mobile Devices OSGi HGW
(J2ME, Android, Windows Phone, etc) Home
Devices
Page 4 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
6. 2-1 Web API
・ UI applications call methods of OSGi bundles using XML over HTTP.
generate and send XML parse XML messages and
messages call methods of bundles
XML message Control via
UI Web API Bundle DLNA, Zigbee,
Application DLNA Zigbee Z-wave Z-wave
Bundle Bundle Bundle
Various Mobile Platform
(J2ME Windows Phone, OSGi Framework
Android, etc.) Java VM
Home
Mobile Devices
HGW
Device
・ Problem
- Developers can not use all of OSGi methods.
- Web API can be called only with primitive parameters (int, char, etc.) .
- Implementations of XML parsing and generation are troublesome.
Page 6 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
7. 2-2 R-OSGi
・ R-OSGi is a technology enabling bundles to call methods of remote
bundles the same as calling local methods.
parse RPC messages
generate RPC messages and call methods of bundles
on behalf of UI application
Control via
UI Application RPC DLNA, Zigbee,
DLNA Zigbee Z-wave Z-wave
(Bundle) Bundle Bundle Bundle
R-OSGi Bundle R-OSGi Bundle
OSGi Framework OSGi Framework
Java VM Java VM
Home
Devices
Mobile
Device HGW
・ Problem
- R-OSGi can’t run on mobile devices without Java VM.
Page 7 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
9. 3-1 Idea : Mobile R-OSGi
・ Mobile R-OSGi enables developers of non-Java platform applications to use
remote OSGi methods as same way of using local methods.
UI Application
Java method
RPC DLNA Zigbee Z-wave
R-OSGi
Bundle Bundle Bundle
J2ME Device J2ME R-OSGi Bundle
OSGi Framework HGW
UI Application Java VM
Dalvik method
C# method
Mobile Device Mobile R-OSGi
Without Java VM Non-Java Platform
Page 9 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
10. 3-2 Requirements of Mobile R-OSGi
・ To realize Mobile R-OSGi,
dependencies to Java need to be removed from R-OSGi.
・ The Architecture of R-OSGi bundle:
- Proxy Generator dynamically generates Proxy Class.
- Proxy Class has the same interface as the remote bundle and handles RPC.
UI Application(Bundle)
1. request
5. return value 3. local method call
1.R-OSGi Bundle
generate Bundle
and load 4. RPC
Proxy Generator Proxy Classa
a
a
a R-OSGi Bundle
2. generate
and load
Mobile Device with Java VM HGW
・ 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.
Page 10 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
11. 3-3 The Architecture of Mobile R-OSGi
・ Extended Proxy Generator and Object Convertor are needed for each mobile
platform.
(a) Extended Proxy Generator:
generates the mobile platform binary of Proxy Class.
(b) Object Convertor :
converts serialization format of objects into the mobile platform format.
UI Application (b) convert parameters
1. request and return value
5. return value 3. local method call
1. Mobile R-OSGi
generate Bundle
and load 4. RPC
Proxy Generator Proxy Class a Object Convertor a
a R-OSGi Bundle
2. generate
and load
Extend (a) The mobile Add
platform binary
HGW
Mobile Device Without Java VM
Page 11 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
12. Outline
1. Introduction
2. Problems in existing methods
3. Mobile R-OSGi
4. Evaluation
5. Summary
Page 12 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
13. 4-1 Experimental Setup
・ Environment
Laptop PC Home
Android
Use OSGi as HGW Devices
(ODROID-7)
functions Control
- CPU : Cortex-A8 1Ghz - CPU : Intel Core i5 2.40Ghz
- Memory : 512MB - Memory : 2.98GB
- OS : Android ver 2.2 - OS : Windows XP
- Runtime : J2SE1.4.2
・ 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
Page 13 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
14. 4-2 Implementation for evaluation
・ For feasibility studies, we implemented Mobile R-OSGi for Android
(a) Proxy Generator :
(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
(b) Object Convertor
⇒ This is not needed for Android,
because Java and Dalvik have the same serialization format.
Page 14 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
15. 4-3 Running a UI application using methods of bundles
・ We developed a UI application that works as DMC by calling DLNA bundle
- UI application calls “Browse” and “Play” methods of DLNA bundle
- “Browse” is the method for getting list of contents stored on DMS
- “Play” is the method for playing contents on DMR
- UI application process :
(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
DLNA Bundle
Call “dlna.browse;”
Browse
Call “dlna.play;” Play
R-OSGi Bundle
OSGi Framework
Java VM
Android PC TV
(DMC) (HGW and DMS) (DMR)
Page 15 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
16. 4-4 Measurement of Overheads in RPC
(1) Setup
・ Proxy class generation and loading
- 450 ms/service
(2) Method Call
・ Comparison of processing times between RPC and local method call
- The overheads are less than 10 ms.
Call Remote Call Local Overhead
Method [ms] Method [ms] [ms]
Method A 13 8 5
Method B 75 72 3
Method C 703 694 9
⇒ It has no problem in practical use.
Page 16 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
17. Outline
1. Introduction
2. Problems in existing methods
3. Mobile R-OSGi
4. Evaluation
5. Summary
Page 17 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
18. 5. Summary and future works
・ Conclusion
- 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.
- Mobile R-OSGi realized an mobile application using home control
features, which satisfies the following features :
- Mobile developers can use OSGi methods in the same way as using Dalvik
local methods.
- The overheads in RPC are acceptable.
・ Future works
- 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
Page 18 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved
19. Thank you !
Akira Moriguchi
Hitachi Solutions, Ltd.
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.
Page 19 OSGi Alliance Community Event 2011© 2008-2011. All Rights Reserved