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 provides extensions revealed to be useful when binding components with one another using specific protocol (CORBA, JSON, SOA/HTTP). To 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 an 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 search criteria 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 a 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 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 predefined list will be interesting there. This emphasis then the need to create a  currencies datasource, from which they can all be loaded, and their values 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 quantities 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 (items and quantites) 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             

    Resources 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 thoughrout 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 path. 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 be in thumbanails format (32*32).
         

        Web App Store

Note: Review of the ShoppingCart Implementation in order to take in count items quantity;

  • Configuration file;

 Will mainly contains path to the resources.

        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 screens

            *    Store Home page which will include a search form and 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-arrange the item's attribute that are to be displayed. Items quantity can be typed in from the list.
                *    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 practical switch between them. Any other proposal surely will be welcomed and discussed. 

UI prototype proposal adapted to the current version of the store catalog items attributes (Name - price) below.


 

 

                   

  •   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. A last preference for the application could be about setting its theme.

Complete bootstrapping of Tuscany extensions in an android module           

  • Get Android.jar sources of the android SDK using Git and Repo as described at: http://source.android.com/download/using-repo#TOC-Task-reference in a directory named "Android"
  • Add tuscany extensions sources files (Java, meta-inf...) to the "Android" folder;
  • Iterate all over the subdirectories in the "Android" folder and check whether java source files paths match their package name using a script written in java;
  • Build the Android folder content (using ant for exemple) to android .jar. This jar will already contain meta-inf and other non .java files of Tuscany extensions;
  • Convert the jar into a dex using the ADT "dx" tool as described here: http://developer.android.com/guide/developing/tools/othertools.html#dx
  • Drop the dex file at the right place in the device.

Expected results and schedule

  • Store web app service: May 23 - June 20
    • Catalog component: Retrieve full catalog from XML datasource files;
    • CatalogBrowser Component: Retrieve catalog items based on a specified query;
    • ShoppingCart component:  Support now cart total calculation taking in account items quantities;
    • CurrencyConverter component: Currencies symbol and value computation based on an XML file
  • Android Store client: June 20 - August 10
    • "services" package update in order to fit the new offered services;
    • Complete implementation of the 6 screens quoted above;
  • Additional tests, UI reviews and thoughts on possible additional features like an M-Payment service implementation: August 10th - August 17th;
  • According to how fast i advance on the project the rating service may be implemented before or after the end of the GSOC programm:
    • On the web app side, the component should retrieve items' ratings and recalculate note after a new rating submission from an end user.
    • On the android client side ratings should be loaded, and each item could be rated if of course the user enables this fonctionnality in his preferences.

 Note: From April 20 to May 23, i'll be reading documentation on The Apache Software Foundation or more precisely The Tuscany project's coding principles, and exchanging with the tuscany SCA community on probable issues, documentation and materials related to the project.

Development environment

  • Android Debug Bridge, Development Tools  and Emulator.
  • 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.        

About Me

Birth Date:                           22 Juin 1987
Home Country:                     Benin Republic
Country of residence:            France
School:                                National School of Applied Sciences - Agadir / Morocco Kingdom.
Technical skills:                    C, C++, C#, VB.net, Java, Batch, Shell scripting, HTML, CSS, XML/XSD/XSL/XPATH/DTD, Javascript, ASP, PHP, JSP.
Relational skills:                   Dynamism, Motivation, Ability to work as a team member, Good sense of creativity imagination and share knowledge, Curiosity.
Time dedication:                   Roughly 30-35 hours per week.

  • No labels