Title/Summary: Empower Google Android applications to easily consume business services
Student: SANNI Lookman Olalekan
Student e-mail: lookouster@gmail.com
Student Major: Software engineering
Student Degree: Graduate
Student Graduation: 2009
Organization: The Apache Software Foundation
Assigned Mentor: Possible Mentors: Oscar Castañeda (ocastaneda AT apache DOT org) Adriano Crestani (adrianocrestani AT apache DOT org)
Abstract
Nowadays, the mobile systems world is growing as the need of common services consumption from phone is getting more effective. Thus, services-based mobile apps are more of household word as they can easily run on our usual mobile phones. This relatively new approach of systems development and services delivery known as "Service Oriented Architecture" is based on constructional model described by a set of specifications called "Service Component Architecture" SCA.
The Apache Tuscany Project implements the SCA specifications and easier SOA developments by it's comprehensive infrastructure of components that can be assembled into applications called composites. Tuscany also provide extensions revealed to be useful when binding components with one another using specific protocol (CORBA, JSON, SOA/HTTP).
bTo make a bright and effective use of Tuscany SCA's opportunities, applications are to be developed on fully featured and OPENED platform so that innovative and reusable solutions and components can be created and reassembled. The new Google Android Mobile platform provides such features(opensource, extendable, operating system, api, sdk, middleware, adequate tools) and has consequently been targeted to host tuscany and to demonstrate it capabilities under the "tuscany-host-android" subproject. Started last year at GSOC08, the project has been going peacefully along, and great efforts have already been accomplished including porting tuscany SCA(core/runtime + extensions) in a light version onto Android and partially implementing an android store app, which consumes services from a SCA friendly store app.
For the current GSOC edition, it'll be about completing the Android SCA Runtime module, and mainly demonstrating Tuscany's SCA capabilities by extending the existing android store application.
Detailed Description
The main goals of this project are to port a light version of tuscany onto android and to illustrate its capabilities via a web store mobile service consumption from an android client.
Review of what's been done
- Bootstrapping extensions (almost completed)
- Implementing Android store app: This has started already. For now the original android store or the service can be contacted to retrieve the catalog using Android native JSON. Adding and removing product items to cart and submitting shopping cart in order to get its total is not implemented yet and the store functionality are still basics.
Proposal description
The following describes what I intend to do for the project and how i'm going to perform it.
Android Store extension
Store service consumption scenario
Android client: Makes a call to the catalog service in order to retrieve the full catalog or part of it by specifying a search criteria. This will result into a JSONRPC invocation having the webservice URI and the request querystring as parameters.
Store web App: Will Answer to the call, and load the catalog items from a datasource, probably XML file. Either all items or a part equivalent to the user's request, will be loaded and sent back to the Client as JSON String. In case it's a request for a part of the catalog, the catalog service will not do the search itself, but will just reference another a catalogBrowser service to perform the search. Another process should there be undertaken too, to decide how items are going to be displayed, according to the catalog currency. Handling automatically the switch from a currency to another and providing the choice of currency from a user predefine's list will be interesting there. This emphasis then the need to create a currencies datasource, from which they can all be loaded, and their value easily be converted to one another. A simple xml file once again will make it.
Android Client: Parses the query result, builds then the catalog and loads it to the Android Activity. The user may then select items he's interested in and validate. Validation will cause the shoppingCart service call in order to request the cart total from the server using the same principle as the one quoted for the catalog retrieval.
Store web App: Process to the total calculation using parameters passed via the request, and send it back as a JSON String.
Users can also rate products. Implementing this community option feature may help other users in selecting products. This feature will be optional and users should be able to enable it or not.
A mobile payment procedure could also be undertaken, but this may come at last.
According to that scenario, the project can be divided in three parts as quoted below:
Ressources:
- Currencies.xml;
- Store.xml;
- Product images folder;
- Customer ratings file (leave as last).
Web App Store
+ Configuration file;
Android Client Store
Ressources description
- Currencies.xml
This file will contain all possible currencies the store can use. This means an extension of the number of currencies that can be used.
It should reference one of the currencies as the reference currency, and all conversions will be made passing by it. A DTD or a schema
validation may be implemented to validate it's structure.
Structure:
<?xml version="1.0" xmlns="http://www.w3.org/">
<currencies>
<Reference CurrencyCode="USD" CurrencySymbol="$">
<currency code="EUR" value="1.3" symbol="€"/>
......
</currencies>
- Store.xml
This file will hold all catalog items and attributes like the store name, catalog currency. For each catalog item, it will describe it's
category, name, price, image file. A DTD or a schema validation may be implemented to validate it's structure too. Find a sample below.
<?xml version="1.0" xmlns="http://www.w3.org/">
<store xmlns="http://www.w3.org/">
<configuration currency="USD" name="Tuscanily"/>
<catalog>
<category name="fruits">
<item name="Pear" price="2.2" image_file="fruits/pear.gif"/>
<item name="Apple" price="1.2" image_file="fruits/apple.gif"/>
</category>
<category name="Bakery">
<item name="Bread" price="0.7" image_file="bakery/bread.gif"/>
<item name="cake" price="3.2" image_file="bakery/cake.gif"/>
</category>
</catalog>
</store>
- Product images
This directory on the server will contain a subdirectory for each catalog category., and every product may have it's image in the relevant
category. Default images may be provided. Due to the size of the end user screen (mobile device), images size will be fixed to 30*30.
Web App Store
[1]
- Configuration file
Will mainly contains path to the ressources.
eg:
CATALOG_FILE="<path_to_the_file>"
CURRENCIES_FILE="<path_to_the_file>"
IMAGES_DIR="<path_to_the_files>"
Android Client Store: This part will be made of
- The store UI pages
* Store Home page with buttons driving to:
[X]
* Catalog categories page;
* Products list page - (This page should will show up after a category has been selected, or after a product search submission);
Items will be displayed in a listView using a simpleAdaptor to re-arrangee the item's attribute that are going to be
displayed.
* Product details page: displays all possible details about the product;
* Shopping cart page: Displays selected items, and the total.
[/X]
and
* Preferences page;
I intend to assemble [X/] pages under a same TabActivity, for a pratical switch between them. Any other proposal surely will be welcomed and discussed.
- The Services
* Completion of existing under the services package of the project. It'll be about writing already declared methods like those for:
* adding an item to the cart;
* removing an item from the cart;
* checking out the cart;
* New Service interface implementation for community opinions retrieval.
- Uses of Android preferences
In order to make users shopping cart available at next application launch, Android SharedPreferences feature will be used to save the cart contents to the application preferences. Also, as the community opinions is optional, users will be provided a way enabling or disabling the feature. The last preference for the application will be about setting its theme.
Complete bootstrapping of Tuscany extensions in an android module
Development environment
- Testing consumption from Android emulator of service hosted on my local machine will not be so hard as Android emulator provides networking feature of host loopback interface at 10.0.2.2.
- I'll be developing under Windows Vista, and Ubuntu alternatively.
- IDE: Eclipse. Of course, if the Apache Tuscany Project uses some other tools, i'll be pleased to use them.
Additional Information
About me
I'm a 22 years old Beninese student of National School of Applied Science in morocco.
toBContinued..........