The document discusses device emulation using OSGi and Flash. It describes how emulating devices can save development time and costs by allowing testing of software without needing physical devices. An emulator framework is proposed that uses XML over sockets for communication between Java and Flash to provide dynamic and programmable emulation of device behaviors and events. Tests can then be run against emulated devices to serve as a quality gate for software.
Debugging code is an essential task for every software developer. PHP is one of the most popular programming languages, but setting up debugging for PHP applications may be tricky. This session will demonstrate what debugging technologies and tools are available for PHP. How to debug CLI scripts, Web apps and REST services. What's the easiest way to set up debugging for the different server environments: local, remote, cloud or virtualized; in development or in production.
Definitive Guide to Working With Exceptions in JavaVictor Rentea
Exceptions have been with us for 25 years in Java but have we learned to use them properly? Are checked exceptions a mistake? Should you use throw runtime or checked exceptions? And what to do with a checked exception, when you get one? And how to slay the boss of all exceptions: the NullPointerException.
Let’s put these old questions in the context of Java8+ lambdas, Vavr monads, Lombok, Spring, JAX-RS and other modern frameworks, and see the best practices of handling errors in Java today.Let’s put these old questions in the context of Java8+ lambdas, Vavr monads, Lombok, Spring, JAX-RS and other modern frameworks, and see the best practices of handling errors in Java today.
PHP Mega Meetup, Sep, 2020, Anti patterns in phpAhmed Abdou
PHP is one of the easiest programming languages to use ever and powers more than half of the internet.
With this ease of use, certain common patterns emerge that become harmful. This is especially true when your product or service is not expected to die soon. Some anti-patterns are coding, others are related to operating your service, especially with new docker stacks. We will go over some of the most common pitfalls with a focus on enterprise development.
Joel Arvidsson, Klarna. What You See is What You Get – a case for visual testingIT Arena
Experienced software engineer, currently working mainly in JavaScript and React Native. Passionate about open source and building delightful mobile experiences
Speech Overview:
Components are commonly tested with snapshots of the rendered DOM. While it’s beneficial when working with untested legacy systems, often it’s a high noise and high maintenance approach that easily lets regressions slip by. It’s now considered bad practice having it as the single testing strategy.
Loki is a visual testing tool that has similar benefits as snapshot testing in that it’s quick and easy to get started, but fewer of the downsides – refactors are not flagged as regressions and discerning desirable from unintended changes is much easier. Last year it gained a place in the ThoughtWorks Tech Radar and has since matured to support advanced use cases with massive parallelization using lambdas.
The talk outlines successful strategies for visual testing in general, pitfalls to avoid and how to get started in under a minute
This document provides an overview of HTML5, including what's new in HTML5 like new semantic elements, canvas, video, audio, local storage, and web workers. It discusses the history of HTML5 and how to use Modernizr to detect HTML5 support in older browsers. It also addresses challenges of browser support and solutions for getting HTML5 features to work across browsers.
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneDavid Glick
Using real issues encountered in the wild, this session will help beginning integrators gain confidence in knowing what to do when Plone fails to behave as expected. Learn how to solve common problems like "My changes aren't taking effect" and "My Zope instance won't start," as well as how to use pdb to investigate more complex Python errors.
This talk is targeted at integrators who have some experience with Plone, but who are not confident in troubleshooting errors and other unexpected behavior. Knowledge of Python is not required, though at least a cursory familiarity with some programming language will make the talk more digestible.
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
Slides of the Talk I gave at Devoxx Belgium 2019.
=== Abstract ===
Focusing on the creative work without being terrified of breaking the existing behavior can make software development very addictive! Good automated tests can buy you that!
However, if your tests are not maintainable they may end up slowing you down and causing you painful headaches, compilation errors and spurious failures. To avoid that, your unit tests should be significant; expressive; clean; DRY; non-overlapping; and blazing fast. Writing good tests becomes the toughest challenge for any developer, no matter how battle-hardened: you need to balance risk with test maintenance costs, while looking out for test design smells that call for [risky] refactoring to drive your design towards a set of key principles (included:).
Principles that will end up shaping the way you craft the Production code itself. Because in the end, a good, clean design is more important than coverage%.
But testing gives you the best feedback to get there.
Grab a black coffee and join this snippet from Victor’s Pro Unit Testing #training, to learn about testing priorities, buggy tests, the shared @Before, Mocks vs Stubs and how to reduce them by "purifying" your logic, testing Legacy Code and refactoring @Spy-es out.
All of that in an entertaining, dynamic and memorable session.
What do you mean it needs to be Java based? How jython saved the day.Mark Rees
The document discusses how Jython can be used to run Python code on the Java Virtual Machine (JVM). It provides examples of using Jython to:
1) Call Java code from Python and call Python code from Java by using Jython classes and interfaces.
2) Access databases using Python database APIs that bridge to JDBC like zxJDBC.
3) Build web applications using frameworks like Django that run on Jython and the Java web server.
Debugging code is an essential task for every software developer. PHP is one of the most popular programming languages, but setting up debugging for PHP applications may be tricky. This session will demonstrate what debugging technologies and tools are available for PHP. How to debug CLI scripts, Web apps and REST services. What's the easiest way to set up debugging for the different server environments: local, remote, cloud or virtualized; in development or in production.
Definitive Guide to Working With Exceptions in JavaVictor Rentea
Exceptions have been with us for 25 years in Java but have we learned to use them properly? Are checked exceptions a mistake? Should you use throw runtime or checked exceptions? And what to do with a checked exception, when you get one? And how to slay the boss of all exceptions: the NullPointerException.
Let’s put these old questions in the context of Java8+ lambdas, Vavr monads, Lombok, Spring, JAX-RS and other modern frameworks, and see the best practices of handling errors in Java today.Let’s put these old questions in the context of Java8+ lambdas, Vavr monads, Lombok, Spring, JAX-RS and other modern frameworks, and see the best practices of handling errors in Java today.
PHP Mega Meetup, Sep, 2020, Anti patterns in phpAhmed Abdou
PHP is one of the easiest programming languages to use ever and powers more than half of the internet.
With this ease of use, certain common patterns emerge that become harmful. This is especially true when your product or service is not expected to die soon. Some anti-patterns are coding, others are related to operating your service, especially with new docker stacks. We will go over some of the most common pitfalls with a focus on enterprise development.
Joel Arvidsson, Klarna. What You See is What You Get – a case for visual testingIT Arena
Experienced software engineer, currently working mainly in JavaScript and React Native. Passionate about open source and building delightful mobile experiences
Speech Overview:
Components are commonly tested with snapshots of the rendered DOM. While it’s beneficial when working with untested legacy systems, often it’s a high noise and high maintenance approach that easily lets regressions slip by. It’s now considered bad practice having it as the single testing strategy.
Loki is a visual testing tool that has similar benefits as snapshot testing in that it’s quick and easy to get started, but fewer of the downsides – refactors are not flagged as regressions and discerning desirable from unintended changes is much easier. Last year it gained a place in the ThoughtWorks Tech Radar and has since matured to support advanced use cases with massive parallelization using lambdas.
The talk outlines successful strategies for visual testing in general, pitfalls to avoid and how to get started in under a minute
This document provides an overview of HTML5, including what's new in HTML5 like new semantic elements, canvas, video, audio, local storage, and web workers. It discusses the history of HTML5 and how to use Modernizr to detect HTML5 support in older browsers. It also addresses challenges of browser support and solutions for getting HTML5 features to work across browsers.
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneDavid Glick
Using real issues encountered in the wild, this session will help beginning integrators gain confidence in knowing what to do when Plone fails to behave as expected. Learn how to solve common problems like "My changes aren't taking effect" and "My Zope instance won't start," as well as how to use pdb to investigate more complex Python errors.
This talk is targeted at integrators who have some experience with Plone, but who are not confident in troubleshooting errors and other unexpected behavior. Knowledge of Python is not required, though at least a cursory familiarity with some programming language will make the talk more digestible.
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
Slides of the Talk I gave at Devoxx Belgium 2019.
=== Abstract ===
Focusing on the creative work without being terrified of breaking the existing behavior can make software development very addictive! Good automated tests can buy you that!
However, if your tests are not maintainable they may end up slowing you down and causing you painful headaches, compilation errors and spurious failures. To avoid that, your unit tests should be significant; expressive; clean; DRY; non-overlapping; and blazing fast. Writing good tests becomes the toughest challenge for any developer, no matter how battle-hardened: you need to balance risk with test maintenance costs, while looking out for test design smells that call for [risky] refactoring to drive your design towards a set of key principles (included:).
Principles that will end up shaping the way you craft the Production code itself. Because in the end, a good, clean design is more important than coverage%.
But testing gives you the best feedback to get there.
Grab a black coffee and join this snippet from Victor’s Pro Unit Testing #training, to learn about testing priorities, buggy tests, the shared @Before, Mocks vs Stubs and how to reduce them by "purifying" your logic, testing Legacy Code and refactoring @Spy-es out.
All of that in an entertaining, dynamic and memorable session.
What do you mean it needs to be Java based? How jython saved the day.Mark Rees
The document discusses how Jython can be used to run Python code on the Java Virtual Machine (JVM). It provides examples of using Jython to:
1) Call Java code from Python and call Python code from Java by using Jython classes and interfaces.
2) Access databases using Python database APIs that bridge to JDBC like zxJDBC.
3) Build web applications using frameworks like Django that run on Jython and the Java web server.
Enterprise AIR Development for JavaScript DevelopersAndreCharland
The document discusses the potential of Adobe Integrated Runtime (AIR) for JavaScript developers. It provides examples of how AIR allows developing rich desktop applications with HTML, JavaScript and Flash. It demonstrates communicating with web services, working offline, drag and drop file handling, and saving data to files. AIR provides capabilities beyond the web like accessing local files and notifications while reusing existing Ajax skills.
Create Cross-Platform Native Mobile Apps in Flex with ELIPS StudioGuilhem Ensuque
In this FITC SF 2010 session, Guilhem explains what makes development of mobile applications development so special compared to Rich Internet Applications. You will learn what it means to be "native", why it matters for performance and user experience, and how OpenPlug's ELIPS Studio turns your Flex code into a native app. You'll also hear about the bewildering diversity in mobile operating systems and how ELIPS Studio helps keeping fragmentation at bay. Taking examples from popular apps created by ELIPS Studio users and some hands-on code examples, Guilhem will take you through the entire journey of specifying, designing, developing, testing and publishing an app created in Flex with ELIPS Studio on popular devices.
The document summarizes key aspects of building Firefox OS to address issues with the mobile web. Firefox OS is Mozilla's attempt to make the web a first-class citizen on phones and tablets by starting with the web stack rather than trying to add the web to an existing OS. It has launched in several countries and aims to be an affordable alternative to feature phones and closed platforms. The architecture is based on Linux, Gecko, and web technologies. It provides predictable HTML5 support and addresses performance, fragmentation, security and hardware access through its design and web APIs.
"Probably, Maybe, No: The State of HTML5 Audio" - Scott Schillerscottschiller
The document summarizes the state of HTML5 audio, including its history, current limitations, and future potential. It discusses how browser support for audio formats is fragmented, requiring multiple formats for broad compatibility. It also notes that Flash still provides the best cross-browser support and is needed as a fallback for non-HTML5 browsers. The document demonstrates an HTML5 audio player prototype built with CSS but dependent on Flash for full functionality across browsers.
Presentation by Haroon Meer at ReCon in 2005.
This presentation is about web application security. Various web application attacks like XSS, SQLi and directory traversal are discussed. The wikto and crowbar tools developed by sensepost are also discussed.
Overcome your fear of implementing offline mode in your appsMarin Todorov
Way too many apps on the App Store totally break when you loose connectivity. Have a look at some study cases and hopefully by the end you will figure out that implementing offline mode in your app is not that difficult at all.
This document provides an agenda and summary of an Adobe Flash on Mobile & Devices event held on October 10, 2009. The agenda includes introductions, a discussion of the Adobe Flash Platform for mobiles and devices, a presentation on Flashlite design and development, hands-on activities to create a first Flashlite application, and tips and tricks for Flashlite development. It also covers extending applications with Flashlite mashups, general mobile design guidelines, and demos. The document aims to educate attendees on mobile development with Flash and Flashlite through presentations and activities.
A lecture given at MIT in Boston about the benefits and technicalities of open web standards for Video and Audio. Lots of examples how to manipulate live video using CSS3 and Canvas.
This document discusses developing applications that can run across multiple mobile devices and platforms. It covers designing interfaces that adapt to different screen sizes and densities, using media queries and application DPI settings. It also discusses configuring applications to target Android, iOS, BlackBerry and other platforms through application descriptors and compiler settings. The document demonstrates packaging and deploying a single codebase to different devices using command line tools like ANT build scripts.
Teflon - Anti Stick for the browser attack surfaceSaumil Shah
The document discusses the browser as the new "desktop" and main attack surface for web applications. It outlines the browser architecture and analogizes it to the kernel/operating system model. It then discusses exploiting browsers through techniques like heap spraying and return-to-heap attacks using JavaScript payloads. The document also introduces Teflon, a browser extension designed to prevent such exploits by inspecting and blocking offensive JavaScript vectors. Teflon was tested against real exploits and obfuscated payloads with success. Further research directions are discussed to improve browser security.
The document discusses various techniques for enabling offline functionality in Ajax applications, including browser storage options like cookies, Firefox offline storage, and Flash shared objects. It also covers approaches for pushing data from server to client like polling, asynchronous servlets, Comet, and piggybacking on other responses. The document concludes with considerations for optimizing Ajax performance such as data formats, bandwidth usage, and client-side processing.
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingTal Melamed
Testing Java client applications is not always straightforward as testing web applications. Even under experienced hands, there might be obstacles coming your way; what if you cannot use a proxy? How do you MitM? What if you just can't? How do you modify the app to your benefit?
Fortunately, Java is still Java. This lecture is based on a true story, and will follow an interesting case of pen-testing a known product; what tools and techniques can be used in order to jump over hurdles, all the way to the finish line.
The lecture aims to enrich the pentester's toolbox as well as mind, when facing Java client applications; MitM-ing, run-time manipulations and patching the code are only some of the discussed cases.
In addition, a newly developed proxy for intercepting and tampering with TCP communication over TLS/SSL and bypassing certificate-pinning protections, will be introduced during the lecture.
PhoneGap is an open source framework that allows developers to build mobile apps using HTML, CSS, and JavaScript. It works by wrapping web applications in wrappers for each mobile operating system so they can access native device APIs and app stores. Key features include access to device capabilities like the camera, geolocation, contacts and more. It supports building apps for Android, iOS, BlackBerry and other platforms.
This document provides an introduction to Android programming, covering Moore's law and mobile device hardware capabilities, the Android software development checklist, basics of the Android graphical user interface, getting started with Android code, and running your first "Hello World" Android app. Key topics include the ingredients needed for an Android app, using XML to define app layout and components, implementing activities and handling events, and describing the app in the Android manifest file.
GTLAB Installation Tutorial for SciDAC 2009marpierc
GTLAB is a Java Server Faces tag library that wraps Grid and web services to build portal-based and standalone applications. It contains tags for common tasks like job submission, file transfer, credential management. GTLAB applications can be deployed as portlets or converted to Google Gadgets. The document provides instructions for installing GTLAB, examples of tags, and making new custom tags.
This document provides an overview of the architecture and components used in an AI assistant called Otto. It describes the base software including Docker, Node.js, and MongoDB. It also outlines the natural language processing, speech recognition, text-to-speech and other modules. It details the client and messaging bot architectures and includes information on I/O drivers, actions, fulfillments and the overall workflow. Finally, it lists some example intents and provides guidance on developing new actions and the hardware used including the Raspberry Pi, Re-Speaker mic HAT and power components.
1. The document introduces Swift Localhost, a tool for writing localhost UI tests in Swift. It allows setting up a mock localhost server to handle API requests from the app under test.
2. Common problems with traditional end-to-end tests like brittle tests and slow execution are discussed. Localhost UI tests address these by mocking API responses at a faster, isolated integration level.
3. The key aspects of setting up and asserting localhost requests are explained, including routing requests to the localhost server, configuring mock responses, and validating the expected request paths and cURL commands.
This document summarizes a presentation about creating voice applications using Tropo. Tropo allows developers to build voice applications using common programming languages like JavaScript, Ruby, Python, and Groovy. It provides APIs for telephony functions like answering calls, speaking prompts, processing input, and transferring calls. Examples show how to build simple applications that greet callers, ask for input using speech or touch tones, and transfer calls. The presentation argues that Tropo simplifies voice application development by allowing web developers to use familiar languages instead of specialized telephony standards.
Enterprise AIR Development for JavaScript DevelopersAndreCharland
The document discusses the potential of Adobe Integrated Runtime (AIR) for JavaScript developers. It provides examples of how AIR allows developing rich desktop applications with HTML, JavaScript and Flash. It demonstrates communicating with web services, working offline, drag and drop file handling, and saving data to files. AIR provides capabilities beyond the web like accessing local files and notifications while reusing existing Ajax skills.
Create Cross-Platform Native Mobile Apps in Flex with ELIPS StudioGuilhem Ensuque
In this FITC SF 2010 session, Guilhem explains what makes development of mobile applications development so special compared to Rich Internet Applications. You will learn what it means to be "native", why it matters for performance and user experience, and how OpenPlug's ELIPS Studio turns your Flex code into a native app. You'll also hear about the bewildering diversity in mobile operating systems and how ELIPS Studio helps keeping fragmentation at bay. Taking examples from popular apps created by ELIPS Studio users and some hands-on code examples, Guilhem will take you through the entire journey of specifying, designing, developing, testing and publishing an app created in Flex with ELIPS Studio on popular devices.
The document summarizes key aspects of building Firefox OS to address issues with the mobile web. Firefox OS is Mozilla's attempt to make the web a first-class citizen on phones and tablets by starting with the web stack rather than trying to add the web to an existing OS. It has launched in several countries and aims to be an affordable alternative to feature phones and closed platforms. The architecture is based on Linux, Gecko, and web technologies. It provides predictable HTML5 support and addresses performance, fragmentation, security and hardware access through its design and web APIs.
"Probably, Maybe, No: The State of HTML5 Audio" - Scott Schillerscottschiller
The document summarizes the state of HTML5 audio, including its history, current limitations, and future potential. It discusses how browser support for audio formats is fragmented, requiring multiple formats for broad compatibility. It also notes that Flash still provides the best cross-browser support and is needed as a fallback for non-HTML5 browsers. The document demonstrates an HTML5 audio player prototype built with CSS but dependent on Flash for full functionality across browsers.
Presentation by Haroon Meer at ReCon in 2005.
This presentation is about web application security. Various web application attacks like XSS, SQLi and directory traversal are discussed. The wikto and crowbar tools developed by sensepost are also discussed.
Overcome your fear of implementing offline mode in your appsMarin Todorov
Way too many apps on the App Store totally break when you loose connectivity. Have a look at some study cases and hopefully by the end you will figure out that implementing offline mode in your app is not that difficult at all.
This document provides an agenda and summary of an Adobe Flash on Mobile & Devices event held on October 10, 2009. The agenda includes introductions, a discussion of the Adobe Flash Platform for mobiles and devices, a presentation on Flashlite design and development, hands-on activities to create a first Flashlite application, and tips and tricks for Flashlite development. It also covers extending applications with Flashlite mashups, general mobile design guidelines, and demos. The document aims to educate attendees on mobile development with Flash and Flashlite through presentations and activities.
A lecture given at MIT in Boston about the benefits and technicalities of open web standards for Video and Audio. Lots of examples how to manipulate live video using CSS3 and Canvas.
This document discusses developing applications that can run across multiple mobile devices and platforms. It covers designing interfaces that adapt to different screen sizes and densities, using media queries and application DPI settings. It also discusses configuring applications to target Android, iOS, BlackBerry and other platforms through application descriptors and compiler settings. The document demonstrates packaging and deploying a single codebase to different devices using command line tools like ANT build scripts.
Teflon - Anti Stick for the browser attack surfaceSaumil Shah
The document discusses the browser as the new "desktop" and main attack surface for web applications. It outlines the browser architecture and analogizes it to the kernel/operating system model. It then discusses exploiting browsers through techniques like heap spraying and return-to-heap attacks using JavaScript payloads. The document also introduces Teflon, a browser extension designed to prevent such exploits by inspecting and blocking offensive JavaScript vectors. Teflon was tested against real exploits and obfuscated payloads with success. Further research directions are discussed to improve browser security.
The document discusses various techniques for enabling offline functionality in Ajax applications, including browser storage options like cookies, Firefox offline storage, and Flash shared objects. It also covers approaches for pushing data from server to client like polling, asynchronous servlets, Comet, and piggybacking on other responses. The document concludes with considerations for optimizing Ajax performance such as data formats, bandwidth usage, and client-side processing.
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingTal Melamed
Testing Java client applications is not always straightforward as testing web applications. Even under experienced hands, there might be obstacles coming your way; what if you cannot use a proxy? How do you MitM? What if you just can't? How do you modify the app to your benefit?
Fortunately, Java is still Java. This lecture is based on a true story, and will follow an interesting case of pen-testing a known product; what tools and techniques can be used in order to jump over hurdles, all the way to the finish line.
The lecture aims to enrich the pentester's toolbox as well as mind, when facing Java client applications; MitM-ing, run-time manipulations and patching the code are only some of the discussed cases.
In addition, a newly developed proxy for intercepting and tampering with TCP communication over TLS/SSL and bypassing certificate-pinning protections, will be introduced during the lecture.
PhoneGap is an open source framework that allows developers to build mobile apps using HTML, CSS, and JavaScript. It works by wrapping web applications in wrappers for each mobile operating system so they can access native device APIs and app stores. Key features include access to device capabilities like the camera, geolocation, contacts and more. It supports building apps for Android, iOS, BlackBerry and other platforms.
This document provides an introduction to Android programming, covering Moore's law and mobile device hardware capabilities, the Android software development checklist, basics of the Android graphical user interface, getting started with Android code, and running your first "Hello World" Android app. Key topics include the ingredients needed for an Android app, using XML to define app layout and components, implementing activities and handling events, and describing the app in the Android manifest file.
GTLAB Installation Tutorial for SciDAC 2009marpierc
GTLAB is a Java Server Faces tag library that wraps Grid and web services to build portal-based and standalone applications. It contains tags for common tasks like job submission, file transfer, credential management. GTLAB applications can be deployed as portlets or converted to Google Gadgets. The document provides instructions for installing GTLAB, examples of tags, and making new custom tags.
This document provides an overview of the architecture and components used in an AI assistant called Otto. It describes the base software including Docker, Node.js, and MongoDB. It also outlines the natural language processing, speech recognition, text-to-speech and other modules. It details the client and messaging bot architectures and includes information on I/O drivers, actions, fulfillments and the overall workflow. Finally, it lists some example intents and provides guidance on developing new actions and the hardware used including the Raspberry Pi, Re-Speaker mic HAT and power components.
1. The document introduces Swift Localhost, a tool for writing localhost UI tests in Swift. It allows setting up a mock localhost server to handle API requests from the app under test.
2. Common problems with traditional end-to-end tests like brittle tests and slow execution are discussed. Localhost UI tests address these by mocking API responses at a faster, isolated integration level.
3. The key aspects of setting up and asserting localhost requests are explained, including routing requests to the localhost server, configuring mock responses, and validating the expected request paths and cURL commands.
This document summarizes a presentation about creating voice applications using Tropo. Tropo allows developers to build voice applications using common programming languages like JavaScript, Ruby, Python, and Groovy. It provides APIs for telephony functions like answering calls, speaking prompts, processing input, and transferring calls. Examples show how to build simple applications that greet callers, ask for input using speech or touch tones, and transfer calls. The presentation argues that Tropo simplifies voice application development by allowing web developers to use familiar languages instead of specialized telephony standards.
Similar to Device Emulation with OSGi and Flash (20)
49. A Quality Gate... ...through, continuous and automated testing
50. Logging <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages <2009-17-06 13:12:14> INFO : Test : some log messages
64. Copyrights & Trademarks “ Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries." “ OSGi is a trademark of the OSGi Alliance.“ “ iPhone is a trademark of Apple Inc.“ “ Flash is a trademark of Adobe Systems Inc.“ “ Android is a trademark of Google.“
Editor's Notes
Welcome Words: Hello my name is _ and I work for MicroDoc in Munich Most of the time I work on embedded projects using OSGi as a runtime platform Today, I talk about Device Emulation with OSGi and Flash
So, first of all. What is Device Emulation ? Emulated Devices are v irtual mobile devices that run on your computer
There a lot of different emulators available like -> NEXT SLIDE
There a lot of different emulators available like -> THE IPHONE EMULATOR
Or, an EMULATOR for Google Android
But not just for phones, but also for devices like a GAME BOY…
Or an emulator for an ACCESS GATE
Why is there a need for emulating devices ?
THIS SLIDE: Consider the classical case developing software for embedded devices You have a laptop or a computer, where you develop the code Next, you have to deploy the code to the target environment Once, the code is deployed and your application is up and running you have to test it manually (in most cases) If you discover any bugs, and of course there will be some, you’ll have to start remote debugging. In order to reproduce the bugs, the device has to be setup into a certain state -> which requires another couple of manual steps to do. Once you have found and fixed the bug. The new code has to deployed again and the whole game repeats. This is a very time consuming workflow !!! NEXT SLIDE: Beside time, there is another issue with embedded software development. Consider a team of 10 developer, where each developer needs one device for development
If your team develops iPhone applications this might not be very expensive ….beside the fact of a two year contract… BUT: next slide
If you develop applications for bigger embedded hardware, money can become an issue Like, for an ACCESS GATE from Skidata
Now consider that you have a distributed team. Maybe even a worldwide distributed team, where developers are located in India or China Beside the hardware costs you have to add the shipping costs If your hardware is now as big as SKIDATA’s Access gate, the costs for shipping may explode
So to sum up, by having Device Emulators you can: SAVE TIME,….and SAVE MONEY
Now, let’s take a look at how we have done device emulation. All ideas & implementations presented now, have been developed within a customer project for Skidata. The aim of the project was to develop an EMULATOR for the Access Gate that you have seen on the previous slides !
Before we start to describe emulation I’d like to clarify the notation: What is a device ? The word “device” is general term and can mean anything A toaster can be called a “device” A washing machine can be called a “device” or A mobile phone can be called a “device” or And so on… What we now mean by device is the following -> NEXT SLIDE
Consider the iPhone “device” If we take a closer look at it, we see that the iPhone is assembled by several other devices Here we have: A Display device A GSM Modem device An Audio Device What we now mean by the word “device” is peace of hardware that has a very special purpose, like the GSM Modem.
If we take a look the Access Gate “Device” we can identify the following real devices: Display Device RFID Device (for ticket scanning) Barcode Device (for ticket scanning) Lightsensor Device
Now what about OSGi and Flash ?
The special thing about the ACCESS GATE is that the embedded application running on the gate is based on OSGi & Java As an embedded Java VM, we are using a ported version of IBM’s J9 Java Virtual Machine. The porting has been done by MicroDoc. As the OSGi runtime, we are using Eclipse Equinox
Now, let’s take a deeper look into the embedded OSGi software solution. Here we have the two worlds of development: the Hardware side and the Software side On the one side we have hardware devices: For example: RFID reader, Turnstiles, Sensors,… And on the other side we have SW that controls the hardware. In other words these software devices are like “device drivers” On top of the devices we have a business application Each component in the architecture is represented by an OSGi bundle This design allows a simple approach for emulation
In the emulator that we have build for Skidata, hardware devices are RFID Reader, Barcode Reader, Lightsensors, and so on.
In order to emulate these hardware devices, we have to replace the software device by emulated devices.
So there is no need for the hardware any more.
Let’s look how we have implemented an “emulated device” Our device is split into two parts: Into a JAVA part that implements the device API, and Into a FLASH part that implements all graphical elements.
The interesting thing now is, how does the Java part communicate with the Flash part ? Basically, there are 5 ways to communicate:
The simplest way to communicate is by using URL Encoding: In order to communicate, you can send a URL with parameters encoded in strings. On the other side, you simply parse the request parameters and process them The drawback is that the URL request forces to load a response page, which means reloading the Flash session. So this approach is not suitable for our emulator.
As an improvement over straight URL encoding, you can use a LoadVats object. It is still an asynchronous HTTP transmisson but without reloading the Flash Movie. However, asynchronous transmisson is also not suitable for an emulator that should react fast.
The third approach to communicate is via XML Objects It works basically the same as with the loadVars object, but transmits XML objects instead of loadVar objects The sender has to build a String message, send it, and on the receiver side the String message has to be parsed again. Again, the request is an HTTP request with all its drawbacks.
Instead of using an XML object through HTTP, you can use a XML-socket persistent connection This connection is ideal for fast-responding applications like games, or an emulator application The drawback is that you have to build and parse XML, which introduces some development overhead.
All of the previous methods basically transfer string information. A more sophisticated approach is via Flash Remoting Flash Remoting is a binary protocol over HTTP or HTTPS The drawback of the remoting protocol is that it uses a proprietary format.
We use XML socket because, We need a communication that allow fast responses, and Because we do not want to use proprietary formats.
In the HW emulator a lot of special purpose devices need to be emulated Each Java and Flash part have to implement the communication layer/protocol via XML Sockets To simplify the development of new emulated devices we have implemented a framework that does most of the job
We use XML socket because, We need a communication that allow fast responses, and Because we do not want to use proprietary formats.
Framework Feature 1: The most important feature is the communication between the Java and the Flash part
Framework Feature 2: OSGi is dynamic module system where bundles can be installed, started and stopped on runtime. Emulated Device are also OSGi bundles that can be started and stopped. However, the tricky part is to bring this dynamic loading mechanism into the world of Flash. Our framework supports dynamic loading of Flash components.
Framework Feature 3: Consider the following use case with an access gate in a ski resort: A skier comes across The skier hides light-sensors The Skier’s RFID Ski-Ticket is read The application evaluates the Ticket The application shows something on the Display The application opens the turnstile So we have certain events (sensor events) and actions (application reactions) These are very common situations that you like to test very often By using the GUI of the emulator you’d have to manually trigger all events, and you have to verify the correct application response also manually !! By using our Emulator this tasks can be automated
Framework Feature 3: What we now want to automate are the event triggers. Application responses, calls Actions here, happen on behalf of the application The emulator can now be programmed to trigger events Event can be triggered by time Or by action. This means if a certain action happens, a defined event is thrown.
Framework Feature 3: The emulator behavior is represented by an XML file that is loaded into the simulator The language to write the behavior is in its current implementation very basic, but it might be of use to introduce e domain specific language for programming emulator behavior.
Feature 4: The feature to automate the trigger of event is very useful, but we can get a step further: “ WHY NOT ALSO CHECK IF ACTIONS (THAT ARE APPLICATIONS RESPONSES IN FACT) ARE CORRECT ?” What we do is, we simply compare actual actions with expected actions.
Executing a testcase includes the following steps: Write a test case Load a test case Execute that test case
Do we really need a GUI ?
Do we really need a GUI ?
How do we trigger tests without a GUI ?
In order to trigger the execution of emulator test cases, we ca use the eFitNesse testing framework. eFitnesse is a testing framework that allows the definition of test cases within a human-readable form: an excel sheet, a wiki page. Moreover, eFitnesse allows to execute test-cases on a remote embedded device.
eFitnesse can trigger the testcases eFitnesse can be included in an automated build and test process.
So with eFitnesse, testcases can be executed on the emulated and on the real device
So what we get by using the emulators with the framework is a “A Quality Gate through, ...through, continuous and automated testing”
This is not major feature, but to complete the feature list I want to mention it here: Logging is also supported by the framework – as well as for the Java side, but also on the Flash side.
Using two different technologies to interoperate introduces some effort to get things working I’d like to point out some of the issues that we encountered.
First, Flash has a security sandbox which restricts access. For example access to the local file system very limited. Moreover, a lot of security settings have to be made.
A flash local connection can be used for communication between different flash files. Such connections have been used to implement the dynamic loading of the emulator flash parts The special thing is that a local connection has a machine-wide unique string id. Event if the same id is used in a completely different Flashmovie. Our solution was to dynamically generate such ids
Flash Error Debugging: The picture on the slide shows a runtime error….. That occurred in line 1050. However, the class does only have 150 lines of code….so where did the error happen ??
Now, you might be thinking…..”well, Flash is cool, but there are a lot of issues that need to be solved. Why shouldn’t I use Swing instead ?” Good question !
The first reason to use Flash was: the excellent support of implementing Animations, like a turning turnstile, or a blinking traffic light.
The second reason was: User Experience, or in other words Look & Feel. With Flash you can build an relatively easy good looking GUIs I am sure that by using Swing or SWT you might also get good looking GUIs,…but
…but if take a look at the labor market, we see that there is a huge number of developers and designers for the Adobe Product Line, and only few for SWT/SWING
JavaFX does also a pretty good job concerning ANIMATION, and With JavaFX it is also possible to implement a great Look & Feel BUT: JavaFX was simply not available when our project started.
Is the framework open source: The answer is: No, not at the moment. But maybe in the future
Now I want to show you the Skidata Emulator: Here you can see a picture of the device. The SKIDATA FREEMOTION TURNSTILE The Turnstile is assembled by couple of special purpose devices: Turnstile VGA Display Barcode Ticket Reader RFDI TicketReader
I am now finished with my presentation. Are there any questions ? or comment ! ?