Portable Lab

Embed Size (px)

Citation preview

  • 7/31/2019 Portable Lab

    1/47

    MOBILE PORTABLE LABCHAPTER 1

    INTRODUCTION

    1.1 INTRODUCTION TO THE PROJECT

    Mobile learning (m-learning) is considered more innovative and student-centered

    than typical e-learning or classic distance education methods, representing an effective

    pedagogical method as any other conventional learning method. We consider that m-

    learning can be defined as the exploitation of ubiquitous handheld technologies, together

    with wireless and mobile phone networks, to facilitate, support, enhance and extend the

    reach of teaching and learning. Mobile devices allow a higher portability and accessibility,

    but the real issue with the adoption of this methodology is still finding an efficient and

    suitable adaptation of the courses to means with clear restriction factors. The main goal of

    Mobile Portable Lab is to improve students interest and motivation and, additionally, to

    make resources available in any place, at almost any time. This Mobile Portable Lab should

    be used as a complement to the usual classroom lessons.

    1.2 INTRODUCTION TO ANDROID

    Android is a mobile operating system that is based on a modified version of Linux.

    It was originally developed by a startup of the same name, Android, Inc. In 2005, as part of

    its strategy to enter the mobile space, Google purchased Android and took over its

    development work.

    Google wanted Android to be open and free, hence, most of the Android code was

    released under the open-source Apache License, which means that anyone who wants to

    use Android can do so by downloading the full Android source code. Moreover, vendors

    can add their own proprietary extensions to Android and customize Android to differentiate

    their products from others. When the iPhone was launched, many of these manufacturers

    had to scramble to find new ways of revitalizing their products. These manufacturers see

    1

  • 7/31/2019 Portable Lab

    2/47

    MOBILE PORTABLE LABAndroid as a solution they will continue to design their own hardware and use Android

    as the operating system that powers it.

    The main advantage of adopting Android is that it offers a unified approach to

    application development. Developers need only develop for Android, and their applications

    should be able to run on numerous different devices, as long as the devices are powered

    using Android.

    1.2.1 ARCHITECTURE OF ANDROID

    Linux kernel This is the kernel on which Android is based. This layer contains

    all the low level device drivers for the various hardware components of an Android device.

    Libraries These contain all the code that provides the main features of an

    Android OS.

    Android runtime At the same layer as the libraries, the Android runtime

    provides a set of core libraries that enable developers to write Android apps using the Java

    programming language.

    Application framework Exposes the various capabilities of the Android OS to

    application developers so that they can make use of them in their applications.

    Applications At this top layer, you will find applications that ship with the

    Android device such as Phone, Contacts, Browser, etc as well as applications that you

    download and install from the Android Market.

    2

  • 7/31/2019 Portable Lab

    3/47

    MOBILE PORTABLE LAB

    1.3 INTRODUCTION TO JAVA

    Java is really the only language in widespread use that can easily be used to build

    systems that meet the requirements just listed for an enterprise system. Java is a standards-

    based language that is platform-independent. It has support for accessibility and

    internationalization and localization, including a Unicode basic character type, built into

    the language. Finally, Java is an object-oriented language with database access and

    distributed computing at its core.

    1.4 INTRODUCTION TO COMM API

    The Java Communications API consists of the javax.comm package. This package

    does not come with the core Java development kits but instead is included in the set of

    optional Java Extensions packages that provide various useful services but are not available

    for all platforms.

    3

  • 7/31/2019 Portable Lab

    4/47

    MOBILE PORTABLE LABWith the Communications API you can obtain a set of objects representing the

    RS232 serial ports and IEEE 1284 parallel ports on a platform. With these you can obtain

    exclusive ownership of a port, read and write to the port either synchronously and

    asynchronously, and receive events from the port that indicate some state change in the

    port such as the arrival of data.

    1.5 INTRODUCTION TO JDBC

    SQL was a key first step in simplifying database access. Java's JDBC API builds on

    that foundation and provides you with a shared language through which your applications

    can talk to database engines. Following in the tradition of its other multi-platform APIs,

    such as the AWT, JDBC provides you with a set of interfaces that create a common point at

    which database applications and database engines can meet.

    4

  • 7/31/2019 Portable Lab

    5/47

    MOBILE PORTABLE LABCHAPTER 2

    PROBLEM DEFINITION

    2.1 SOFTWARE REQUIREMENT SPECIFICATION

    2.1.1 Introduction

    Purpose

    This document is about the requirements for development of Mobile Portable Lab

    using android platform. The objective of Mobile Portable Lab is to improve students

    interest and motivation and, additionally, to make resources available in any place, at any

    time. This mobile remote laboratory should be used as a complement to the usual

    classroom lessons.

    Project Scope

    M-learning is characterized by mobility and accessibility, since it focuses on the

    use of handheld mobile devices. These equipments have become very popular, especially

    among young people who use them not only for communication but also as a tool for other

    activities. In this project, we attempt to create an android application Mobile Portable Lab

    which helps the students to access laboratory resources anywhere, at anytime.

    2.1.2 Overall Description

    Product features

    Mobile Portable Lab consists of Server PC which is connected to the hardware, this

    hardware sends the values to the server PC. Server PC reads these values and stores it in

    the database and when the client requests for data, it validates the user first and then sends

    the data to the mobile phone which is the client. Now let us have a look at how the client

    operates, when the application is opened in android cell phone, it prompts for the Ip

    5

  • 7/31/2019 Portable Lab

    6/47

    MOBILE PORTABLE LABAddress of the server, username and password. All these details will be validated at the

    server end. If the data is validated the server sends the temperature, voltage readings,

    comments and annotations to the mobile, using these data graphs will be generated and also

    it will display the comments and annotations. User can view the data and insert new

    comments and annotations; this newly added data will be sent to the server and updated in

    the server database as well.

    Operating Environment

    This client application is created using Android SDK 2.2, Java hence runs in the all

    platform. Android Cell phone with Android OS 2.2 and above is needed. Android cell

    phone must be GPRS enabled. The sever is created using Java at the frontend and MySQL

    at the backend.

    Design and Implementation Constraints

    The Product is developed using android java in Android OS technology.

    2.1.3 System Features

    Android cell phone

    User can view the data and insert new comments and annotations, where in this

    data will be sent to the server and will be updated in the server database as well.

    Server PC

    ServerPC is connected to the hardware, this hardware sends the values to the serverPC. If the client inserts new comments, then it will read the comments and insert them in

    the Database.

    6

  • 7/31/2019 Portable Lab

    7/47

    MOBILE PORTABLE LAB2.1.4 External Interface Requirements

    Hardware Interfaces

    Android cell phone with internet connection.

    PC with dial up Ip address

    Temperature and Voltage Sensors

    Software Interfaces

    Application:Java, Android.

    Network: Application dpends on internet.

    Operating System: Android OS 2.2or higher version is needed.

    2.1.5. Other Nonfunctional Requirements

    Performance Requirements

    Software must be able to run on Windows XP and any latest Microsoft OS.

    Android cell phone should be of version 2.2 or any higher versions.

    Software Quality Attributes

    Android application is compatible with any upcoming versions of android SDK.

    Product is reliable to run on all compatible systems without any errors.

    Appendix: Glossary

    SDK Software Development Kit.

    7

  • 7/31/2019 Portable Lab

    8/47

    MOBILE PORTABLE LAB

    CHAPTER 3

    LITERATURE SURVEY

    3.1 PREVIOUS RESEARCH

    It has to be noted that, nowadays, m-learning is a very active research field, with

    the development of important and interesting projects. Mobile learning is rapidly growing

    from a set of research projects into worldwide deployment of services for classroom, field

    trips, workplace training and informal education, among other areas. It is important to

    know projects like MOBIlearn since it pretends to deliver a generic m-learning architecture

    to support creation, delivery and tracking of learning and information contents, using

    ambient intelligence, location dependence, personalization, multimedia, instant messaging

    (text, video) and distributed databases.

    Another proposal, MADEE, is an execution environment and application

    development tool that supports and the development of mobile and wireless informationsystems that run on handheld devices, allowing communication and information sharing

    among users in an organization. Although we did not find m-learning applications

    delivering the pretended contents and functionalities to complement power quality

    assessment lessons, there is LabVIEW mobile module for handheld devices (LV mobile)

    that can be used as an alternative to Mobile Portable Lab. LV mobile is an enterprise

    application from National Instruments (NI) that includes features similar to those provided

    by our application, LV mobile has too many features to the customers needs, making it

    too complex and distracting.

    8

  • 7/31/2019 Portable Lab

    9/47

    MOBILE PORTABLE LAB3.2 EXISTING SYSTEM

    There are, nowadays, many different methods of learning throughout the world. E

    Learning project falls within the distance education (or learning) , we carried out a study on

    distance education versus classroom learning. Education institutions are responsible for

    finding a balance that benefits all agents involved in the learning process, making available

    diverse learning options.

    3.3 DRAWBACKS OF EXISTING SYSTEM

    It should be the students to, directly or indirectly, choose the learning method that

    best fits according to their standards, their way of life and living in society. While in the

    classroom, the student is required to meet schedules and is restricted to the physical space

    often limiting the presence of some students. A student in the classroom is often a passive

    participant. Many times, students, especially those with employee-student status, have no

    time to take the necessary trips to the universities.

    3.4 PROPOSED SYSTEM

    The main goal of Mobile Portable Lab is to improve students interest and

    motivation and, additionally, to make resources available in any place, at almost any time.

    This mobile remote laboratory should be used as a complement to the usual classroom

    lessons. Essentially, the developed system integrates a server with a data acquisition board

    and a central database to be accessed by the mobile applications, initially programmed for

    Google Android platform. The presented approach includes a collaborative learning

    module that it is essential for the growth of students. With the module, they can annotate

    contents to be seen by teachers and colleagues, giving additional information about their

    understandings or helping others in the learning process. The data acquisition is done by

    current and voltage sensors that send signals to a data acquisition board, which is

    connected to a server that runs signals processing and data management modules. This

    database is updated every time new values are read, independently of the requests of the

    9

  • 7/31/2019 Portable Lab

    10/47

    MOBILE PORTABLE LABmobile clients. Apart from the existence of the server database (remote to the mobile user),

    the user can also choose to use a (local) database, located inside the mobile device

    application.

    3.5 ADVANTAGES OF PROPOSED SYSTEM

    Mobile Portable Lab is designed and tailored to the needs of its users, making it

    very accessible .It should be the students to, directly or indirectly, choose the learning

    method that best fits according to their standards, their way of life and living in society.

    While in the classroom, the student is required to meet schedules and is restricted to the

    physical space often limiting the presence of some students. In Mobile Portable Lab the

    study material can be accessed anytime, anywhere, if available in a functional way. While a

    student in the classroom is often a passive participant, in distance education the focus is on

    making the student more interested and proactive. Many times, students, especially those

    with employee-student status, have no time to take the necessary trips to the university. On

    the other hand, in distance education such trips are not necessary, which makes it a method

    with lower costs. Finally, Mobile Portable Lab is a free tool.

    10

  • 7/31/2019 Portable Lab

    11/47

    MOBILE PORTABLE LAB CHAPTER 4

    PROBLEM DESCRIPTION

    4.1 AIM

    The main aim of our project to develop a mobile learning system that integrates an

    application developed for mobile devices with Google Android operating system. By using

    this system, students present anywhere can access the laboratory resources at any time.

    4.2 OBJECTIVE

    The objective of Portable Lab is to improve students interest and motivation and

    additionally, to make Laboratory resources available in any place, at almost any time.

    4.3 FEASIBILITY STUDY

    The requirement engineering is the set of activities that lead to the production of

    requirement definition and specification. It is necessary and prudent to evaluate the

    feasibility of the project at the earliest possible time. A report on feasibility of the system

    can be produced and is a principle stage in this process.

    In the feasibility study, an estimate is made of whether the identified user needs

    may be satisfied using current software and hardware technology.

    The following feasibility studies were performed to gauge the feasibility of the

    system.

    11

  • 7/31/2019 Portable Lab

    12/47

    MOBILE PORTABLE LAB4.3.1 Operational feasibility

    In this project, the operational scope of the system is checked. The system under

    considerations has many options. It is observed that this system is very user friendly and

    anyone who has installed this application is sure to find it easy and can complete his task in

    a comparatively very less time.

    4.3.2 Technical feasibility

    This test includes a study of function. Technically the aim is to provide an efficient

    and reliable mobile learning application for android platform. One of the main factors to be

    accessed is the need of various kinds of resources for the successful implementation of the

    proposed application. Since this is an android application, which is developed in java, any

    further modifications can be easily done.

    4.3.3 Economic feasibility

    This application help the students to access the laboratory resources without the

    additional cost of daily travelling.

    12

  • 7/31/2019 Portable Lab

    13/47

    MOBILE PORTABLE LABCHAPTER 5

    PROJECT DEVELOPMENT LIFE CYCLE

    5.1 ANALYSIS

    System analysis is an important activity that takes place when we are building a

    new system or changing existing ones.

    5.1.1 Requirement Analysis

    The analysis phase deals with finding out the application domain, what services the

    system would provide, the required performance of the system, hardware constraints and so

    on.

    13

  • 7/31/2019 Portable Lab

    14/47

    MOBILE PORTABLE LABFirst the use cases are identified. Use cases are scenario based technique for

    requirement analysis. Here actors are all students and faculty members. Next, detailed

    requirement study of all the features of the project is done. Next, a trial of the requirements

    is done and lastly the final requirements are finalized.

    5.1.1 Identification of Need

    Education institutions are responsible for finding a balance that benefits all agents

    involved in the learning process, making available diverse learning options. It should be the

    students to, directly or indirectly, choose the learning method that best fits according to

    their standards, their way of life and living in society. The student must also compare the

    advantages and disadvantages of each learning method to make a decision. While in the

    classroom, the student is required to meet schedules and is restricted to the physical space

    often limiting the presence of some students. At distance, the study material can be

    accessed anytime, anywhere, if available in a functional way. While a student in the

    classroom is often a passive participant, in distance education the focus is on making the

    student more interested and proactive. Many times, students, especially those with

    employee-student status, have no time to take the necessary trips to the university. On the

    other hand, in distance education such trips are not necessary, which makes it a method

    with lower costs. Therefore, m-learning can be seen as the exploitation of ubiquitous

    technologies, along with mobile networks in order to support, strengthen and extend the

    reach of learning.

    5.1.2 Module Analysis

    This project consists mainly 2 modules.

    1. The Server module

    The Server PC is connected with the hardware; hardware consists of Temperature

    and Voltage Sensors. Readings of temperature and Voltage sensors are read by an

    14

  • 7/31/2019 Portable Lab

    15/47

    MOBILE PORTABLE LABapplication and is stored in database. At the server end the registrations of Lecturers and

    Students done and each of them will have a unique username and password .Once the

    Mobile sends an request, at the server end the username and password is validated and

    sends all the temperature and voltage readings, annotations, comments to the mobile phone

    and waits for the request once again, if the user adds any comments or annotations the

    details will be sent to the server, server is update the same.

    2. Client Module

    The Android application is installed in the Android cell phone. If the user is

    validated, then server will send comments, annotations and temperature and voltage

    readings. Mobile will read these data and stores in the mobile database and user can view

    the trigonometric and bar graph and also view the comments and annotations and can insert

    new comments and send the same to the server.

    5.2 DESIGN

    Learning in the classroom depends on the interaction of time and place and learning

    time are equal to the whole class. Distance learning consists of modules, making it an

    "application" easy to maintain, promoting the rapid updating of data and its permanent

    availability, and with students becoming critical thinkers.

    The present teaching also creates feelings of self-esteem, patterns of self-

    confidence and security and greater motivation, while distance education requires that the

    individual has a large auto-motivation and self-discipline. Classroom learning also allows

    the individual to acquire habits of coexistence, understanding and skills to meet the

    demands of day-to-day, being followed throughout their school career. It also promotes

    self-control and self-discipline, losing inhibition, creativity, participation and commitment.

    15

  • 7/31/2019 Portable Lab

    16/47

    MOBILE PORTABLE LABIt is clear that the advantages of mounting a distance learning system, more

    particularly an m-learning methodology which is where Mobile Portable Lab fits in, will

    benefit nowadays students learning process.

    Through m-learning, learning can occur anywhere at any time, thus expanding the

    traditional learning environments. This type of learning enables users to study in

    classrooms and in workplaces, at home, in transit, among many other places. M-learning

    involves connectivity for downloading/uploading and/or work online through wireless

    networks, as well as, the increasingly ubiquitous, mobile devices such as mobile phones,

    smart phones, and PDAs and net books. Therefore, m-learning can be seen as the

    exploitation of ubiquitous technologies, along with mobile networks in order to support,

    strengthen and extend the reach of learning.

    How the portable lab works?

    The proposal can be seen as typical client/server architecture see Figure 5.1.The

    data acquisition is done by current and voltage sensors that send signals to a data

    acquisition board, which is connected to a server that runs signals processing and data

    management modules. These modules store the received data in a database located on the

    server side. This database is updated every time new values are read, independently of the

    requests of the mobile clients. Part from the existence of the server database, the user can

    also choose to use a database, located inside the mobile device application. To access the

    remote database, mobile devices need to use a PHP API through HTTP connections to

    obtain the necessary information for the reproduction of various types of graphs, including

    graphs of harmonic content, voltage, and current. This API is also used to synchronize

    information between the two databases, being the communication made in a bidirectional

    way.

    16

  • 7/31/2019 Portable Lab

    17/47

    MOBILE PORTABLE LAB

    Fig 5.1: System architecture

    The design of the android application is shown below. It shows how the students

    and lecturers interact with the application. The students can login, view charts, can annotate

    comments and questions. Whereas lecturer can login, view charts, can annotate comments,

    questions, as well as answers. The use case diagram of this project is given below.

    Lecturer Student

    Fig 5.2: Use Case Diagram

    17

    login

    View charts

    Annotate

    comments

    Annotate

    questions

    Annotateanswers

  • 7/31/2019 Portable Lab

    18/47

    MOBILE PORTABLE LAB5.3 IMPLEMENTATION

    Our project is implemented successfully in Android platform. All the modules are

    implemented and linked together to provide required functionality.

    5.3.1 Server implementation

    The server here is implemented in Java platform. The server is combination of

    various concepts like JDBC,Sockets,Comm API,Swings.

    User Interface

    Swing is much more than a bunch of GUI components that you paste into a

    window. It is an entire architecture for building user interfaces in Java.We designed the

    user interface of our application using the concept of java swings.Our program starts

    execution from the class PortableLabSystemTray().This class calls two more classes

    ServerSocketStart() and ReadValuesFromHW().ServerSocketStart() is used to start the

    server and initialize the ports.The ReadValuesFromHW() is used to read the values from

    the hardware.This piece of code shows how the system tray is initialised with the icon of

    the application.

    if(SystemTray.isSupported())

    {

    SystemTray systemtray = SystemTray.getSystemTray();

    tray_image=toolkit.getDefaultToolkit().getImage(CurrentPath.PATH+"\\new_popular.png"

    );

    trayIcon = new TrayIcon(tray_image,"Portable Lab",menu);

    systemtray.add(trayIcon);

    }

    18

  • 7/31/2019 Portable Lab

    19/47

    MOBILE PORTABLE LABServer Socket

    Unless we set up a server socket or we connect to our service, the connectionattempt will typically fail. We must be a little careful when trying to open sockets because

    if there is nobody listening, an exceptioncan be thrown. We are generally required to catchand deal with such exceptions not catching most exceptions causes compilation errors. The

    principal constructor from our point of view is

    ServerSocket(int port)

    which creates a server socket that listenson the specified port. To set up a serversocket and establish a connection, we use code like this

    import java.net.*;

    SeverSocket sSoc = new ServerSocket(1024);

    Socket in = sSoc.accept();

    We create a new server socket called sSoc and then call its accept() method. At this

    point, our code will waituntil our Android application, connects to the server socket, byautomatically creating a new client socket. The accept method blocks . That is, anyprogram invoking it will wait until a communication attempt occurs. Once again, we

    should not use socket numbers less than 1024 because they are reserved for well-known

    services.

    Reading the values from the hardware

    We are developing a application portablelab. We have used Java to develop much

    of the software that is needed to do analysis of the data and to build a client/server system

    to provide the data to distant users via the Internet. To make this system work, we would

    need software to access the instrument hardware i.e the values from the data acquistion

    board.

    19

  • 7/31/2019 Portable Lab

    20/47

    MOBILE PORTABLE LABTo do these things we need to access the platform's communications ports, such as

    those for serial lines, that are connected to the data acquisition board. You could connect

    via C hardware drivers, but a much easier alternative is to take advantage of the available

    communication classes and talk to these ports directly from your Java programs.The Java

    Communications API consists of the javax.comm package. This package does not come

    with the core Java development kits but instead is included in the set of optional Java

    Extensions packages that provide various useful services but are not available for all

    platforms.

    With the Communications API here we obtain a set of objects representing the

    RS232 serial ports . With these we can obtain exclusive ownership of a port, read the

    values from the hyperterminal of the system and receive events from the port that indicate

    the arrival of data.Here is the piece of code as how to open a port , to initialize the port and

    read from the port.

    this.db=db;

    //db=new DatabaseHandler();

    portId = CommPortIdentifier.getPortIdentifier("COM1");

    serialPort = (SerialPort) portId.open("ComControl", 2000);

    in = serialPort.getInputStream();

    serialPort.addEventListener(this);

    serialPort.notifyOnDataAvailable(true);

    serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,Ser

    ialPort.PARITY_NONE);

    5.3.2 Client Implementation

    The client here is succesfully implemented in Google Android Platform.It consists

    of modules for authentication,viewing the charts and annotations.

    20

  • 7/31/2019 Portable Lab

    21/47

    MOBILE PORTABLE LABLogin

    The execution of the android application starts from the class welcome.java.the

    given below is the code of welcome.java.The use of this class is to accept the i.p address of

    the server as well as the login information from the user. Here the package

    android.app.Activity is the first activity of our applicatio.The package

    android.widget.Button is used for adding widgets like menu items,buttons,panel items

    etc.The package android.view.View is used to set the content view of the screen.

    package com.portablelab;

    import android.app.Activity;

    import android.content.Intent;

    import android.os.Bundle;

    import android.view.View;

    import android.widget.Button;

    public class Welcome extends Activity

    {

    Button bt_proceed;

    Intent it;

    static String user="",user_type="";

    static int count=0;

    public void onCreate(Bundle savedInstanceState)

    {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.welcome);

    it=new Intent(this,IPAddress.class);

    bt_proceed=(Button) findViewById(R.id.proceed);

    bt_proceed.setOnClickListener(new View.OnClickListener()

    {

    public void onClick(View v)

    {

    21

  • 7/31/2019 Portable Lab

    22/47

    MOBILE PORTABLE LABstartActivity(it);

    }

    });

    }

    }

    Querying the database in Android

    The SQLite is the database which is in builtAndroid.The android.database. sqlite.

    SQLite Database Is the package that is imported inorder to perfrom the SQL operations in

    Android.The given piece of code illustrates how to perform the various operations like

    insert,delete and alter tables operations.In our application we use the datbase to store the

    values of temperature, voltage, date, time and other information which we obtain from the

    server.This value is stored and used later for plotting the trignometric charts and bar charts

    of temperature and voltage.

    import android.database.sqlite.SQLiteDatabase;

    public class LocalDBQueries

    {

    static SQLiteDatabase myDB= null;

    ArrayList arr_lst;

    ArrayList arr_tmp,arr_volt,arr_time,arr_tvt;

    static String TableName =

    "portlab_annotations",TableNameRead="TempVoltReadValues";

    String allData="";

    static Calendar cal;

    static SimpleDateFormat sdf;

    String[] list;

    String data_retrieved="";

    String value;

    22

  • 7/31/2019 Portable Lab

    23/47

  • 7/31/2019 Portable Lab

    24/47

    MOBILE PORTABLE LABSystem.out.println("Error while creating tables"+e);

    }

    }

    This is the piece of code which shows how the values are deleted from the table

    once the graphs are plotted using them.

    public void DeleteContents(String tempTableName)

    {

    this.tempTableName=tempTableName;

    try

    {

    String DELETE_QUERY_REMINDER = "Delete from

    "+tempTableName+";";

    myDB.execSQL(DELETE_QUERY_REMINDER);

    }

    catch(Exception e)

    {

    System.out.println("Error while Deleting the Contents"+e);

    }

    }

    Viewing the Charts in Android

    The chartengine is a jar file that is present in Google android Platform that is used

    to create various types of charts like bar chart,trignometric chart,bubble chart,harmonic

    chart etc. These are the packages that has to be imported in order to implement our

    application.

    24

  • 7/31/2019 Portable Lab

    25/47

    MOBILE PORTABLE LABpackage com.portablelab;

    import java.util.Date;

    import java.util.List;

    import org.achartengine.chart.PointStyle;

    import org.achartengine.model.CategorySeries;

    import org.achartengine.model.MultipleCategorySeries;

    import org.achartengine.model.TimeSeries;

    import org.achartengine.model.XYMultipleSeriesDataset;

    import org.achartengine.model.XYSeries;

    import org.achartengine.renderer.DefaultRenderer;

    import org.achartengine.renderer.SimpleSeriesRenderer;

    import org.achartengine.renderer.XYMultipleSeriesRenderer;

    import org.achartengine.renderer.XYSeriesRenderer;

    An abstract class for the demo charts to extend. It contains some methods for

    building datasets and renderers.public abstract class AbstractDemoChart implements

    IDemoChart Builds an XY multiple dataset using the provided values.param titles the

    series titles param xValues the values for the X axis param yValues the values for the Y

    axis return the XY multiple dataset

    protected XYMultipleSeriesDataset buildDataset(String[] titles, List xValues,

    List yValues) {

    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

    addXYSeries(dataset, titles, xValues, yValues, 0);

    return dataset;

    }

    public void addXYSeries(XYMultipleSeriesDataset dataset, String[] titles, List

    xValues,

    List yValues, int scale)

    {

    int length = titles.length;

    25

  • 7/31/2019 Portable Lab

    26/47

    MOBILE PORTABLE LABfor (int i = 0; i < length; i++) {

    XYSeries series = new XYSeries(titles[i], scale);

    double[] xV = xValues.get(i);

    double[] yV = yValues.get(i);

    int seriesLength = xV.length;

    for (int k = 0; k < seriesLength; k++) {

    series.add(xV[k], yV[k]);

    }

    dataset.addSeries(series);

    }

    }

    This piece of code Builds an XY multiple series renderer.The parameter colors the

    series rendering colors.The parameter styles the series point styles return the XY multiple

    series renderers.

    protected XYMultipleSeriesRenderer buildRenderer(int[] colors, PointStyle[] styles)

    {

    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

    setRenderer(renderer, colors, styles);

    return renderer;

    }

    protected void setRenderer(XYMultipleSeriesRenderer renderer, int[] colors, PointStyle[]

    styles) {

    renderer.setAxisTitleTextSize(16);

    renderer.setChartTitleTextSize(20);

    renderer.setLabelsTextSize(15);

    renderer.setLegendTextSize(15);

    renderer.setPointSize(5f);

    renderer.setMargins(new int[] { 20, 30, 15, 20 });

    26

  • 7/31/2019 Portable Lab

    27/47

    MOBILE PORTABLE LABint length = colors.length;

    for (int i = 0; i < length; i++) {

    XYSeriesRenderer r = new XYSeriesRenderer();

    r.setColor(colors[i]);

    r.setPointStyle(styles[i]);

    renderer.addSeriesRenderer(r);

    }

    }

    The given piece of code sets a few of the series renderer setting.The parameter

    renderer the renderers to set the properties to param title the chart title.The parameter xTitle

    the title for the X axis.The parameter yTitle the title for the Y axis.The parameter xMin the

    minimum value on the X axis.The parameter xMax the maximum value on the X axis.The

    parameter yMin the minimum value on the Y axis.The parameter yMax the maximum

    value on the Y axis.The parameter axesColor the axes color.The parameter labelsColor the

    labels color.

    protected void setChartSettings(XYMultipleSeriesRenderer renderer, String title, String

    xTitle,

    String yTitle, double xMin, double xMax, double yMin, double yMax, int axesColor,

    int labelsColor) {

    renderer.setChartTitle(title);

    renderer.setXTitle(xTitle);

    renderer.setYTitle(yTitle);

    renderer.setXAxisMin(xMin);

    renderer.setXAxisMax(xMax);

    renderer.setYAxisMin(yMin);

    renderer.setYAxisMax(yMax);

    renderer.setAxesColor(axesColor);

    renderer.setLabelsColor(labelsColor);

    }

    27

  • 7/31/2019 Portable Lab

    28/47

    MOBILE PORTABLE LABThe below piece of code builds an XY multiple time dataset using the provided

    values.The parameter titles the series titles.The parameter xValues the values for the X

    axis.The parameter yValues the values for the Y axis and return the XY multiple time

    dataset

    protected XYMultipleSeriesDataset buildDateDataset(String[] titles, List xValues,

    List yValues) {

    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

    int length = titles.length;

    for (int i = 0; i < length; i++) {

    TimeSeries series = new TimeSeries(titles[i]);

    Date[] xV = xValues.get(i);

    double[] yV = yValues.get(i);

    int seriesLength = xV.length;

    for (int k = 0; k < seriesLength; k++) {

    series.add(xV[k], yV[k]);

    }

    dataset.addSeries(series);

    }

    return dataset;

    }

    protected CategorySeries buildCategoryDataset(String title, double[] values) {

    CategorySeries series = new CategorySeries(title);

    int k = 0;

    for (double value : values) {

    series.add("Project " + ++k, value);

    }

    return series;

    }

    protected MultipleCategorySeries buildMultipleCategoryDataset(String title,

    28

  • 7/31/2019 Portable Lab

    29/47

    MOBILE PORTABLE LABList titles, List values) {

    MultipleCategorySeries series = new MultipleCategorySeries(title);

    int k = 0;

    for (double[] value : values) {

    series.add(2007 + k + "", titles.get(k), value);

    k++;

    }

    return series;

    }

    The given below is a piece of code builds a category renderer to use the provided

    colors.

    The parameter colors the colors and return the category renderer.

    protected DefaultRenderer buildCategoryRenderer(int[] colors) {

    DefaultRenderer renderer = new DefaultRenderer();

    renderer.setLabelsTextSize(15);

    renderer.setLegendTextSize(15);

    renderer.setMargins(new int[] { 20, 30, 15, 0 });

    for (int color : colors) {

    SimpleSeriesRenderer r = new SimpleSeriesRenderer();

    r.setColor(color);

    renderer.addSeriesRenderer(r);

    }

    return renderer;

    }

    protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List values)

    {

    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

    int length = titles.length;

    29

  • 7/31/2019 Portable Lab

    30/47

    MOBILE PORTABLE LABfor (int i = 0; i < length; i++) {

    CategorySeries series = new CategorySeries(titles[i]);

    double[] v = values.get(i);

    int seriesLength = v.length;

    for (int k = 0; k < seriesLength; k++) {

    series.add(v[k]);

    }

    dataset.addSeries(series.toXYSeries());

    }

    return dataset;

    }

    This piece of code Builds a bar multiple series renderer to use the provided

    colors.The parameter colors the series renderers colors and return the bar multiple series

    renderer.

    protected XYMultipleSeriesRenderer buildBarRenderer(int[] colors) {

    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();

    renderer.setAxisTitleTextSize(16);

    renderer.setChartTitleTextSize(20);

    renderer.setLabelsTextSize(15);

    renderer.setLegendTextSize(15);

    int length = colors.length;

    for (int i = 0; i < length; i++) {

    SimpleSeriesRenderer r = new SimpleSeriesRenderer();

    r.setColor(colors[i]);

    renderer.addSeriesRenderer(r);

    }

    return renderer;

    }

    }

    CHAPTER 6

    30

  • 7/31/2019 Portable Lab

    31/47

    MOBILE PORTABLE LABTESTING

    Testing is a major process involved in software quality assurance. Here test data is

    prepared and is used to test the modules individually. Verification is performed on the

    output of each phase, but some faults are likely to remain undetected by these methods.

    Testing is usually relied on to detect these faults, in addition to the faults introduced during

    the coding phase itself.

    The testing phase involves the testing of individual programming units and the

    functionality with various test data. As the goal of testing, to detect any errors in the

    program, different levels of testing are often used.

    6.1 UNIT TESTING

    Unit testing is a procedure used to validate that a particular module of source code

    is working properly. Individual units are tested to ensure that it operates correctly. Each

    component is tested independently with other system components. This type of testing is

    mostly done by the developers and not by end users. The goal of unit testing is to isolate

    each part of program and show that the individual units are operating correctly.

    The each unit of our project is tested individually like whether the server modules

    and client modules are working properly .The server module is tested by inserting, deleting

    and updating the values. The client module is tested by viewing charts, inserting comments,

    questions and answers.

    6.2 INTEGRATION TESTING

    In this level the testing modules are combined into a subsystem, which are then

    tested. Interface between the modules is tested to see whether the modules can interact

    properly. It main emphasizes on testing module interactions.

    31

  • 7/31/2019 Portable Lab

    32/47

    MOBILE PORTABLE LABThe client and server modules are integrated together to test whether they work in a

    proper way. We checked to see whether the client and server are communicating with each

    other in a proper way to exchange the information, whether the updating of data in server

    side is reflected in the client side.

    6.3 SYSTEM TESTING

    The testing is concerned with finding the errors. It is also concerned with validating

    that system meets its functional approaches. Deviation of errors discovered at this step in

    this project with the help of users by negotiating to establish resolving deficiencies. The

    system is put to operation along with the data acquisition board and the system is tested for

    errors and correct operation.

    6.4 ACCEPTANCE TESTING

    This is the final stage in the testing process before the system is accepted for

    operational use. It may reveal errors and omissions in the requirement definitions.

    Acceptance testing may also reveal requirement problems where the system performance is

    unacceptable.

    32

  • 7/31/2019 Portable Lab

    33/47

    MOBILE PORTABLE LABCHAPTER 7

    FLOW CHART

    FLOWCHART AT CLIENT END

    33

    START

    Select

    the mode

    of

    operation

    Install Application

    If ip, uname,

    pwd is valid

    Enter Ip address, username and pwd

    If Mode is online

    View the Ann Comments

    View the Respective Graph

    GUI will be displayed where the user can selectview Graphs and view Annotations

    Read hardware readings, annotations, comments

    and store in Mobile

    a

    a

    Yes

    No

    If Mode is offline

    Check the

    select

    option

    View GraphView Ann, COM

    Select the type of Graph

    Add new Comments update in the

    same at the server end only if user

    mode is online

    Read stores hardware readings, annotations,

    comments from mobile DB

    and store in Mobile

  • 7/31/2019 Portable Lab

    34/47

    MOBILE PORTABLE LABFLOWCHART AT SERVER END

    34

    START

    Start the Server

    If ip, uname,

    pwd is valid

    Waiting for the Mobiles Request

    Receive newly added comments or annotations at

    the mobile end update the same in Mysql DB

    Receive Stop command

    Registration of Lecturer and Student,With username and password

    Send hardware reading and annotations and

    comments to mobile

    Yes

    No

    Read the hardware values and update in Mysql

    db at the server end

    Waiting for the Mobiles Request

  • 7/31/2019 Portable Lab

    35/47

    MOBILE PORTABLE LABCHAPTER 8

    DATAFLOW DIAGRAM

    35

    2 Android Mobile Phone

    1. Install the Application.

    2. Select the Mode of Execution

    3. If Mode is offline

    a) Retrieve Mobile DB(values

    Previously read) values andDisplay the Graph and

    annotations.

    4. If the Mode is Online

    Send IpAddress ,Username and password

    to the server for validation

    Retrieve all the hardware readings

    annotations and comments and store into

    the SQLite DB.

    Display Graphs and Annotations to the

    user,so the user can select to view.

    User can add new comments and

    annotations and update in the DB and

    also send it to the server.

    1 Server PC

    1. Execute the Server

    2. Register New Lecturer and Student

    With the username and password.

    3. Read the Values from theHardware and save it in the DB

    Continuously

    4. Wait for the Request from Mobile.

    If the username and password is

    valid then send all the hardware read

    values and all the annotations to the

    android cell phone else Wait for the

    request from mobile.

    If the new comments or annotations

    are added at the mobile and update

    the same in the database

    IpAddress,Username

    ,pwd

    Read Hardware values,

    annotations and comm.

    From server DB

    New comments orannotations

    SQLite DB at the MobilesEndMySQL DB at the Servers End

  • 7/31/2019 Portable Lab

    36/47

    MOBILE PORTABLE LABCHAPTER 9

    SCREEN SHOTS

    Fig 9.1 starting the portable lab server

    36

  • 7/31/2019 Portable Lab

    37/47

    MOBILE PORTABLE LAB

    Fig 9.2 registering the user on the portable lab server

    37

  • 7/31/2019 Portable Lab

    38/47

    MOBILE PORTABLE LAB

    Fig 9.3 Running the Android Application

    38

  • 7/31/2019 Portable Lab

    39/47

    MOBILE PORTABLE LAB

    Fig 9.4 Beginning the Android application

    39

  • 7/31/2019 Portable Lab

    40/47

    MOBILE PORTABLE LAB

    Fig 9.5 Proceeding the Android application

    40

  • 7/31/2019 Portable Lab

    41/47

    MOBILE PORTABLE LAB

    Fig 9.6 Entering the IP address of the server

    41

  • 7/31/2019 Portable Lab

    42/47

    MOBILE PORTABLE LAB

    Fig 9.7 Student / Lecture Login Page

    42

  • 7/31/2019 Portable Lab

    43/47

    MOBILE PORTABLE LABCHAPTER 10

    SECURITY MEASURES TAKEN

    The server can be accessed by only those clients who have already successfully

    registered in the server.

    The authentication takes place in client side by entering the username and

    password. Client communicates with the server to validate the user information. Only the

    client who enters correct username and password gains access to server data. Even the

    server database has been protected from unauthorized access by username and password.

    Only the person entering valid username and password can gain access to server database.

    43

  • 7/31/2019 Portable Lab

    44/47

    MOBILE PORTABLE LABCHAPTER 11

    USER MANNUAL

    At the server end application opens up a icon on the screen indicating that the

    server is ready. The right click on this icon displays the added functionalities. There are

    three menu items in the main menu.

    First option is the button for starting the server; it is named as start server. This

    option helps the user to start the server. The second option is the button for registration of

    the new user. When you click on this button the registration form appears on the screen

    which requires the user to enter the username, password and the type of the user. The third

    button is to exit from the server.

    At the client end the GUI consists of application known as portable lab. When you

    click on this icon, it opens up a page with proceed button, click on proceed button. It will

    ask for the IP address of the server, enter the IP address. The login screen appears on the

    cell phone; enter the login information i.e. username, password and type of user. Select the

    mode either offline or online. Here user will have options of either viewing the charts or

    posting comments, questions and answers .

    44

  • 7/31/2019 Portable Lab

    45/47

    MOBILE PORTABLE LABCHAPTER 12

    SCOPE FOR FUTURE ENHANCEMENT

    This project is carried out as of our curriculum, which is specified by the university.

    This project can be improved to make it a full- fledged one by adding some of the features.

    This project can be further enhanced by

    Search of power readings, made on the server side - must be carried out by different

    criteria, like date, time or both.

    Deployment to various platforms other than android.

    The option for visualization of graphs like harmonic charts, bubble charts etc.

    45

  • 7/31/2019 Portable Lab

    46/47

    MOBILE PORTABLE LABCHAPTER 13

    CONCLUSION

    The use of m-learning tools, if correctly conceptualized and built, constitutes an

    efficient complementary tool to the traditional teaching methods. Distance education,

    particularly e-learning and m-learning, has been receiving increased attention from diverse

    institutions, conferences and publications. Additionally, sophisticated smart phones are

    increasing their sales in comparison to the basic cell phones and engineering students are

    massively using them. Regarding the target platform, the increasingly sales numbers of

    Android based mobile devices and the fact that Google software is booming show that the

    decision made is good. All these points, among others presented throughout ,mean that this

    project is interesting, innovative, beneficial, and has potential to be profitable.

    46

  • 7/31/2019 Portable Lab

    47/47

    MOBILE PORTABLE LABBIBLIOGRAPHY

    1. C. Romero, S. Ventura, and P. Bra, Using Mobile and Web-based Computerized

    Tests to Evaluate University Students, Computer Applications in EngineeringEducation Journal, vol. 9999, Published online in Wiley InterScience

    ww.interscience.wiley.com), 2009, DOI 10.1002/cae.20242.

    2. R.N. Madeira, V.F. Pires, O.P. Dias, and J.F. Martins, Development of a Mobile

    Learning Framework for an Analog Electronics Course, Proc. Int. Conf. IEEE

    Education Engineering (EDUCON), Madrid, Spain, 2010, pp. 561 567.

    3. D. Frohberg, C. Gth, and G. Schwabe, Mobile Learning projects a critical

    analysis of the state of the art. Journal of Computer Assisted Learning, vol. 25, no.

    2009, pp. 307331.

    4. Mobile Learning Network (MoLeNET), What is Mobile Learning?,

    http://www.molenet.org.uk/, 2009.

    5. http://www.slideshare.net/linade/mobile-learning-aprendizagem-mvel, pp. 7, 2010

    (last access: Aug. 2010).