Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has...

28

Transcript of Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has...

Page 1: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised
Page 2: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 2

Table of Contents Background ..................................................................................................................................... 3

Problem Definition ........................................................................................................................... 3

Overview ......................................................................................................................................... 4

Relevant Concepts and Definitions ................................................................................................. 5

Software Requirements Specification .............................................................................................. 9

User Interface Specifications ........................................................................................................ 11

Design Document ......................................................................................................................... 12

Implementation ............................................................................................................................. 15

Conclusion and Futurework .......................................................................................................... 26

Appendix ....................................................................................................................................... 27

Bibliography/References ............................................................................................................... 27

Disclaimer: The views, processes, or methodologies published in this article are those of the authors. They do not necessarily reflect EMC Corporation’s views, processes, or methodologies.

Page 3: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 3

Background

In an educational institution, the teacher needs to notify the students of upcoming events such as

schedules of tests, classes, cancellation, holidays etc. Currently, email is the most preferred way of

officially communicating to the students. However, considering that most students carry a cell

phone with them all the time, it is much more useful to have a Mobile Notification System which

can send the required information to the students at the right time. This creates a need for storing

data in a database which can flexibly handle data scalability.

The student database must be stored on a server. Now, web applications using a conventional

client-server architecture often fail at handling data scalability, especially in current times when

data is being generated at an exponential rate. Moreover, the accumulation of data on local server

hardware costs a lot to an organization. The solution to such issues relating to the data to be

stored online for the use of web applications is - the cloud. The cloud can manage data and can

even scale well. A database stored on the cloud may be accessed from anywhere via the Internet.

There is no need to buy the hardware for servers; instead an organization can just use the various

cloud services to satisfy its requirements at a much lower cost. This background inspires the need

of storing the data for our project on the cloud. The cloud chosen is Google Docs. The data is

retrieved using the Google Spreadsheets API. It is completely free and apt for testing purposes.

Android is a popular Linux-based operating system for mobile devices such as smartphones and

tablet computers. Android has a large community of developers writing applications that extend the

functionality of the devices. Developers write primarily in a customized version of Java. Developers

can also run Python scripts on the scripting layer for Android. The cloud serves as the seat of the

database and students may be notified using SMS sent through the various SMS gateways. An

Android client allows the students to retrieve the required information from various spreadsheets

on the cloud.

Problem Definition

The idea is to build a cloud-based application using Google Docs as the cloud. There are

programming interfaces available which allow us to insert, read, update, and delete documents

such as spreadsheets, presentations, etc. The student database for retrieving the information (e.g.

timetable, exam details, scores, etc.) is stored as Google Spreadsheets. The Google Spreadsheets

API allows client applications to view and update Google Spreadsheets content. The project is also

comprised of an Android mobile interface through which the client (Admin) can retrieve all the

information about the desired student from the Google cloud and can also update their information

on the cloud. Students can obtain their personal information from the Google Spreadsheets. The

scripting languages used are Python (for Android) and PHP (for the web interface).

Page 4: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 4

Overview

The cloud used for the project is Google Docs. PHP has been used here to communicate with the

Google Docs cloud through the Zend-gdata library. The student database has been created as a

set of Google Spreadsheets. The Google Spreadsheets API allows client applications to view,

delete, and update information on the spreadsheets. Our client application can request a list of a

user’s spreadsheets, edit content in an existing worksheet, and query the content in an existing

worksheet, all via HTTP requests. A number of client libraries are available in various languages.

These client libraries make it easier to use the Google Spreadsheets API. The library used by our

project is implemented by a set of PHP scripts. The Google Spreadsheets API stores and retrieves

information in the form of XML feeds. In order to parse the generated XML feeds while querying the

Google Spreadsheets, we are using the Zend-gdata library for PHP. It contains functions to parse

the XML feeds. Once the information is obtained, an appropriate message is generated by a PHP

script and a SMS is sent by appending the required text to the appropriate student’s cell phone.

The SMS is sent by AlfaSMS API via the Way2SMS gateway. In a real-time environment, we can

use SMS credits.

Students can retrieve their personal information such as attendance, marks etc. from the Google

Spreadsheets using scripts on the Android client. The client uses the Gspread (Python)

spreadsheet library to communicate directly with the Google Docs Cloud. The required login ID and

password will be provided to the students by the administrator to get all the desired information

from the cloud. These scripts retrieve the information every time the student logs in.

Page 5: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 5

Fig 1: Deployment Diagram for the Notification System

Relevant Concepts and Definitions

PHP

PHP is a general-purpose server-side scripting language originally designed for web development

to produce dynamic web pages. It is one of the first developed server-side scripting languages to

be embedded into a HTML source document, rather than calling an external file to process data.

Google Docs

Google Docs is a free, web-based word processor, spreadsheet, presentation, form, and data

storage service offered by Google. It allows users to create and edit documents online while

collaborating in real-time with other users.

Android

Android is an operating system developed by Google to run on mobile devices. Based on Linux,

each version is named after a type of sweet food (for example, the current version as of this

document’s creation is ’Ice-cream Sandwich’.)

PYTHON (Android-scripting)

Python is a programming language based on Linux environment. It is an object-oriented interpreted

language widely used for scripting, application development, web application servers, scientific

computing, and more.

Page 6: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 6

ALFASMS API

AlfaSMS API is a free SMS API for sending SMS via free SMS gateways such as Way2SMS,

fullonSMS, 160by2, SMS440, wayforSMS, site2SMS, etc. This script allows developers to send

SMS from their scripts. PHP is mostly used by the developers to build their web applications, so we

created a Special SMS class for PHP developers. AlfaSMS API is the most simple and free

Way2SMS API available in internet. It is an open-source API developed by Alfred Francis.

ZEND GDATA LIBRARY

Zend Framework (ZF) is an open source, object-oriented web application framework implemented

in PHP 5 and licensed under the New BSD License. Zend Framework applications can run on any

PHP stack that fulfils the technical requirements. Zend Technologies provides a PHP stack—Zend

Server (or Zend Server Community Edition)—which is advertised to be optimized for running Zend

Framework applications. Zend Server includes Zend Framework in its installers, along with PHP

and all required extensions. The Zend-gdata packages contain everything we need to access

Google's Data APIs from our PHP 5 application.

ECLIPSE IDE

Eclipse is a multi-language software development environment comprising an integrated

development environment (IDE) and an extensible plug-in system. It is written mostly in Java. It

can be used to develop applications in Java and, by means of various plug-ins, other programming

languages including Ada, C, C++, COBOL, Perl, PHP, Python, R, Ruby, etc.

ANDROID OS

Android is a software stack for mobile devices that includes an operating system, middleware, and

key applications. The Android SDK provides the tools and APIs necessary to begin developing

applications on the Android platform using the Java programming language. Android is available

with a set of core applications including an email client, SMS program, calendar, maps, browser,

contacts, and others. All applications are written using the Java programming language.

ANDROID API 1.6

Android 1.6 is a minor platform release deployable for Android-powered handsets since October

2009. The platform includes new features for users and developers, as well as changes in the

Android framework API.

ANDROID EMULATOR

The Android SDK includes a mobile device emulator, a virtual mobile device that runs on our

computer. The emulator lets us develop and test Android applications without using a physical

device.

Page 7: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 7

For our project we have used Android Emulator (see Figure 2) with API level 1.6 an API level 2.3.3.

Figure 2: Android Emulator

SL4A (Scripting Language for Android)

Scripting Language for Android (SL4A) provides interactive interpreters, script editing, and script

execution for various scripting languages. SL4A is targeted at those looking for a way to write

simple scripts to automate tasks on an Android device using any of the supported languages,

including Java through Beanshell. It provides an interactive console in which we can type in a line

of code and immediately see the result. It even makes it possible, in many cases, to reuse code

you have written for a desktop environment.

SL4A Architecture

At its lowest level, SL4A is essentially a scripting host, which means that as an application it hosts

different interpreters each of which processes a specific language. If you were to browse the SL4A

source code repository, you would see a copy of the source tree of each language. This gets

cross-compiled for the ARM architecture using the Android Native Development Kit (NDK) and

loads as a library when SL4A launches a specific interpreter. At that point, the script will be

interpreted line-by-line.

Page 8: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 8

One of the things that SL4A brings to the table is lots of language choices such as Beanshell, Lua,

JRuby Perl, PHP, Python, and Rhino (versions given in the following sections). You can also write

or reuse shell scripts if you like. Without question, the most popular of all these languages is

Python.

Figure 3: SL4A Architecture

Python

Python has been around for quite a while and has many open source projects written in the

language. It also has seen the most interest as far as SL4A is concerned.

The Gspread library for Python is used here to communicate with Google Spreadsheets.

SQLite

SQLite is a software library that implements a self-contained, server-less, zero-configuration,

transactional SQL database engine. SQLite is the most widely deployed SQL database engine in

the world. The source code for SQLite is in the public domain.

SQLite is available on every Android device. Using a SQLite database in Android does not require

any database setup or administration.

We only have to define the SQL statements for creating and updating the database. Afterwards,

the database is automatically managed for us by the Android platform. In Python, SQLite is a small

C library that implements a self-contained SQL database engine. It has been used to create a login

manager for students by the admin on the Android client. Using this library, the student can change

his password and the admin can register new students and change student passwords.

Page 9: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 9

Software Requirements Specification

Scope of the Application

The notification system provides access to the Google Spreadsheets via a web interface and an

Android client. The lecturer can update student information on the “List” database which contains

information about all the students via the web interface as well as the Android client. The students

can access their attendance and other personal information using the Android client.

Overall Description

The PHP scripts used to access Google Spreadsheets use the Zend-gdata library as it provides

the required classes to perform connections with the cloud. The Python scripts on the Android

client use the Gspread library to interact with Google Spreadsheets. For sending SMS to the

students, the AlfaSMS API is used. The numbers of the students are extracted from the Google

Spreadsheets according to the PHP scripts run by the lecturers.

There are separate PHP scripts for updating different spreadsheets. The admin home page

provides links to the PHP scripts for retrieving the required numbers from the spreadsheets. The

lecturer updates information such as the details of the test being conducted including the student's

USN, room number allotted, and time. These details are retrieved from the scheduler spreadsheet

and compiled to a message which is sent to the student.

The PHP scripts are created using a text editor. They are run on XAMPP, which is a package

running the Apache web server. The SMS objects are created using the AlfaSMS API from within

the PHP scripts. The SMS is sent using the Way2SMS gateway. HTML5 and CSS are used to

create the web interface for lecturers and admin to update the spreadsheets. The Android client

uses the SL4A APK. Python for Android is installed on it which contains the scripts which can be

run from within the Python interpreter. The script uses the Gspread module written in Python to

authenticate to Google spreadsheets and retrieve the required information. The Android client is on

an emulator started by the ADT plugin on eclipse IDE. A new Android Virtual Device has to be

created for each Android API level. We have tested the scripts on Android 1.6 and 2.3.3.

Requirements Specification Functional Requirements

Classification of student-related data in the appropriate spreadsheets

Sending SMS to the students about timetable, score, and test schedule

Notification to the students on new data added to the spreadsheets

Sending a meeting notification to the students by a proctor

Accessing the attendance and other information from the Android client by students

Updating spreadsheets from the Android client by the admin

Emergency notification to be sent to the students in critical situations

Page 10: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 10

Use Case: Student Interaction

Figure 4: Student Interaction

A student can login to the Google Spreadsheets using the Python script on Android. He has to

enter its USN and a password given to student by the administrator. On successful login, he/she

can retrieve his/her information from the spreadsheets.

Use Case: Admin Interaction

Figure 5: Admin Interaction

The admin can generate passwords for the lecturers and the students for the web interface and the

Android client respectively. The administrator can also add student records using the Android client

by authenticating the Google Spreadsheets.

Page 11: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 11

Use Case: Lecturer Interaction

Figure 6: Lecturer Interaction

The lecturer can update student attendance, marks, and exam schedule using the scheduler,

score, and scheduler spreadsheets on the Google cloud. Timetable information can also be sent to

the students.

User Interface Specifications

Students can use the Android scripting environment, interacting by using command line inputs. The

web interface is deployed using HTML5 and CSS3 using PHP 5.3. The lecturers can access the

system from their computers. The admin can access the system from the computer and the

Android client. The client runs Python for Android and the Android-scripting environment to

communicate with the spreadsheets. The SMS is sent using web forms created in PHP.

Non-Functional Requirements The following are the non-functional requirements for the system:

Internet: There must be a reliable internet connection between the web interface/Android client and the Google Spreadsheets for accessing data in the latter.

Software required: The software required for this system include Eclipse Indigo IDE, ADT plugin for Android development, XAMPP server package, Zend-gdata library, AlfaSMS API, Gspread Python library, Android SDK r14, and Android API level 1.6 \& 2.3.3.

Hardware: Intel-based PC with dual core Intel processor. Enough space must be provided for the Android Virtual devices created on Eclipse for the 2.0 Android API levels.

Operating System: Windows XP SP2 or later has been used for this project. System Evolution

The current system can be improved by adding advanced and appealing user interfaces for the

Android client. The current implementation uses the scripting environment for displaying the

information retrieved.

Page 12: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 12

The production environment uses free SMS gateway for sending SMS. When the system will be

deployed on a live site, it would be necessary to buy SMS credits from a bulk SMS provider since

the free SMS gateways provide limited SMS.

Design Document

Document Overview

This chapter details the overall design insight into the notification system. The design provides a

framework for retrieving information from a cloud database and using it to notify individuals about

the required information. The design is predicated on individual thoughts and an analysis of the

area of application.

System-Wide Design Decisions

There are key decisions which drive the overall design of the notification system. The first set of

decisions describes the choice of the cloud for deploying the database and the scripting language

chosen for interacting with the database.

Other decisions describe implementation strategies for the Android application. The application is

meant to allow students to log in with their credentials to retrieve their attendance and other

personal information from the cloud database using their Android phones. It also allows admins to

add student information records to the database.

1. Selection of the cloud Google Docs is a freely available cloud based SaaS. It provides database services as

spreadsheets for free. Since all the other cloud databases are paid, we chose Google Docs

as our personal cloud database which is flexible and scalable.

2. Choice of Library to access

Zend framework for PHP provides the Gdata library to query the Google Spreadsheets to retrieve

information. PHP was chosen as the scripting language as it blends with HTML and is a standard

for creating web applications.

3. Choice of Web Server

XAMPP package contains the Apache web server and PHP 5.3 which are used for running

the PHP scripts. It is freely available and is extensively used for development purposes.

4. Selection of Mobile Platform

Android is chosen for the mobile platform. Python for Android is used for writing the scripts

required to query the Google Spreadsheet from the Android Phone. Gspread library for

Python provides the functionality to interact with Google Spreadsheet from Python.

Page 13: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 13

Interaction Diagrams

Figure 7: Student Interaction

In all the PHP and Python scripts, connection with the Gmail user “gnotifysms” is established to first gain access to the Google Spreadsheets stored under its name

The student log in to the Android client using the USN and password

The credentials are verified against the list stored in the script

On successful login, the users attendance is retrieved using the USN as the key from the attendance spreadsheet

The students personal information including name, number, subjects, and class is retrieved from the list database

It is then displayed on the Android client using the script Interaction: Admin

Figure 8: Admin Interaction

Page 14: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 14

The administrator logs in to the Android client

The admin adds details of the new student separately and updates it to the Google Spreadsheet `”List”

Figure 9 represents the workflow where the Admin uses the web interface to interact with the system.

Figure 9: Admin Interaction using the web interface

Sequence of Events Leading to SMS Delivery to Student

Figure 10: Sequence diagram for SMS delivery

Page 15: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 15

Figure 11: Sequence Diagram for Android Client

Implementation

Overview

“Cloud-based notification system'' uses Google cloud (Docs) as the database to store the data. A

project-specific Gmail account has been used to access the Google Docs and all the spreadsheets

declared as ‘shared’. The notification system has two implementation portions; PHP scripts running

on XAMPP and the Python scripts running on Android 2.2 emulator. In addition, the PHP scripts

use Way2SMS gateway to notify students via SMS and for the Python scripts, results are obtained

in the emulator-supported console. The same Android application can be installed on any Android

phone (with required tools) and the results can be obtained on them.

PHP Scripts

The system (web interface) is an admin page comprised of various links which will direct the admin

to specific PHP scripts. The HTML pages have been used as the UI (User Interface) and the PHP

scripts perform jobs in the background.

Schedule script

This script has been used to retrieve the test schedules updated in the spreadsheet. The

spreadsheet “Scheduler” contains test room number, test timing, and student USN's. The PHP

script retrieves the USN's and matches them with the spreadsheet “List” to obtain the

corresponding contact information. The relevant test information are sent on those contacts using

Way2SMS gateway.

Page 16: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 16

Figure 12: Schedule.php

Page 17: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 17

Timetable Script

The script works on spreadsheet “Timetable” and retrieves the relevant information for a particular

day for different classes and sends the day’s timetable to the corresponding students. The script

compares the current day with that on the spreadsheet and executes the operation required. The

script uses another spreadsheet “Groups” to determine the students falling in each class and thus

obtains their contact information. Once the timetable schedule is obtained, the script notifies the

students via SMS using Way2SMS gateway.

Figure 13: Timetable.php

Page 18: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 18

Addrows Script

This is an admin-specific script to update the spreadsheet “List”. A link in the admin page is given

to run this script. The script provides a UI and when the information is entered, it will update the

spreadsheet using the “Zend-gdata Library” which is used to link with the Google Docs. The script

contains code snippets to log in to the account and only update the “LIST” spreadsheet.

Figure 14: Addrows.php

Page 19: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 19

Score Script

This script retrieves the score of students from the spreadsheet ``SCORE” for different subjects

and, corresponding to the USN's, the contact information is retrieved from the spreadsheet ``LIST"

using the search function. Finally, the SMS containing the scores of the student for different

subjects are sent to the student using “Way2SMS “gateway.

Figure 15: Score.php

Page 20: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 20

Attendance Script

This admin-specific script updates the “Attendance” spreadsheet. The script is directed from the

admin page and once the admin enters the attendance information and submits, the information is

updated on Google Docs. However, students that want to check their attendance must log in using

the Android app. They then have the authority to view their attendance only.

Usnenquiry Script

This admin-specific script retrieves information about any student. A link in the admin page will

take the admin to the script and once the admin enters the USN, the USN will be matched with the

USN's of spreadsheet “List”. The corresponding results will be sent to the admin.

Proctor Script

This admin-specific script, used to notify a specific group or class of students, takes the contact

information of all the students of a specific class from the spreadsheet “Groups” and sends them

the message entered in the dialog box by the admin. The lecturer can also use this script. All

messages are sent by the Way2SMS gateway.

Sendnew Script

This is an admin-specific script. Once logged in and the session is verified, the admin is allowed to

add a student to the spreadsheet “List”. The script provides a form for the relevant information.

However, the admin can go directly on the Google Docs page and update it. Once students are

added in the “List” using the form, they will be notified on his contact number via SMS through

Way2SMS gateway. The same can be done for sending SMS to the entire class. The POST data

from the form for adding student information is processed using this script.

Generate Notification Script

This script is used by the lecturers to send a general notification to all the students at once. The

numbers are retrieved from the “List” spreadsheet and SMS is sent to each of them.

Page 21: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 21

Figure 16: Generate notification.php

Page 22: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 22

Admin Script (PHP)

This is the admin homepage which can be accessed by the admin once the session is confirmed. It

consists of links to all the PHP scripts described above. Any job the administrator wants to do will

require clicking on the links on the page. The admin will then be referred to the respective page or

form. Lecturers can use this script as well.

Python Scripts

The other half of the project comprises of Android scripts. We have used eclipse indigo with ADT

plugin17, Android scripting tools, Android SDK, and Android 2.3.3 emulator. The scripts are written

in Python using py4a “Python 4 Android". All the scripts can be run on the Python console and, if

transferred to an Android device, can work using an Internet connection. All the Python scripts use

Gspread library to connect with the Google Docs.

Admin Script (Python)

This is an admin-specific script on the console. Once the credentials are verified, the admin can

add information about a student on Google Docs. The script runs in an emulator-supported

terminal and the inputs are given as per for any programming language.

Register Script

A script run by the admin to register new students to the SQLite database on the Android client.

The admin can also update passwords for student as requested by them.

Attendance Script

These scripts are for retrieval of information from “List” and “Attendance” by the students. All

students will be given their specific username and passwords. Once the credentials are confirmed,

the students can retrieve their information from Google Docs. They can also change their

password.

Steps to Setup the Android Client

Steps required to implement the Android-scripting environment on Android emulator:

1. Download and install Eclipse Indigo IDE 2. Download and set up the ADT plugin for eclipse 3. Download and install the Android API level 1.6 \& 2.3.3 4. Create a new Android Virtual Device by choosing an API level 5. Start the AVD after adding parameters (sdcard size etc.) 6. Download and install SL4Ar3.apk & PythonForAndroid.apk into the AVD from using the

AVD browser 7. Download Python interpreter on SL4A 8. Connect to the AVD from the command line by setting the port no using AP PORT = 9999 9. Push the Python script and the Gspread module to /sdcard/sl4a/scripts folder on the

emulator using the "adb push" command 10. Run the scripts on the Python interpreter

Page 23: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 23

Testing the Application

Below is a summary of the results of tests performed on the various entities of the “Cloud-based

Mobile Notification System".

Test Summary

Tests conducted on the web interface and the Android client of the Notification system include: Functionality Testing

Functionality testing involved validating the form data entered in to the web interface and the

database connection for the same.

The interface was tested with invalid inputs such as invalid USNs and phone numbers. Appropriate

error messages were obtained.

Usability Testing

Usability testing involved testing the navigation links on the web interface. The content was tested

for validity and degree of user-friendliness.

The web interface provides links which are self-explanatory and easy-to-navigate. The links on all

pages were tested individually for correct redirection.

Security Testing

Security testing involved accessing the scripts using URLs. It failed, proving that the system is

secure and requires genuine authentication.

The PHP scripts in the web interface were accessed using direct URLs. Each such attempt

resulted in redirection to the Log In page.

Compatibility Testing

Compatibility testing involved testing the scripts on the Chrome browser, Firefox browser, and the

Android client browser.

The PHP scripts were run on each of the browsers. They responded positively during each run

proving the browser-compatibility of the system.

Page 24: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 24

Snapshots

Figure 17: List spreadsheet

The "List" spreadsheet (Figure 17) stores information about all students.

Figure 18: Timetable spreadsheet

The "Timetable" spreadsheet (Figure 18) stores the entire timetable of each day.

Figure 19: The Android client

Figure 19 shows the list of Python scripts on the Android client’s SL4A app.

Page 25: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 25

Figure 20: Retrieving Student information

Figure 20 shows the result obtained by executing the Attendance.py script in Python on the

Android client.

Figure 21: Meeting Notifier interface

Figure 21 shows the web interface for the lecturers to send meeting notification to the

students/classes.

Page 26: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 26

Conclusion and Futurework

The project can be extremely useful for an organization to notify its members of upcoming events

or changes to a common database. Use of SMS provides quick message delivery to the intended

recipients. Conclusions drawn by implementing this project include:

1. PHP scripts provide an easy way to access the spreadsheets on Google cloud 2. The simple web interface makes the system user-friendly to the lecturers 3. SMS is sent based on the overheads at the gateways, though it is a simple method of

message delivery 4. Zend-gdata library provides a wrapper for calling the functions required to invoke Google

Spreadsheet objects 5. Interaction with XML using freely available libraries makes it ideal for development using

the Google cloud (Spreadsheets) 6. The Android client provides mobile access to the spreadsheets, keeping students informed

on-the-go about their details 7. The system is a complete notification/update system and can be easily deployed for live

use with minimal configuration Advantages

1. Online-based systems excel in scalability. They can be instantaneously expanded as the user base grows

2. Students and lecturers can access their marks, attendance, and personal information from anywhere at anytime

3. Students can view their personal details 4. Lecturers can update student marks, attendance, etc. from their systems 5. Lecturers can send notifications regarding holidays and details related to the exam

timetable through SMS 6. Since all the data is uploaded to the cloud, the threat of data loss is significantly reduced

Disadvantages

1. SL4A app only runs on Gingerbread and previous platform version 2. Time overhead occurs when a bulk SMS is sent to all students 3. Some messages do not get delivered to students due to gateway latency

Futurework

Since the scripts for Android have been written in Python, the display could not be very user-

friendly. Therefore, improvements could be done on the User Interface. In addition to Gspread

library used for Python, other libraries to connect the Android client to Google Docs can be used

such as “GSS Android-package”. Java-based new features can also be added to enhance the

areas that can be covered. Apart from Google cloud, other paid platforms can be used for a live

deployment.

Page 27: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 27

Appendix

SMS Gateway

A Short Message Service (SMS) gateway is a telecommunications network facility for sending or

receiving SMS transmissions to or from a telecommunications network that supports SMS. Most

messages are eventually routed into the mobile phone networks. Many SMS gateways support

media conversion from email and other formats.

Gateway providers have special agreements with the major mobile carriers around the world to

send two-way SMS traffic. These gateway providers, also known as aggregators, will send and

receive SMS traffic to and from the mobile phone network’s SMS Center, which is responsible for

relaying those messages to the intended mobile phone. The aggregators then receive feedback

from the SMS Center as to the status of the delivery of that message. This relationship between

aggregator and SMS Center allows for the transmission of a large number of SMS messages.

Figure 22: SMS gateway at work

Bibliography/References

http://smartphonedaq.com/spreadsheet.page

http://framework.zend.com/manual/en/zend.gdata.spreadsheets.html

https://developers.google.com/google-apps/spreadsheets/

http://framework.zend.com/download/webservices

http://www.youtube.com/watch?v=rWCLROPKug0

http://code.google.com/p/gdata-Python-client/

http://mrwoof.tumblr.com/post/1004514567

http://mashupguide.net/1.0/html/ch17s08.xhtml

http://www.payne.org/index.PHP/Reading\_ Google\_ Spreadsheets\_in\_Python

http://cambiatablog.wordpress.com/2011/02/05/PHP-interacting-with-\\google-spreadsheet-using-zend-gdata/

http://www.farinspace.com/saving-form-data-to-google-spreadsheets/

http://www.ibm.com/developerworks/xml/library/x-googledata1/index.html?ca=drs

http://developer.android.com/sdk/eclipse-adt.html

http://developer.android.com/sdk/android-2.3.3.html

Page 28: Table of Contents · Google Docs cloud through the Zend-gdata library. The student database has been created as a ... Server (or Zend Server Community Edition)—which is advertised

2013 EMC Proven Professional Knowledge Sharing 28

http://code.google.com/p/android-scripting/

http://www.techrepublic.com/blog/programming-and-development/ try-the-sl4a-scripting-environment-for-your-android-device/3932

http://www.linuxplanet.com/linuxplanet/tutorials/7166/1

http://code.google.com/p/Python-for-android/

http://www.linuxjournal.com/article/10940

http://www.alfredfrancis.in/alfasmsapi The AlfaSMS API, developed by Alfred Francis, is open source. It has been used here to serve the

purpose of the application of sending SMS via SMS gateway. We do not claim ownership of the

API. It belongs to Alfred Francis.

The Gspread Library, developed by Anton Burnashev, is open source. It has been used here to

retrieve information from the spreadsheets onto the Android device. We do not claim ownership of

the API. It belongs to Anton Burnashev.

EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice. THE INFORMATION IN THIS PUBLICATION IS PROVIDED “AS IS.” EMC CORPORATION MAKES NO RESPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Use, copying, and distribution of any EMC software described in this publication requires an applicable software license.