You are on page 1of 33

Energy applications for nano mobiles

Project ID: 3296



A Final Project Report
Submitted in fulfillment of
the requirements for the
Degree of Bachelor of Technology
Under Biju Patnaik University of Technology

Submitted By
Manjit Kumar Patro Roll # CSE 201018258
Soumyashree Pattnaik Roll # IT 201011439



2013 - 2014


Under the guidance of
Mrs. Arunima Sambhuta Pattanayak








NATIONAL INSTITUTE OF SCIENCE & TECHNOLOGY
Palur Hills, Berhampur, Orissa 761008, India


BONAFIDE CERTIFICATE

This is to certify that the project report entitled Energy Application for nano mobile
is carried out and submitted by Mr. Manjit Kumar Patro, Roll No. 201018258 and Ms.
Soumyashree Pattnaik, Roll No. 201011439 under my supervision.

This report is submitted in fulfillment of the requirements for the award of the degree
of Bachelor of Technology from Biju Patnaik University of Technology, Rourkela, Odisha,
India.




(Advisor) (B.Tech Project Coordinator)





(Placement Director) (Director)



Institute Seal



i
ACKNOWLEDGEMENT

We would like to take this opportunity to thank all those individuals whose invaluable
contribution in a direct or indirect manner has gone into the making of this project a
tremendous learning experience for us.

We give our sincere thanks to Mrs.Arunima Sambhuta Pattnayak, Project Advisor, for
giving us the opportunity and motivating us to do the project within a stipulated period of
time and providing a helping environment. We are also grateful to Mr. Bhawani Shankar
Patnaik and Mrs. Rashmita Jena for their valuable suggestions for successful completion of
our project.

We acknowledge with immense pleasure the sustained interest, encouraging attitude and
constant inspiration rendered by Prof. Sangram Mudali (Director) & Prof. Geetika Mudali
(Placement Director)N.I.S.T. Their continued drive for better quality in everything that
happens at N.I.S.T. and selfless inspiration has always helped us to move ahead.





Manjit Kumar Patro

Soumyashree Pattnaik









ii
ABSTRACT
Our project is based upon developing an android application for NanoSoft through which
users will be able to see monitor their power usage. The user can login to his account using
this application and can be able to see the schedule of power used by him.
A user can be logged in by entering his user id along with the password and ip address and
then he need to tap on the login button. Once the user gets logged in he will be able switch
over to the home page where by clicking on the customer desk button he can see the different
power schedules.
For android programming using java, we used eclipse IDE with ADT plugin. Front end design
was done using this particular tool only. However for backend design we used mysql server
database. The link between the front-end and back-end, php is used as our server side scripting
language. The server which enables our php codes work into action is, Apache Tomcat HTTP
server(using XAMPP).
With Googles latest launch for mobile Android Operating System, we did this project
starting from ABC of it up to Creating Basic Application. Here we are describing about
Android, features, capabilities, application, what we developed.


















iii




TABLE OF CONTENTS

ACKNOWLEDGEMENT ........................................................................................................ i
ABSTRACT .............................................................................................................................. ii
TABLE OF CONTENTS .......................................................................................................iii
LIST OF FIGURES ................................................................................................................. v
1. INTRODUCTION................................................................................................................ 1
2. HISTORY OF ANDROID .................................................................................................. 2
2.1 VERSIONS OF ANDROID ............................................................................................. 3
3. ARCHITECTURE OF ANDROID .................................................................................... 4
3.1 Linux kernel ..................................................................................................................... 4
3.2 Libraries ........................................................................................................................... 4
3.3 Android Runtime .............................................................................................................. 5
3.4 Application Framework.................................................................................................... 5
3.5 Applications ..................................................................................................................... 5
4. APPLICATION DEVELOPMENT ................................................................................... 6
4.1 Development Toolkit........................................................................................................ 6
4.1.1 SDK........................................................................................................................... 6
4.1.2 ADT Plugin ............................................................................................................... 7
4.1.3 Emulator .................................................................................................................... 8
4.1.4 DrawDroid ................................................................................................................ 8
5. LAYOUTS ............................................................................................................................ 9
5.1 Linear Layout ................................................................................................................. 10

iv
5.2 RelativeLayout ............................................................................................................... 10
5.3 FrameLayout .................................................................................................................. 11
5.4 Table Layout .................................................................................................................. 11
5.5 List View ........................................................................................................................ 11
6. NANO SOFT FOR NANO POWER MANAGEMENT ................................................. 12
6.1 NTCS (NIST Technology and Consulting Services) ..................................................... 12
6.2 NTCS offers the following range of services: ................................................................ 12
7. AREA OF APPLICATION ............................................................................................... 14
8. POWER SUPPLY SCHEDULING .................................................................................. 15
9. ENERGY APPLICATION FOR NANO MOBILES...................................................... 17
9.1 Data Base........................................................................................................................ 17
9.1.1 WAMP Server ......................................................................................................... 18
9.2 Login Page...................................................................................................................... 18
9.2.1 Shared Preferences .................................................................................................. 19
9.3 Home Page ..................................................................................................................... 19
9.3.1 Onclick Listener ...................................................................................................... 20
9.3.2 Intent ....................................................................................................................... 21
9.4 Customer Desk ............................................................................................................... 22
9.5 Scheduling ...................................................................................................................... 23
10. CONCLUSION AND FUTURE WORK ....................................................................... 25
10.1 Conclusion .................................................................................................................... 25
10.2 Future Work ................................................................................................................. 25
REFERENCES ....................................................................................................................... 26


v
LIST OF FIGURES


Figure 1.1: Android .......................................................................................................................... 1
Figure 2.1: Version of android ....................................................................................................... 3
Figure 3.1: Architecture .................................................................................................................. 4
Figure 4.1: SDK TOOL ................................................................................................................... 7
Figure 5.1: Layout Directory .......................................................................................................... 9
Figure 5.2: Linear Layout .............................................................................................................. 10
Figure 5.3: Relative Layout ........................................................................................................... 10
Figure 7.1: Nano Soft Home Page ............................................................................................... 14
Figure 7.2: Area Of Application .................................................................................................... 14
Figure 8.1: Scheduling Page(Tabular) ......................................................................................... 15
Figure 8.2 Scheduling Page ......................................................................................................... 15
Figure 8.3: Scheduling Page(Graphical) ..................................................................................... 16
Figure 9.1: Login Page .................................................................................................................. 18
Figure 9.2: Login Page With Valid Username ............................................................................. 19
Figure 9.3: Home Page ................................................................................................................ 20
Figure 9.4: OnclickListener ........................................................................................................... 21
Figure 9.5: Intent ........................................................................................................................... 22
Figure 9.6 The Page Displaying the Customer Details ..............................................................23
Figure 9.7:Scheduling .................................................................................................................. 24






1
Chapter 1

INTRODUCTION

Nano mobile is an android based mobile application using which nano power user can
monitor, schedule and control their energy usage. This application has been used in
synchronization with nano soft which is developed by NTCS.

Android is a mobile operating system running on the Linux kernel. World is contracting with
the growth of mobile phone technology. As the number of users is increasing day by day,
facilities are also increasing. Starting with simple regular handsets which were used just for
making phone calls, mobiles have changed our lives and have become part of it. Now they
are not used just for making calls but they have innumerable use and can be used as a Camera
,Music player, Tablet PC, T.V., Web browser etc. And with the new technologies, new
software and operating systems are required. It was initially developed by Android Inc., a
firm later purchased by Google, and lately by the Open Handset Alliance. It allows
developers to write and manage code in the Java language, controlling the device via Google-
developed Java libraries.






Figure 1.1: Android
ENERGY APPLICATION USING NANO MOBILE
2
Chapter 2

HISTORY OF ANDROID

Android, Inc. was founded in Palo Alto, California in October 2003 by Andy Rubin (co-
founder of Danger), Rich Miner (co-founder of Wildfire Communications, Inc.), Nick
Sears (once VP at T-Mobile), and Chris White (headed design and interface development
at WebTV) to develop, in Rubin's words "smarter mobile devices that are more aware of its
owner's location and preferences". The early intentions of the company were to develop an
advanced operating system for digital cameras, when it was realized that the market for the
devices was not large enough, and diverted their efforts to producing a smartphone operating
system to rival those of Symbian and Windows Mobile (Apple's iPhone had not been released
at the time). Despite the past accomplishments of the founders and early employees, Android
Inc. operated secretly, revealing only that it was working on software for mobile phones. That
same year, Rubin ran out of money. Steve Perlman, a close friend of Rubin, brought him
$10,000 in cash in an envelope and refused a stake in the company. Google acquired Android
Inc. on August 17, 2005, making it a wholly owned subsidiary of Google. Key employees of
Android Inc., including Rubin, Miner and White, stayed at the company after the
acquisition. Not much was known about Android Inc. at the time, but many assumed that
Google was planning to enter the mobile phone market with this move. At Google, the team
led by Rubin developed a mobile device platform powered by the Linux kernel. Google
marketed the platform to handset makers and carriers on the promise of providing a flexible,
upgradable system. Google had lined up a series of hardware component and software
partners and signaled to carriers that it was open to various degrees of cooperation on their
part. Speculation about Google's intention to enter the mobile communications market
continued to build through December 2006. Reports from the BBC and the Wall Street
Journal noted that Google wanted its search and applications on mobile phones and it was
working hard to deliver that. Print and online media outlets soon reported rumors that Google
was developing a Google-branded handset. Some speculated that as Google was defining
technical specifications, it was showing prototypes to cell phone manufacturers and network
operators. In September 2007,Information Week covered a study reporting that Google had
filed several patent applications in the area of mobile telephony.


ENERGY APPLICATION USING NANO MOBILE
3
2.1 VERSIONS OF ANDROID
1. Android beta
2. Android 1.0
3. Android 1.1
4. Android 1.5 Cupcake
5. Android 1.6 Donut
6. Android 2.0/2.1 Eclair
7. Android 2.2.x Froyo
8. Android 2.3.x Gingerbread
9. Android 3.x Honeycomb
10. Android 4.0.x Ice Cream Sandwich
11. Android 4.1/4.2/4.3 Jelly Bean
12. Android 4.4 KitKat



Figure 2.1: Version of android



ENERGY APPLICATION USING NANO MOBILE
4
Chapter 3

ARCHITECTURE OF ANDROID

Android relies on Linux version 2.6 for core system services such as security, memory
management, process management, network stack, and driver model. The kernel also acts as
an abstraction layer between the hardware and the rest of the software stack. See the figure on
bellow.

Figure 3.1: Architecture
3.1 Linux kernel
At the bottom of the layers is Linux - Linux 2.6 with approximately 115 patches. This
provides basic system functionality like process management, memory management, device
management like camera, keypad, display etc. Also, the kernel handles all the things that
Linux is really good at such as networking and a vast array of device drivers, which take the
pain out of interfacing to peripheral hardware.
3.2 Libraries
On top of Linux kernel there is a set of libraries including open-source Web browser engine
Weskit, well known library libc, SQLite database which is a useful repository for storage and
ENERGY APPLICATION USING NANO MOBILE
5
sharing of application data, libraries to play and record audio and video, SSL libraries
responsible for Internet security etc.
System C library - a BSD-derived implementation of the standard C system library (libc),
tuned for embedded Linux-based devices
Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and
recording of many popular audio and video formats, as well as static image files, including
MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
Surface Manager - manages access to the display subsystem and seamlessly composites 2D
and 3D graphic layers from multiple applications
LibWebCore - a modern web browser engine which powers both the Android browser and an
embeddable web view
3.3 Android Runtime
This is the third section of the architecture and available on the second layer from the bottom.
This section provides a key component called Dalvik Virtual Machine which is a kind of
Java Virtual Machine specially designed and optimized for Android. The Dalvik VM makes
use of Linux core features like memory management and multi-threading, which is intrinsic
in the Java language. The Dalvik VM enables every Android application to run in its own
process, with its own instance of the Dalvik virtual machine. The Android runtime also
provides a set of core libraries which enable Android application developers to write Android
applications using standard Java programming language.

3.4 Application Framework
The Application Framework layer provides many higher-level services to applications in the
form of Java classes. Application developers are allowed to make use of these services in
their applications.
3.5 Applications
You will find all the Android application at the top layer. You will write your application to
be installed on this layer only. Examples of such applications are Contacts Books, Browser,
Games etc.
ENERGY APPLICATION USING NANO MOBILE
6
Chapter 4

APPLICATION DEVELOPMENT

Android is provide Great support for Android developers to hardware and software platform
and Android OS Offers basic operating system services, message passing, and inter-process
communication on the device. Android OS is designed & developed in such technical way
that allows Android application developer to utilize third party Android application
development. Android application Development India ( AADI ) is offers a wide range of
custom Android app development Services For Android based mobile phones or tablets
Android apps like Multimedia Apps, Office/Business Apps, Communication Apps, Security
Apps, Internet Apps and many more ...Hire qualified and professional android application
developers at aadi at just affordable rate with high quality with 100% Client satisfaction.

4.1 Development Toolkit
1. SDK (Software Development Kit)
2. Eclipse
3. ADT Plugin
4. DrawDroid

4.1.1 SDK

The Android SDK includes a comprehensive set of development tools. These include a
debugger, libraries, a handset emulator (based on QEMU), documentation, sample code, and
tutorials. Currently supported development platforms include x86- architecture computers
running Linux (any modern desktop Linux distribution), Mac OS X 10.4.8 or later, Windows
XP or Vista. Requirements also include Java Development Kit, Apache Ant, and Python 2.2
or later. The officially supported integrated development environment (IDE) is Eclipse (3.2 or
later) using the Android Development Tools (ADT) Plugin, though developers may use any
text editor to edit Java and XML files then use command line tools to create, build and debug
Android applications. Android Applications are packaged in .apk format and stored under
/data/app folder on the Android OS. The user can run the command adb root to access this
folder as only the root has permissions to access this folder.
ENERGY APPLICATION USING NANO MOBILE
7

Figure 4.1: SDK TOOL

4.1.2 ADT Plugin
The Android Development Tools (ADT) plugin for Eclipse adds powerful extensions to the
Eclipse integrated development environment. It allows you to create and debug Android
applications easier and faster. If you use Eclipse, the ADT plugin gives you an incredible
boost in developing Android applications.
1. It gives you access to other Android development tools from inside the Eclipse
IDE.
2. For example, ADT lets you access the many capabilities of the DDMS tool: take
screenshots, manage port-forwarding, set breakpoints, and view thread and
process information directly from Eclipse.
3. It provides a New Project Wizard, which helps you quickly create and set up all of
the basic files you'll need for a new Android application.
4. It automates and simplifies the process of building your Android application.
5. It provides an Android code editor that helps you write valid XML for your
Android manifest and resource files.
6. It will even export your project into a signed APK, which can be distributed to
users.


ENERGY APPLICATION USING NANO MOBILE
8

4.1.3 Emulator
The Android SDK includes a mobile device emulator -- a virtual mobile device that runs on
your computer. The emulator lets you prototype, develop, and test Android applications
without using a physical device. The Android emulator mimics all of the typical hardware
and software features of a typical mobile device, except that it can place actual phone calls. It
provides a variety of navigation and control keys, which you can "press" using your mouse or
keyboard to generate events for your application. It also provides a screen in which your
application is displayed, together with any other Android applications running. To let you
model and test your application more easily, the emulator supports Android Virtual Device
(AVD) configurations. AVDs let you specify the Android platform that you want to run on
the emulator, as well as the hardware options and emulator skin fil you want to use. Once
your application is running on the emulator, it can use the services of the Android platform to
invoke other applications, access the network, play audio and video, store and retrieve data,
notify the user, and render graphical themes. The emulator also includes a variety of debug
capabilities, such as a console from which you can log kernel output, simulate application
interrupts (such as arriving SMS messages or phone calls), and simulate latency effects and
dropouts on the data channel.
Limitations in Emulator:
1. No support for placing or receiving actual phone calls. You can simulate phone calls
(placed and received) through the emulator
2. Console, however.
3. No support for USB connections
4. No support for camera/video capture (input).
5. No support for device-attached headphones
6. No support for determining connected state
7. No support for determining battery charge level and AC charging state

4.1.4 DrawDroid

It is a simply Java application to design a GUI for any android application. It contains large
number of widgets, layouts, buttons and all that we need to make a well fledge android app.
Through drag and drop, we can design the layout and in back end it will generate the xml
code which we can use directly in any particular application.
ENERGY APPLICATION USING NANO MOBILE
9

Chapter 5

LAYOUTS

1. A layout defines the visual structure for a user interface, such as the UI for an
activity or app widget. You can declare a layout in two ways:
2. Declare UI elements in XML. Android provides a straightforward XML vocabulary
that corresponds to the View classes and subclasses, such as those for widgets and
layouts.
3. Instantiate layout elements at runtime. Your application can create View and View
Group objects (and manipulate their properties) programmatically.
4. The Android framework gives you the flexibility to use either or both of these
methods for declaring and managing your application's UI. For example, you could
declare your application's default layouts in XML, including the screen elements that
will appear in them and their properties. You could then add code in your application
that would modify the state of the screen objects, including those declared in XML,
at run time.


Figure 5.1: Layout Directory



ENERGY APPLICATION USING NANO MOBILE
10
5.1 Linear Layout
Linear Layout is a view group that aligns all children in a single direction, vertically or
horizontally. You can specify the layout direction with the android: orientation attribute. All
children of a Linear Layout are stacked one after the other, so a vertical list will only have
one child per row, no matter how wide they are, and a horizontal list will only be one row
high (the height of the tallest child, plus padding). A Linear Layout respects margins between
children and the gravity (right, center, or left alignment) of each child.

Figure 5.2: Linear Layout

5.2 RelativeLayout
RelativeLayout is a view group that displays child views in relative positions. The position of
each view can be specified as relative to sibling elements (such as to the left-of or below
another view) or in positions relative to the parent RelativeLayout area (such as aligned to the
bottom, left of center). A RelativeLayout is a very powerful utility for designing a user
interface because it can eliminate nested view groups and keep your layout hierarchy flat,
which improves performance. If you find yourself using several nested LinearLayout groups,
you may be able to replace them with a single RelativeLayout.

Figure 5.3: Relative Layout


ENERGY APPLICATION USING NANO MOBILE
11
5.3 FrameLayout

FrameLayout is designed to block out an area on the screen to display a single item.
Generally, FrameLayout should be used to hold a single child view, because it can be
difficult to organize child views in a way that's scalable to different screen sizes without the
children overlapping each other. You can, however, add multiple children to a FrameLayout
and control their position within the FrameLayout by assigning gravity to each child, using
the android: layout_gravity attribute. Child views are drawn in a stack, with the most recently
added child on top. The size of the FrameLayout is the size of its largest child (plus padding),
visible or not (if the FrameLayout's parent permits). Views that are GONE are used for sizing
only if setConsiderGoneChildrenWhenMeasuring is set to true.

5.4 Table Layout
A layout that arranges its children into rows and columns. A TableLayout consists of a
number of Table Row objects, each defining a row (actually, you can have other children,
which will be explained below). TableLayout containers do not display border lines for their
rows, columns, or cells. Each row has zero or more cells; each cell can hold one View
object. The table has as many columns as the row with the most cells. A table can leave cells
empty. Cells can span columns, as they can in HTML. The width of a column is defined by
the row with the widest cell in that column. However, a Table Layout can specify certain
columns as shrinkable or stretchable by calling setColumnShrinkable() or
setColumnStretchable(). If marked as shrinkable, the column width can be shrunk to fit the
table into its parent object. If marked as stretchable, it can expand in width to fit any extra
space. The total width of the table is defined by its parent container. It is important to
remember that a column can be both shrinkable and stretchable. In such a situation, the
column will change its size to always use up the available space, but never more. Finally,
you can hide a column by calling setColumnCollapsed().
5.5 List View
List View is a view group that displays a list of scrollable items. The list items are
automatically inserted to the list using an Adapter that pulls content from a source such as an
array or database query and converts each item result into a view that's placed into the list.
For an introduction to how you can dynamically insert views using an adapter, read Building
Layouts with an Adapter.
ENERGY APPLICATION USING NANO MOBILE
12
Chapter 6

NANO SOFT FOR NANO POWER MANAGEMENT

It is a software which is used for nano power management. This software is developed by
NTCS (NIST Technology and Consulting Services) whose purpose is to make the use of
energy in a proper manner. Using this software we can reduce our power consumption.
NanoSoft Remote is a comprehensive cloud-based solution to remotely monitor, manage, and
maintain micro-grid electricity generation, distribution, delivery, metering, and billing. It also
comprises modules for asset tracking, human resources, ERP, training, CRM, policy,
emissions calculation, and ROI estimation. NanoSoft is an integral part of SunMokshas
patented NanoPower solutions to address access to energy issues, including skills
development and business models for employment generation. The word Nano signifies
small, modular, and affordable for the masses.

6.1 NTCS (NIST Technology and Consulting Services)
NIST Technology and Consulting Services is a division of the National Institute of Science
& Technology and was set up with some simple goals:
Provide high quality and up-to-date IT services at a low price to various organizations
in Orissa and other regions of India to enable them to compete in the global markets
of the new millennium.
Provide high quality educational services in Information Technology (IT)
Create high end employment opportunities in the IT field for people of Orissa and
India.
6.2 NTCS offers the following range of services:
Development of Customized IT Solutions - for more efficient operations of your
organization.
Information Technology Audit - a study of business processes of an organization to
help organizations maximize the utilization of their computer resources.
ENERGY APPLICATION USING NANO MOBILE
13
Quality Improvement Programs for IT Personnel- on various aspects of Information
Technology. These could take the form of lectures, workshops, one-to-one training
sessions or any other customized program.
Quality Improvement Programs for Software Developers - are programs designed to
upgrade the skill levels of your in-house software developers.
















ENERGY APPLICATION USING NANO MOBILE
14
Chapter 7

AREA OF APPLICATION

This software especially is developed for the use of energy efficiently in rural sections where
people can get a chance to use the nano power at a less cost.

Figure 7.1: Nano Soft Home Page

As shown in the above figure 7.1 this has already been implemented in nist edc building.

Figure 7.2: Area Of Application

This figure 7.2 gives a satellite view of the area where this technology is going to be
implemented.
ENERGY APPLICATION USING NANO MOBILE
15


Chapter 8

POWER SUPPLY SCHEDULING



Figure 8.1: Scheduling Page(Tabular)

The above figure 8.1 gives the idea about the on which day we have used the power
including the time in tabular format.


Figure 8.2 Scheduling Page

ENERGY APPLICATION USING NANO MOBILE
16
The above figure 8.2 gives the view of the page where the user can select in which manner he
wants to get the schedule of power consumed i.e. weather in daily basis or in weakly basis or
in monthly basis.

Figure 8.3: Scheduling Page(Graphical)

The above figure 8.3 gives the information about how much power is consumed on a
particular day graphically. Similarly it can be driven out for a particular week and month.













ENERGY APPLICATION USING NANO MOBILE
17
Chapter 9

ENERGY APPLICATION FOR NANO MOBILES

The objective of our project is to develop an application for nano mobiles which will be
helpful to access the data related to nano soft. The user can have access to the data by logging
in to his account through this app. Then he can check the amount of current consumed by him
per different time schedules.

Initially we installed Eclipse IDE with ADT plug in and started learning different features of
this IDE. Gradually we learned how to program using java for android devices. Gradually we
learned how to program using java for android devices. We learned the basics of android
programming like layout designing in android, getting different activities to work in android,
how to run an emulator etc. Once we had some basic ideas about all the necessary tools; we
started working on our project.

9.1 Data Base
Before switching over to the home page we created a local database using sqlite database
through which data were retrieved from the local database. The local database acts as a
temporary storage place where the data of the customer is kept unless is deleted by the user or
updated by the user. We run our server using WAMP server in our laptop. For storing the
data for the customers log in information the required table is created in Mysql. All
information of a customer are stored accordingly in the database. The android application
programmatically sends request to the server on behalf of the customer (user) using php and
accordingly the server responds. For example if a customer wants to log in he or she sends up
his or her Login Id and password fields to the server and if the field matches as per the
customers request, server responds by enabling the user to view the next page that is the
home page else the message for invalid user or password is displayed.

And the last but not the least the Reset button in the lohin page clears all the saved
information about the customers Login detail. We used shared preferences for storing
the data locally in the edit text (username, password, ip) which is help for one time login (if
your login is successful then it will save for next time and no need to login again).
ENERGY APPLICATION USING NANO MOBILE
18
9.1.1 WAMP Server

WampServer is a platform for Web development on Windows for dynamic Web applications
using the Apache2 server, PHP scripting language and a MySQL database. It also has
PHPMyAdmin to easily manage your databases.

9.2 Login Page

The Login page is the page which will be displayed at first when the application will be
started. This page contains two button named Login and Reset. Through the Login button the
use can have access to the next page and once a user gets Logged in the preference will be
saved for the next time and no need for the user to give the information again for Logging in.
Through the reset button we can clear the saved preference and it gives chance to another
user to Login. This Login page takes care of all the verifications and validations for Login of
a valid user of Nano Soft only. If incorrect information is entered, this Login page informs
what and where the problem lies and in the IP field we will give any databases address
which will get connected easily without any queries.

If there is a validation error then it will show validation error in toast (which is used for
display message in android). If data are not in the database then it will show database error.

Figure 9.1: Login Page
ENERGY APPLICATION USING NANO MOBILE
19


Figure 9.2: Login Page With Valid Username

9.2.1 Shared Preferences

Interface for accessing and modifying preference data returned
by getSharedPreferences(String, int). For any particular set of preferences, there is a single
instance of this class that all clients share. Modifications to the preferences must go through
an SharedPreferences. Editor object to ensure the preference values remain in a consistent
state and control when they are committed to storage. Objects that are returned from the
various get methods must be treated as immutable by the application.
Preferences are typically name value pairs. They can be stored as Shared Preferences
across various activities in an application (note currently it cannot be shared across
processes). Or it can be something that needs to be stored specific to an activity (which is not
discussed here). The context object lets you retrieve SharedPreferences through the
methodContext.getSharedPreferences().

9.3 Home Page

Once a valid user gets logged in he or she is redirected to the next page that is the home page.
It contains many buttons such as customer desk, discussion forum, service and maintenance.
ENERGY APPLICATION USING NANO MOBILE
20
Each button in the home page when will be clicked the user will be switched over to a new
page i.e. it will be switched over from one activity to another activity. To get respon for a
user click on a text view or a button in android we are using OnClickListener. And in
android to switch over from one activity to another activity intent is used.


Figure 9.3: Home Page

9.3.1 Onclick Listener

The View class provides the basis for most user interface functions in Android. Using this
and the "OnClickListener" interface, Android applications can respond to user clicks,
retrieving information such as text entered by the user into an editable text-field. Within an
Android Activity class, developers can choose to implement certain interfaces. By
implementing an interface, a class is committed to providing set methods. To respond to user
clicks, Android Activity classes can implement the "OnClickListener" interface, as in the
following class declaration outline:
public class InputScreen extends Activity implements OnClickListener { //class declaration }
If the developer is using an Integrated Development Environment (IDE) such as Eclipse to
build the application, it will output error messages until the class provides the methods
required by the interface it is choosing to implement.
In a class that implements "OnClickListener", the developer can specify a method to handle
user clicks:
ENERGY APPLICATION USING NANO MOBILE
21
Button inputBtn = (Button)findViewById(R.id.inputbutton);
inputBtn.setOnClickListener(this);
This code specifies a user interface View element by referencing it through the application
resources. In this case the View item is a button, but it could be any other View item. The
code instructs Android to call the "onClick" method when the user clicks this button. The
class must also provide the method:
public void onClick(View v) { //respond to click }
The method passes the View item the user has clicked, so that the class can check which item
was clicked, if more than one has the click listener registered. Inside the method, the code can
carry out an appropriate response, such as gathering text entered by the user.

Figure 9.4: OnclickListener

9.3.2 Intent

Intent is exactly what it describes. It's an "intention" to do an action. An intent is basically a
message to say you did or want something to happen. Depending on the intent, apps or the
OS might be listening for it and will react accordingly. Think of it as a blast email to a bunch
of friends, in which you tell your friend X to do something. The other folks will ignore the
email, but X will react to it. To listen for an intent (like the phone ringing, or an SMS is
received), you implement a broadcast receiver. If you want to fire off intent to do something,
like pop up the dialer, you fire off an intent saying you will.
After writing a single activity, there comes a need to transition to another activity to perform
another task either with or without information from the first activity. Android platform
allows transition by means of Intent Interface.
ENERGY APPLICATION USING NANO MOBILE
22
Intent is basically a message that is passed between components (such as Activities, Services,
Broadcast Receivers, and Content Providers). So, it is almost equivalent to parameters passed
to API calls.
There are two types of intents:
Explicit intents specify the component to start by name (the fully-qualified class name).
You'll typically use an explicit intent to start a component in your own app, because you
know the class name of the activity or service you want to start. For example, start a new
activity in response to a user action or start a service to download a file in the
background.
Implicit intents do not name a specific component, but instead declare a general action
to perform, which allows a component from another app to handle it. For example, if you
want to show the user a location on a map, you can use an implicit intent to request that
another capable app show a specified location on a map.


Figure 9.5: Intent
9.4 Customer Desk

This is the button which when be clicked will give the details about the connections. It gives
the information regarding the different connection given to different customers.
It gives the details such as name of the customers, their address, connection id, meter id and
details. The detail column consists of a number of buttons each for an individual connection.
When a button will be clicked it will switch over to the next page which will display the use
of current in different schedules i.e. the scheduling page will be displayed.

ENERGY APPLICATION USING NANO MOBILE
23
The scheduling page gives the information about the power consumed by the user in different
schedules. First of all there are two buttons named On Scheduling and Off Scheduling.
And each box in the scheduling table is a button itself which when be clicked will switch
over to a different activity. If the user selects On Scheduling the scheduling page gives
information about the power consumed in particular schedules as selected by the user. If the
user selects Off Scheduling the scheduling page gives information about the power not
consumed in different schedules.
The page is designed in such a way that in On Scheduling mode the selected schedules will
be turned into red color and others are will be of green color and in Off Scheduling mode
the schedules for which the power is not consumed will be turned into red and the other will
be of green color.


Figure 9.6 The Page Displaying the Customer Details

9.5 Scheduling

In the scheduling part it will show the total schedule of your own organization. Here it will
show the accurate time of when the power is ON/OFF. Also we can control the power as per
our requirement. Even the time of ON/OFF will be shown by this page.In this page we have
prepared a table structure in which time and day are the co-ordinates. When we click on a
specific box it will turn red that means it set in the database and power will be allotted to that
particular building on that particular day at that very instant time. When we start this page it
will show which values previously stored in the database. But in order to store the values in
ENERGY APPLICATION USING NANO MOBILE
24
the database we must not forget to click on SAVE button. In this page there are two radio-
buttons namely ON-SCHEDULING and OFF-SCHEDULING which will help us.to
determine whether to supply power or to deny supply of power respectively.


Figure 9.7:Scheduling



















ENERGY APPLICATION USING NANO MOBILE
25

Chapter 10

CONCLUSION AND FUTURE WORK

10.1 Conclusion

We have developed an application for nano soft using which the user can have access to the
energy consumed by him i.e. how much energy he has consumed along with he will be able
to see during which time. The b-tech project contains the monitoring part which includes the
scheduling. We have done the scheduling part in which we are showing the power schedules
in tabular format. Android is a truly open, free development platform based on Linux and
open source. Handset makers can use and customize the platform without paying a royalty.
A component-based architecture inspired by Internet mash-ups. Parts of one application can
be used in another in ways not originally envisioned by the developer. can even replace
built-in components with own improved versions. This will unleash a new round of
creativity in the mobile space.
1. Android is open to all: industry, developers and users
2. Participating in many of the successful open source projects
3. Aims to be as easy to build for as the web.
4. Google Android is stepping into the next level of Mobile Internet.
5. Using android we have developed an app for nano soft. In this app we can control the
current. We can give more facility to people.
10.2 Future Work

1. In future it will be tried to connect to the college database.
2. It can help the user to reduce the excess use of power and they can keep a track of
their power consumption schedule using which he or she can control his or her power
consumption.
3. Further the controlling part need to be done in the future so that a user will be able to
perform some more activities through this app such as he can lunch a complain, can
do e-payments etc.

ENERGY APPLICATION USING NANO MOBILE
26
REFERENCES

[1] Android in Practice , Charlie Collins Michael D. Galpin Matthias Kappler.
[2] Android Programming Tutorials by Mark L. Murphy.
[3] BEGINANDROIDJOURNEYINHOURS CS425 / CSE 424 / ECE 428 [Fall 2009]
[4] Ying Huang : Sept. 14, 2009
[5] Job Scheduling on the Grid:Towards SLA-Based Scheduling,Rizos School of
Computer Science, University of Manchester, Oxford Road,Manchester M13 9PL,
United Kingdom.
[6] 2. B. Yagoubi, Y. Slimani. Task Load Balancing Strategy for Grid Computing.
Journal of Computer Science 3 (3): 186-194, 2007.
[7] I. Foster, C. Kesselman, S. Tuecke. The Anatomy of the Grid: Enabling Scalable
Virtual Organizations. International J. Supercomputer Applications, 15(3),2001
[8] T. DeFanti and R. S. Teleimmersion. The Grid:blueprint for a New Computing
Infrastructure, InFoster, I. and Kesselman, C.eds. Morgan Kaufmann,1999, 131-155.
[9] Sivagama Sundari M. Long-running Multi-component Climate Applications on Grids.
[10] T.L. Casavant and J.G. Khul. A taxonomy of scheduling in general purpose
distributed computing systems. IEEE Transaction on Software Engineering,Vol. 14,
No. 2, 1999, pp.141-153.
[11] IT-Tude.com - Service Level Agreements
[12] Viktor Yarmolenko, Rizos SakellariouSchool of Computer Science, The University of
Manchester, Manchester M13 9PL,
U.K.{viktor.yarmolenko,rizos.sakellariou}@manchester.ac.uk
[13] S. Aldarmi and A. Burns. Dynamic value-density for scheduling real-time systems. In
11th Euromicro Conference on Real-Time Systems, Dec. 1999.

You might also like