Apache DeviceMap - ApacheCon Europe 2014

  • Published on
    29-Jun-2015

  • View
    442

  • Download
    12

Embed Size (px)

DESCRIPTION

We experience a growing number of mobile phones, tablets, phablets, smart TV and similar devices flooding the market almost every day. Capturing the specification of each device is a tough job. If you want to create a comfortable user experience you need dynamic content according to hardware and browser specifications of your device. Thats the reason why Device Description Repositories (DDR) exist. Apache DeviceMap is a collaborative effort to create a comprehensive open-source and open-data repository of device information, images and other relevant information for all types of mobile devices, smartphones, tablets, smart TV, etc.. Much of the code was donated from the OpenDDR project, and participants come from many different companies. The project began in January 2012, later that year OpenDDR contributed DDR APIs for Java and. NET. Ongoing steps are a common device repository, a storage structure and maintenance of device data by the Apache community.

Transcript

<ul><li> 1. Apache DeviceMapWerner Keil@wernerkeil | wkeil@apache.org</li></ul> <p> 2. Agenda Introduction History and Comparison Project Brief Tests and Results Examples and Demo Outlook Conclusion11/18/2014 2 3. Who am I? Consultant Coach Creative Cosmopolitan Open Source Evangelist Software Architect JCP EC Member DevOps Guy Twitter @wernerkeilEmail wkeil@apache.org11/18/2014 3 4. INTRODUCTION 5. What is a DDR?11/18/2014 6 6. What is a DDR?11/18/2014 7 7. What is a DDR?11/18/2014 8 8. What is a DDR?11/18/2014 9 9. What is DeviceMap?Day after day we all experience an incredible growth andfragmentation of devices available on a more and moreproliferated market.Accurately tracking their specs has become very hardwork.But this complexity can be reduced if managed by acommunity daily involved in improving the DeviceDescription Repository (DDR).This is the essence of the DeviceMap project, the bestopen and free repository of device descriptions currentlyavailable.11/18/2014 10 10. Why is DeviceMap different?If you want a comfortable user experience, you needdynamic, responsive content according to hardware andbrowser of your device.Device Description Repositories (DDR) are databases thatplenty of information concerning mobile phones, tablets,Interactive TVs, set top boxes and any device having aWeb browser. DDR allow developers to realize applicationsproviding appropriate user experience on each clientThere are several DDR projects, most demand often heftyfees to access to their databases and APIs or restricts freeuse to non-commercial applications.11/18/2014 11 11. HISTORY 12. WURFL Wall11/18/2014 13 13. WURFL Wall since August 201111/18/2014 14 14. WURFL no longer Open Source11/18/2014 15 15. Project ComparisonProject Strength Weakness LicenseMaDDR Project The interface is aW3C standardDevice repository only withcommercial mobileAware DDR (theAPIs are bundled with a smallsample DDR)The maDDR project cannot offer anadaptation technology that usesrepository knowledge to guide itsprocesses.Repository:Commercial licenseonlyAPI: Commerciallicense OR SimpleDDR APIimplementationlicensed as LGPL.DeviceAtlas Data is multi-sourcedfromindustry-leadingpartners.Some W3CcomplianceOnly commercial licenses. Repository:Commercial licenseAPI: CommerciallicenseVolantis Relatively widedevice coverageOnly commercial licenses.Multiple takeovers, the new ownerdoes not show support for it anymore.Repository:Commercial licenseAPI: Commerciallicense11/18/2014 16 16. Project Comparison (2)Project Strength Weakness LicenseWURFL FormerCommunity project(till Aug 2011)The license does not allow to usethe DDR without accessing throughthe WURFL APIthe API does not allow use inprojects with a proprietary licenseRepository: Use notallowed if accessedwithout WURFL APIsAPI license: duallicensing AGPL andcommercial(Changed sinceAugust 2011)51Degrees.mobi More Predictableproduct catalogue,.NET SupportFree license contains fewerdevices, usually less accurateRepository: MPL orCommercial(Pro Edition)API: Mozilla PublicLicenseNetBiscuits Service based,seems easy tointegrate at leastvia JavaScriptFree and SME offerings dependenton using their JavaScript , no APIbelow Enterprise or OEM pricerangeRepository: N/AAPI: Commerciallicense11/18/2014 17 17. PROJECT BRIEF 18. What was Contributed? In late 2011 a few months after OpenDDR started,Apache committers and members got aware of thetechnology and its relevance, too. Deciding to createboth a unified Device Repository and APIsfor common languages including Java. OpenDDR is a Founding Member of the DeviceMapIncubator. And made initial contribution of W3C DDRLibraries for Java and other languages as well asresource data. Also see the Proposal Wiki:http://wiki.apache.org/incubator/DeviceMapProposal11/18/2014 19 19. Metro DeviceMap for .NET11/18/2014 20 20. Why Open Standards? DeviceMap stakes on open standards: Repository is fully compliant with W3C DDR SimpleDDR library implements the W3C DDR Simple APIs From a developer point of view: You can start developing your application with confidence thatyour product will work with any W3C DDR Simple APIimplementation, no binding to DeviceMap DDR implementation Adopting a W3C standard, the Copyright of these interfaces isowned and protected by W3C against any IP or patent claim The Apache License means that you are free to use allof DeviceMap in open source or proprietary software.11/18/2014 21 21. What's different in DeviceMap? Users can update the operating systems of their deviceseither with custom builds, or just install a new browser. E.g. Googles Project Ara aims for modular devices withan almost endless combination of capabilities. The identification of a device through the original UserAgent exposed by manufactures is no longer sufficient. DeviceMap considers the device as a combination ofthree important aspects:Physical DeviceOperating SystemWeb Browser11/18/2014 22 22. Level of Confidence DeviceMap can identify custom builds of the operatingsystem and third party browsers. If a particular version of a browser or an operatingsystem is not recognized, DeviceMap returns informationabout the closest version rather than not returning anyinformation at all. DeviceMap identifies a device, a web browser or anoperating system with a certain level of Confidence. You can specify the threshold as a target to achieve inthe identification process. The higher the confidence theslower or more memory consuming the process may be.11/18/2014 23 23. Patching and Optimization Lowering the confidence speeds upthe process, even if you can have less accurate results. DeviceMap supports Patching the data source. In DeviceMap we can specify a reduced vocabulary in order tolimit the memory load. It can be specified in the oddr.limited.vocabulary.path property ofthe DeviceMap properties file. It allows developers to choose which properties need to beloaded in memory at startup from the datasource. In most casedevelopers need only a subset of properties from the datasource.11/18/2014 24 24. TESTS 25. How we tested? We compared DeviceMap with WURFL API (1.3.1) interms of memory load in two situations:Without limited vocabularyWith limited vocabulary We used jMeter as workload generator, configuring it inorder to generate 100 requests per seconds from 10workers with a different user agent. The user agents setcontained ten of most common user agent observed in areal environment. Both DeviceMap DDR and WURFL API were tested in asimple web app.11/18/2014 26 26. WURFL Memory Load11/18/2014 27 27. Unreduced DeviceMap Memory Load11/18/2014 28 28. Reduced DeviceMap Memory Load11/18/2014 29 29. Test Results We chose as limited vocabulary the W3C corevocabulary The memory load of Apache DeviceMap with limitedvocabulary is only about50MB and after initialization, DeviceMap won't show amemory spike. Both APIs identified correctly all the user agents in theHTTP request11/18/2014 30 30. SAMPLES 31. DDR ConfigurationDeviceMap DDR implements W3C Simple DDR interfaces. It supports thecore vocabulary as specified by the DDR W3C recommendation.To use DeviceMap Simple DDR you need to configure a property file as follows:oddr.ua.device.builder.path=PATH/BuidlerDataSource.xmloddr.ua.device.datasource.path=PATH/DeviceDataSource.xmloddr.ua.device.builder.patch.paths=PATH/BuilderDataSourcePatch.xmloddr.ua.device.datasource.patch.paths=PATH/DeviceDataSourcePatch.xmloddr.ua.browser.datasource.path=PATH/BrowserDataSource.xmlddr.vocabulary.core.path=PATH/coreVocabulary.xmloddr.vocabulary.path=PATH/oddrVocabulary.xmloddr.limited.vocabulary.path=PATH/oddrLimitedVocabulary.xmloddr.vocabulary.device=http://www.openddr.org/oddr-vocabularyoddr.threshold=70The oddr.threshold property allows the developer to specify the desiredconfidence to achieve the identification.In this case we want a confidence of at least 70%.11/18/2014 32 32. DDR Service RetrievalTo create the identification service we use the ServiceFactoryof W3C DDR-Simple-APIinitializationProperties.load(context.getResourceAsStream("/WEB-INF/oddr.properties"));Service identificationService =ServiceFactory.newService("org.apache.devicemap.ddrsimple.ODDRService",ODDR_VOCABULARY_IRI,initializationProperties);The first argument is the class implementing the DDRService;the second argument is the default vocabulary used in theidentification if the vocabulary is not specified;the third argument is the SimpleDDR properties file.11/18/2014 33 33. New Java ClientWhile departing from W3C compliance a new Java client offersmore flexibility e.g. when it comes to ways of loadingdevice data.Data can be loaded via: URL JAR file File systemGet client using data from a URLDeviceMapClient client =DeviceMapFactory.getClient(LoaderOption.URL,"http://devicemap-vm.apache.org/data/latest");11/18/2014 34 34. New Java Client (2)Get the client using JAR data sourceDeviceMapClient client =DeviceMapFactory.getClient(LoaderOption.JAR);Get client using data from file systemDeviceMapClient client =DeviceMapFactory.getClient(LoaderOption.FOLDER,"/some/path/devicemap/latest/devicedata");The last option is closest to the W3C DDR client.11/18/2014 35 35. DEMO 36. Links DeviceMap Servlet Example on Apache VM:http://devicemap-vm.apache.org/dmap-servlet DeviceMap Spring Example on Apache VM :http://devicemap-vm.apache.org/dmap-spring11/18/2014 37 37. Outlook As of November 2014 after releasing W3C DDRcompliant device data andnew clients beyond W3C for Java, .NET orJavaScript, DeviceMap is ready to graduate fromthe Apache Incubator. You should find it soon under:http://devicemap.apache.org11/18/2014 38 38. Conclusion Open, free, based on W3C standard. Update to DDRby the community and device manufacturers. Identification is not only for the device as a single entitybut extended to the web browserand the operating system. DeviceMap can identify thirdparties web browsers and customized operatingsystems. A developer can specify the vocabulary andthe aspects of the property he wants to know. Easy migration: Device Repository an some DeviceMapAPIs are compatible with W3C DDR11/18/2014 39 39. Conclusion (2) Based on identification threshold. When a particularbrowser version is not recognized, DeviceMap returnsproperties of the nearest version, if this satisfies thedefined threshold. Developers can choose which properties to be loaded inmemory by specifying a limited vocabulary No Waste of Memory. Patch Support: if you want to change or update yourrepository you can do that.It is simple to add new properties updating your DDRand your vocabulary.11/18/2014 40 40. Links Apache DeviceMap Incubator Site:http://incubator.apache.org/devicemap/ DeviceMap Sources and Data:http://incubator.apache.org/devicemap/source.html Mailing Lists:http://incubator.apache.org/devicemap/mailing-lists.html BrowserMap GitHub Mirror:https://github.com/apache/devicemap-browsermap11/18/2014 41 41. Links (2) Apache Sling DeviceMap Demo on GitHub:https://github.com/raducotescu/devicemap-demo Wikimedia LogCapturehttps://github.com/wikimedia/mediawiki-extensions-DeviceMapLogCapture Miri DDR:www.ducis.net/Miri/DdrTwitter @wernerkeilEmail wkeil@apache.orgProject Twitter @DeviceMap11/18/2014 42 </p>