(microsoft powerpoint - newpresentation [modalit\340
DESCRIPTION
TRANSCRIPT
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
tesi di laurea
Developing Google Android Mobile Clients for Web Services: a Case Study
relatore
Ch.mo prof. Stefano Russo
correlatore
Ing. Marcello Cinque
candidato
Vito Daniele Cuccaro
Matr. 885/83
Anno Accademico 2007/2008
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Main issueMain issueIs the new Google Android platform mature for developing Is the new Google Android platform mature for developing
mobile clients for Web Services?mobile clients for Web Services?
Goal of the ThesisGoal of the ThesisGoal of the ThesisGoal of the Thesis
Evaluating the Android platform through a case study (porting Evaluating the Android platform through a case study (porting of a J2ME client for accessing Wireless Sensor Networks).of a J2ME client for accessing Wireless Sensor Networks).
ContributionsContributions
��Pros and Cons of Android for WS mobile clients.Pros and Cons of Android for WS mobile clients.
��Fitting and Testing of the KSOAP solution for WS on Android.Fitting and Testing of the KSOAP solution for WS on Android.
��Proposal of a new AndroidProposal of a new Android--specific design pattern (AVA) for specific design pattern (AVA) for translating the popular MVC pattern.translating the popular MVC pattern.
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Background:Background: Web ServicesWeb Services
�� The most common The most common implementation of SOAimplementation of SOA
Key benefits:Key benefits:
Operational ModelOperational Model
Key benefits:Key benefits:
�� Accessible by anyone, Accessible by anyone, anywhere and from any deviceanywhere and from any device
�� B2B and EAI supportB2B and EAI support
�� Dynamic location and Dynamic location and invocation of servicesinvocation of services
�� Interoperability among Interoperability among heterogeneous applications heterogeneous applications
�� Standard protocols and Standard protocols and
data exchange format data exchange format
Core StandardsCore Standards
�� XML and XML and ebXMLebXML
�� WSDL and UDDIWSDL and UDDI
�� SOAPSOAP, the , the de facto de facto standardstandardfor invoking Web Servicesfor invoking Web Services
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
BackgroundBackground: The Google Android Mobile Platform: The Google Android Mobile Platform
Software StackSoftware Stack
�� Developed within OHADeveloped within OHA
�� A software stack for mobile devices including A software stack for mobile devices including OS, middleware and key applicationsOS, middleware and key applications
Key features:Key features:
�� Developed within OHADeveloped within OHA
�� Open source under Open source under Apache licenseApache license
�� Laying on a Linux 2.6 Laying on a Linux 2.6 KernelKernel
�� Applications written in Applications written in JavaJava
�� Has its own APIs (as well Has its own APIs (as well as some of Java)as some of Java)
�� Uses its own VM (Dalvik)Uses its own VM (Dalvik)
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Developing an Android ApplicationDeveloping an Android Application
�� ActivityActivity
Main components:Main components: ToolboxToolbox::�� Eclipse (or Eclipse (or
NetBeansNetBeans) plugin) plugin
Application LifecycleApplication Lifecycle
�� ServiceService
�� Broadcast ReceiverBroadcast Receiver
�� Content ProviderContent Provider
Other key concepts:Other key concepts:
�� IntentIntent
�� Intent FilterIntent Filter
�� NotificationNotification
�� ManifestManifest
�� XMLXML--defined GUIdefined GUI R.javaR.java
NetBeansNetBeans) plugin) plugin
�� FullFull--featured SDK featured SDK with Debug Monitorwith Debug Monitor
�� Device EmulatorDevice Emulator
�� Online Doc and Online Doc and SupportSupport
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Android and Web Services: state of the artAndroid and Web Services: state of the art
�� No native solutions available yet No native solutions available yet (SOAP APIs for WS invocation) (SOAP APIs for WS invocation)
KSOAPKSOAPMain Developers’ proposalsMain Developers’ proposals
�� “Homemade” solution: “Homemade” solution:
HTTP connection + HTTP connection +
manual XML parsing (SAX)manual XML parsing (SAX)
�� kXMLkXML--RPC (lightweight solution) RPC (lightweight solution)
�� KSOAP KSOAP
KSOAPKSOAP
�� A popular openA popular open--source source mobilemobile--oriented oriented SOAP implementationSOAP implementation
�� Basically a client library for Basically a client library for invoking web servicesinvoking web services
�� Tested on JavaTested on Java--based based devicesdevices
�� Now in version 2 Now in version 2
(1 is deprecated)(1 is deprecated)
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Case Study:Case Study: the ICAAS framework for accessing WSNthe ICAAS framework for accessing WSN
�� Software architecture for accessing Wireless Sensor Networks Software architecture for accessing Wireless Sensor Networks developed at developed at MobilabMobilab within the REMOAM project within the REMOAM project (by CINI and (by CINI and Strago s.r.l.Strago s.r.l.))
�� Non standard implementation Non standard implementation The ArchitectureThe Architecture
�� Non standard implementation Non standard implementation of the OGC Sensor Web of the OGC Sensor Web Enablement specificationsEnablement specifications
Key features:Key features:
�� Interoperable & ConfigurableInteroperable & Configurable
�� ExtensibleExtensible
�� Requests optimization Requests optimization (Caching and Filtering)(Caching and Filtering)
�� ROA and SOA accessROA and SOA access
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
ICAAS Web Services ICAAS Web Services for SOA access:for SOA access:
ICAASMobile: a J2ME test clientICAASMobile: a J2ME test client
�� SOA access to ICAAS through WSSOA access to ICAAS through WS
�� Real Time monitoring of WSNReal Time monitoring of WSN
�� Session managementSession management
�� Tested with a WSN simulatorTested with a WSN simulator
�� Notification ServiceNotification Service
�� Observation ServiceObservation Service
�� Collection ServiceCollection Service�� Tested with a WSN simulatorTested with a WSN simulator
Technology note:Technology note:Apache AxisApache Axis(a Java(a Java--based SOAP based SOAP implementation) implementation) used for WS deploymentused for WS deployment
�� Collection ServiceCollection Service
�� Alert ServiceAlert Service
�� Planning ServicePlanning Service
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Case Study:Case Study: Porting ICAASMobile from J2ME to AndroidPorting ICAASMobile from J2ME to Android
A typical porting processA typical porting process
Assessing Migration FeasibilityAssessing Migration Feasibility 1.1. All functions of the original client are All functions of the original client are achievable on Android (doubts were achievable on Android (doubts were raised about invoking Web Services) raised about invoking Web Services)
5.5. ++ approach: add one function at a ++ approach: add one function at a time and make it work before going ontime and make it work before going on
Understanding Initial Application Understanding Initial Application
Deciding Target Development ToolsDeciding Target Development Tools
Validating Original Design PlanValidating Original Design Plan
Deciding about Porting StrategiesDeciding about Porting Strategies
raised about invoking Web Services) raised about invoking Web Services)
2.2. Reverse Engineering of ICAASMobile Reverse Engineering of ICAASMobile to get SRS and software architecture to get SRS and software architecture
3.3. Eclipse with Android SDK pluginEclipse with Android SDK plugin
4.4. Decision to keep the same Decision to keep the same architecture and code base architecture and code base
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Invoking Web Services in Android: Invoking Web Services in Android: the KSOAP2 solutionthe KSOAP2 solution
�� Reliable (tested on other Reliable (tested on other mobile platforms)mobile platforms)
Advantages:Advantages: Disadvantages:Disadvantages:
�� Introduces overhead on Introduces overhead on constrained devicesconstrained devices
�� Easy to use Easy to use
�� Facilitates porting (the Facilitates porting (the original application uses original application uses KSOAP1)KSOAP1)
�� Some effort is needed to Some effort is needed to port a client from KSOAP1 port a client from KSOAP1 to KSOAP2to KSOAP2
Motivations for the choice:Motivations for the choice:
�� Reusing the original business Reusing the original business logic as much as possiblelogic as much as possible
�� Relying on a widely tested solutionRelying on a widely tested solution
ImplementationImplementation
�� Stub restructuring neededStub restructuring needed
�� The thread responsible for The thread responsible for WS invocation (through the WS invocation (through the stub) can be reused stub) can be reused
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Porting the MVC Pattern to Android: Porting the MVC Pattern to Android: the AVA solutionthe AVA solution
ModelModel--ViewView--ControllerController
�� Separating GUI from Business Separating GUI from Business Logic and Data AccessLogic and Data Access
AdapterAdapter--ViewView--ActivityActivity
Main issues:Main issues:
�� Android Views are not JavaAndroid Views are not Java--Logic and Data AccessLogic and Data Access �� Android Views are not JavaAndroid Views are not Java--coded but xmlcoded but xml--defineddefined
�� Who is the Controller?Who is the Controller?
�� Who is the Model?Who is the Model?
AnswersAnswers
�� Activity builds View from xmlActivity builds View from xml
�� Activity acts as ControllerActivity acts as Controller
�� Adapter plays Model’s roleAdapter plays Model’s role
Contribution:Contribution: a reusable design pattern for Android a reusable design pattern for Android
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
DroidICAASMobile: DroidICAASMobile: a Conceptual Modela Conceptual Model
AdapterAdapter
notifyDataSetChangednotifyDataSetChanged
createscreateschange dataset change dataset
ThreadThread
change dataset change dataset KSOAPKSOAP--based based WS invocationWS invocation
AVAAVA--based GUIbased GUI
ViewView
user inputsuser inputs
buildsbuilds Layout.xmlLayout.xml--------------------------------
ActivityActivity
setContentViewsetContentView
notifyDataSetChangednotifyDataSetChanged
updateupdate
user inputsuser inputsStubStub
KSOAPKSOAP
createscreates
createscreates
usesuses
Web Services
Web Services
invokesinvokes
responseresponse
responseresponse
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
DroidICAASMobile: DroidICAASMobile: example of useexample of use
Developing Google Android Mobile Clients for Web Services: A Case Study
Facoltà di IngegneriaCorso di Studi in Ingegneria Informatica
Critical Considerations about the Android ExperienceCritical Considerations about the Android Experience
��Average learning curve (probably slightly steeper than J2ME)Average learning curve (probably slightly steeper than J2ME)
��Advantages over other mobile platforms: xmlAdvantages over other mobile platforms: xml--defined GUIs, defined GUIs, open philosophy and full portability (at least in principle) open philosophy and full portability (at least in principle)
ConclusionsConclusions
��The KSOAP solution for invoking WS is working on AndroidThe KSOAP solution for invoking WS is working on Android
��Porting from J2ME is possible reusing most of the codePorting from J2ME is possible reusing most of the code
��The AVA pattern is a good option for designing Android GUIs The AVA pattern is a good option for designing Android GUIs
Future WorksFuture Works��Improvement of the developed client (under both functional Improvement of the developed client (under both functional and graphic aspect) and testing on real Android devicesand graphic aspect) and testing on real Android devices
��Testing of other solutions for Web Services (e.g. Testing of other solutions for Web Services (e.g. kXMLkXML--RPC)RPC)