Developing Google Android Mobile Clients for Web Services: A Case Study Facoltà di Ingegneria Corso 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
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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)
�� 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
�� 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
�� 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
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)