Project Peport Pranali

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 88

Android Mobile Application

PROJECT PEPORT ON

THE ANDROID MOBILE APPLICATION

SUBMITTED BY:

PRANALI MAHADEV BAGWE


SAYALI NANDKUMAR BERDE

UNDER THE GUIDANCE OF

PROF.MARIA ACHARY.

VIDYALANKAR SCHOOL OF INFORMATION


TECHNOLOGY,
WADALA (E), MUMBAI-400 037.

UNIVERSITY OF MUMBAI
2015-16

1
Android Mobile Application

VIDYALANKAR SCHOOL OF INFORMATION TECHNOLOGY

WADALA (E), MUMBAI 400037

Project Certificate For BSc-IT Students

This is to certify that the project entitled by The Android Mobile Application
(Fire Alarm Application) Ms. Sayali Berde (13302B312) Ms. Pranali
Bagwe (13302B0075) and in partial fulfillment of BSc IT degree (Sem VI)
examination had not been submitted for any other examination and does
not form any other course undergone by the candidate.

Internal Guide Internal examiner External examiner

Co-ordinator Principal College Seal

2
Android Mobile Application

ANDROID MOBILE APPLICATION

“FIRE ALARM”

3
Android Mobile Application

ACKNOWLEDGEMENT

It gives us great pleasure and pride as we present our project on


“THE ANDROID APPLICATION”. This acknowledgement is a small
effort to express our indebtedness and gratitude to all those who have
shown us the path to bring out the colorful colors of this project with
their vast treasures of experience and knowledge.

4
Android Mobile Application

We express our deep sense of gratitude to our project guide persons for
their timely encouragement, motivation and appraisal and for the
solitude help and providing a sanctum atmosphere endeavoring to
complete our project.
We express our deep sense of thanks and indebtedness towards our
internal project guide Prof.Maria Achary.
.She has always made president efforts to carve keen interest and
knowledge of subject on our mind.
We express our thanks to Prof.Maria Acharyfor her help, directly and
indirectly in completing our project work.
We would also like to express a feeling of gratitude to our parents and
friends for their help directly or indirectly in completing our project
work.
Sincere thanks
To,
Prof.Maria Achary.

Statement BY THE CANDIDATE

I wish to state that the work embodied in this project titled “THE
ANDROID APPLICATION” forms my own contribution to the project
5
Android Mobile Application

work carried out under the guidance of Prof.Maria Achary at the


Department of Information Technology. This work has not been
submitted for any other degree of this or any other University. Wherever
references have been made to previous work of others, it has been
clearly indicated as such and included in the Bibliography.

Certified by

Signature of the guide signature of the


candidate

Date:

6
Android Mobile Application

Abstract

Mobile a device that has reached all the people it has become
a daily part of people.Android has opened mobile phone development to
thousands of developers for building mobile application. Experienced
mobile developers can now expand into Android platform, leveraging
the unique features to enhance existing products or create innovative
new ones. Applications based on both local and wide distributed
wireless networks are being launched all the time.
In this project we are trying to develop an application where you can
use your mobile as fire alarm and send your name, mobile no instantly
7
Android Mobile Application

and get your current location on the Google map on the system and
intended server by using mobile phone.These include the current
accidents details.We have used Google Places Api, Google Maps Api,
and Google Direction Api for providing location based search
We will use the features provided by the android mobile to implement
this project.

Table of contents

Sr. No. Topic Page. No.

1 Introduction 12

1.1 Organizational profile (Write in short) 13

1.2 Introduction to project 13

2 System study and analysis 14

8
Android Mobile Application

2.1 Problem definition 15

2.2 Feasibility 15

2.3 System analysis 18

2.4 Current system 19

2.5 Proposed system 21

2.6 System requirement 22

3 System development 23

3.1 Gantt chart 24

3.2 Event table 26

3.3 Use Case diagram 27

3.4 Sequence diagram 28

3.5 Activity diagram 29

3.6 Class Diagram 30

3.7 State chart diagram 31

3.8 Deployment diagram 32

3.9 Data flow diagram 33

3.10 Component diagram 34

3.11 ER diagram 35

4 Table list 36

9
Android Mobile Application

5 System testing and conclusion 38

6 Data entry form 42

7 Process involved 44

8 Source code 46

9 Screen layout with test data and test results 79

10 Report layouts 84

11 References/ bibliography/websites used 88

  Annexure

Brief background of the organization where


I the student has developed the project

II Data dictionary This should give a catalogue


of the data elements used in the system/sub
10
Android Mobile Application

system

Data name, aliases if any, length (size), type


numeric, alpha, binary etc.

III List of abbreviations, figures, tables

IV References: bibliography, websites used

V Soft copy of the project on CD

1.Introduction
11
Android Mobile Application

1.1 Organizational Profile:


Now a day’s most of the people used the mobile having the android operating
system. Android applications are today’s most effective platform for any sort
of works like communication, security, games, entertainment etc. over the
world. It is interesting to discuss that android application have some specific
internal objective that make them a part of everyone’s life today. Today,
people don’t look at them as just applications; they are defined with more
inner sense.

1.2 INTRODUCTION TO PROJECT:

An idea came to develop the android application. THE ANDROID MOBILE


APPLICATION is provide the facilities to the user through application. The
12
Android Mobile Application

application is developed as the replacement of manual system. The very purpose


of the application is to help or automate. The proposed system should be
executable inside an android mobile handset, and should be able to send for the
help request. And able to track the current location of the user and also get the
proper direction to reach here.

It`s Providing automatically emergency call to the particular location. Google map
find distance of the two places. Also know driving direction and time and distance
of the place.

2. SYSTEM STUDY
AND ANALYSIS
13
Android Mobile Application

2.1 PROBLEM DEFINITION:

Today's generation rely on their phones to get through their day. They use it to
make send text messages, checking their emails, music, playing games etc. Due to
this, phones have become more of a personal assistant to people rather than a
device used to send and receive phone calls.

With the invention of the smart phone, the entire world has become accessible
to the person at a touch of a button. This was made possible due to the creation of
the thousands of applications that run on these smart phones. These applications
provide people with current location conditions to allowing them to control
situation. But every good application lacks a small feature that prevents it from
making it a great application. Our group is going to develop an application for the
Android Mobile Operating System that easy to use application.

14
Android Mobile Application

2.2 FEASIBILITY:

A feasibility study is the study of positive possibilities of the project.It is also


measure of how beneficial or practical development of information system would
be to an organization.

The different types of feasibility are as follows:

 Economic feasibility.
 Operational feasibility.
 Technical feasibility.

Economic Feasibility:
Higher level of automation most often requires more funds. Hence based on the
hardware and software specification a desirable alternative costs and benefits to
see if the investment made in creating / developing a new system is costlier or
more beneficial.

The product is not made for a particular visitor. Thus the economical cost for the
hardware and software and other peripheral devices are thus reduced.

My system is economically feasible as the costs involved in implementing the


automated system is in lieu with the cash flow of the organization. Thus the
system developed will be beneficial to the users.

However there will be an additional cost for implementing the technology on


which the system is to be implemented

Technical Feasibility:
15
Android Mobile Application

It is essential to check whether the proposed system is technically feasible and to


determine the technology and skills necessary to carry out the successful
implementation of the project.

The necessary software required for the development of system is

• ASP.NET with C#.


• Microsoft SQL SERVER 2008 RC.
• Android Development Tools plug-in 

There is requirement for the mentioned software and an expertise for handling
system. Thus in the presence of required hardware, software the proposed system
is technically feasible.

Operational Feasibility:

The operational feasibility is obtained by consulting the system user whether it


satisfies the user’s requirements. A system with an easy interface will always help
the user to use the system. It is mainly related to human organizations and political
aspects. The points to be considered are:

1. Some kind of graphical user interface changes can be brought to the system
2. Some basic knowledge of how to designing web page will be required for
the developer
3. The website is very functional and can be operated very smoothly and does
not required any special skills to operate it
4. The system is operationally feasible as it very easy for the End users to op-
erate it. It only needs basic information about Windows platform.

16
Android Mobile Application

5. The person using the website feels comfortable to operate the website be-
cause its easy functionality

2.3 SYSTEM ANALYSIS:


Planning:

It consists of initial assessment and feasibility study. During initial assessment and
feasibility study the technical aspects of the hardware and software were
determine as which hardware and software should be used to develop the project.
Also the cost needed to developed project was estimated.

Analysis:

It consists of user requirements, existing system evaluation and logical system


design. During this stage the requirements needed by user were analyzed, macro
analyses of both the individual needs were. Logical system design was created
specifying and identifying.

Detailed system design:

17
Android Mobile Application

During these phase the complete design of the system including all the technical
specification for the screens, menus, reports were made. The system was coded,
the actual database was created and system was customized by the creation of
tables, user authorizations and so on.

Code Generation:

The design must be translated into a machine –readable form. The code generation
step performs this task. If designed is performed in a detailed manner, code
generation can be accomplished mechanistically.

Testing:

Once code has been generated, program testing begins. The testing process
focuses on the logical internals of the software, ensuring that all statements have
been tested, and on the functional externals; that is, conducting tests to uncover
errors and ensure that defined input will produce actual results that agree with
required results.

Maintenance:

The software will definitely undergo change once it is delivered to the customer.
There can be many reasons for this change to occur. Change could happen because
of some unexpected input values into the system. In addition, the changes in the
system could directly affect the software operations. The software should be
developed to accommodate changes that could happen during the post
implementation period.

SYSTEM PLANNING

2.4 CURRENT SYSTEM:


18
Android Mobile Application

This process is done manually. The current system is time consuming and also it is
very costly, because it involves a lot of paper work. To manually handle such a
system was very difficult task. But now-a-days because of computerization this
job is becoming easier.

The following are the reasons why the current system should be
computerized:

 To increase efficiency with reduced cost.

 To reduce the burden of paper work.

 To save time of management for recording details of each and every request.

 To check that the exact location is available.

LIMITATIONS OF CURRENT SYSTEM:

Difficult to contact in emergency- As in the emergency we have to manually call


for the help it consumes a lot of time.

Cannot get the exact location- As emergency happened cannot get the
exact location of the accident.

Time consumption -As the records are to be manually maintained it consumes a


lot of time.

Paper Work- Lot of paper work is involved as the records are maintained in the
files and registers.

Storage Requirements- As files and registers are used the storage space
requirement is increased.

19
Android Mobile Application

Less Reliable- Use of papers for storing valuable data information is not at all
reliable.

Accuracy- As the system is in manual there are lot many chances of human errors.
These cause errors in maintaining user data in registers.

Difficulty in keeping new records- It is difficult for keeping all the new entries of
the user name, phone no and address etc.

2.5 PROPOSED SYSTEM:

To reduce the inconvenience that were found in the current system, it has been
automated so as to provide a user friendly GUI that will help sending a help
request in emergency and maintaining the record and finding the exact location of
the user and get the correct direction to reached their.

The proposed system will include following features:

 The developed system will be a Time saving application for the user.
 Also the system is intended to take very few inputs form the user.
 Creating a database for containing the information present with them
on the paper in existing system.
 Send immediate request for the help in emergency.
20
Android Mobile Application

 Get exact Location of the user and get proper direction to reach their.

ADVANTAGES OF THE PROPOSED SYSTEM:

Time saving since all the details information is stored in this system, it enables in
significance reduction in the number of man-hours taken up for the storage and the
retrieval of the information as it removes the large registers from the scene. Send
immediate request for the help in emergency. Get exact Location of the user and
get proper direction to reach their.

 Accuracy and Reliability.


 User friendly, accurate and robust system.
 Security of data and Integration of all functions in to one system.
 Remove redundancy and inconsistency of data.
 Through proper validations data inconsistency is reduced.
 The Proposed System would reduce the Man Power, because a single trained
person can handle whole database.
 Easier retrieval of data will be possible as multiple search facilities will be
available.
 Through proper validations data inconsistency is reduced.

2.6 System requirements


SOFTWARE SPECIFICATIONS

o Eclipse IDE for Java Developer (Eclipse 3.6.2(Helios) or greater)


o Eclipse JDT plug-in (included in most Eclipse IDE packages)
o JDK 6 (JRE alone is not sufficient)
o Android Development Tools plug-in (recommended)

OPERATING SYSTEMS

o Windows XP (32-bit)
o Vista (32- or 64-bit)
o Windows 7 (32- or 64-bit)

21
Android Mobile Application

HARDWARE SPECIFICATIOS

o Hard disk                  -           40 GB


o Processor                 -           Pentium IV 2.4 GHz
o Ram                          -           1 GB

22
Android Mobile Application

3. SYSTEM
DEVELOPMENT

3.1 Gantt Chart:

Gantt chart is a type of bar chart that illustrates a project schedule. Gantt charts
illustrate the start and finish dates of the terminal elements and summary elements
of a project.  Gantt charts can be used to show current schedule status using
percent-complete shadings.

23
Android Mobile Application

Date
July Aug Sep Oct Nov Dec Jan Feb Mar

Phase

Preliminary
Investigation

System Analysis

System Design

System Coding

System
Implementation /
Uploading

Future
Enhancements

References and
Bibliography

Estimate Timing

Actual Timing

24
Android Mobile Application

3.2 Event Table:

No Events Trigger Source Activity Response Destination

25
Android Mobile Application

01 Install toRegistration Android Make newUser is to beWeb user


register User registration register

02 Login Enter details Android Request forDetailed Android User


User login confirmation

03 Adding newAdding newAndroid Add new userUser detailDatabase


record user record User details confirmed

04 Searching forGet locationAndroid Android userLocation info Web user


location info user search for
details location info

05 Modify or Update user System Modify or Updating of System


delete User details delete user record confirmed
details details

06 Request for Sending request Android Request to call System Android user
the call call user system

07 Retrieving Collect user Android Get details Web user Android user
data details user

08 Response to Call received System Respond to Web user Android user


request by the system call

3.3 Use Case Diagram:

A use case diagram in the Unified Modelling Language (UML) is a type of


behavioural diagram defined by and created from a Use-case analysis. Its purpose
is to present a graphical overview of the functionality provided by a system in
26
Android Mobile Application

terms of actors, their goals (represented as use cases), and any dependencies
between those use cases.

3.4 Sequence Diagram

Sequence diagrams describe interactions among classes in terms of an exchange of


messages over time.

27
Android Mobile Application

3.5 Activity Diagram

An activity diagram illustrates the dynamic nature of a system by modeling the


flow of control from activity to activity. An activity represents an operation on
some class in the system that results in a change in the state of the system.
28
Android Mobile Application

Typically, activity diagrams are used to model workflow or business processes


and internal operation. Because an activity diagram is a special kind of statechart
diagram, it uses some of the same modeling conventions.

3.6 Class Diagram

The class diagram is the main building block in object oriented modelling. It is
used both for general conceptual modelling of the systematics of the application,
and for detailed modelling translating the models into programming code. The

29
Android Mobile Application

classes in a class diagram represent both the main objects and or interactions in the
application and the objects to be programmed. In the class diagram these classes
are represented with boxes which contain three parts:

 The upper part holds the name of the class.


 The middle part contains the attributes of the class.
 The bottom part gives the methods or operations the class can take or
undertake.

3.7 State Chart Diagram


30
Android Mobile Application

A State chart diagram describes a state machine. Now to clarify it state machine
can be defined as a machine which defines different states of an object and these
states are controlled by external or internal events. State chart diagram is one of
the five UML diagrams used to model dynamic nature of a system. They define
different states of an object during its lifetime. And these states are changed by
events. So State chart diagrams are useful to model reactive systems. Reactive
systems can be defined as a system that responds to external or internal events.

3.8 Deployment Diagram


Deployment diagrams depict the physical resources in a system including nodes,
components, and connections.
31
Android Mobile Application

3.9 Data flow Diagram


A data flow diagram (DFD) is a graphical representation of the "flow" of data
through an information system modelling its process aspects. A Data Flow Dia-
gram is often used as a preliminary step to create an overview of the system,

32
Android Mobile Application

which can later be elaborated.[2] Data flow diagram can also be used for the visual-
ization of  data processing
A Data Flow Diagram shows what kind of information will be input to and output
from the system, where the data will come from and go to, and where the data will
be stored. It does not show information about the timing of process or information
about whether processes will operate in sequence or in parallel

Help Request

Response Server

Data base

3.10 Component Diagram


It is used to model physical aspect of Object oriented System. It shows
organization and interrelationship Between set of components. Nodes In

33
Android Mobile Application

Component Diagram Nodes are the important building block in modeling the
physical aspects of a system.

3.11 ER Diagram
An entity–relationship model (ER model) is a data model for describing the data
or information aspects of a business domain or its process requirements, in an
abstract way that lends itself to ultimately being implemented in a database such
34
Android Mobile Application

as a relational database. The main components of ER models are entities (things)


and the relationships that can exist among them

35
Android Mobile Application

4.table list

Fields Data_Type Description

colId Int It is Id for user

colFirstName nchar(10) It contains the first name of


the user

colLastName nchar(10) It contains the last name of

36
Android Mobile Application

the user

colNumber Int It contains the number of


the user

colLat nchar(10) It contains the latitude of


the location

colon nchar(10) It contains the longitude of


the location

Collocation nchar(20) It contains the address of


the location

colDateTime Datetime It contains the date and the


time

37
Android Mobile Application

5. SYSTEM TESTING
AND CONCLUSION

5.1 System Testing


Testing is the process of examining a product to determine what defects it contains
to conduct a test, programmers must have already constructed software and there
38
Android Mobile Application

must be well-defined standard for what constitute a defect. The developers can test
products by reviewing their constructions and compositions or by exercising their
functions and examining the results.

An information system is an integrated collection of software components.


Components can be tested individually or in groups or entire system can be tested
as a whole. Testing components individually or in groups is called unit testing.
Testing components in group is called integrated testing. Testing entire system is
called system testing.

The three types of testing are correlated to specific phase of SDLC. A system text
examines the behavior of entire system with respect to technical and user. These
requirements are determined during analysis phase of SDLC. During high level
design, the division of the system into high level components and structural design
of those components are determined. Integration testing tests the behavior of
variable group of software components. Unit testing test each individual software
components in isolation.

Because of each testing level is related to specific phase of SDLC, testing


activities can be spread out through the life cycle. Planning for each type testing
can occur with its related SDLC phase. And development of specific test can
occur once the planning for each type testing can occur with its reached SDLC
phase, and development of specific test can occur once the planning is complete.
Test can’t be conducted until relevant portion of the system have been constructed.

Unit Testing:

This is a process of testing individual code modules before they integrate with
other modules. Unit testing being tested may be a function, sub routine, procedure,
or method. Unit testing may be relatively small groups of inter related modules
that are always executes as group. The goal of unit testing is to identify and fix as
many errors as possible before modules and expensive to locate and fix when
many modules are combined.

Integrated Testing:

An integration test tests the behavior of group modules. The purpose of an


integration test is to identify errors that were not or could not be detected by unit
testing individual modules or methods.
39
Android Mobile Application

Such error may result from number of problem including

Interface Compatibility.

Parameter Values.

Runtime Exception.

Unexpected State Interaction.

System Testing:

After integration, the whole program will again be tested. Case studies will again
be applied with integrated software.

Methodology used for testing:

The testing methodology implemented for testing of the project is Black Box
testing.

In the black box testing, the internal logic of the system under testing is not
considered and the test cases are decided form the specification or the
requirements. It is often called functional testing. It aims to test functionality
according to the requirements. Equivalence class portioning, boundary value
analysis, and because effecting graphing are examples of methods for selecting
test cases for black box testing. State-based testing is another approach in which
the system is modeled as a state machine and then this model is used to select test
cases using some transaction or path based coverage criteria, state-based testing
can also be viewed as grey-box testing in that it often requires more information
than just the requirements.

The testing methodology implemented for testing of the project is the black box
testing. Refer the above paragraph for explanation.

Test Cases:

The forms were tested for their functionality and error messages displayed
wherever the input does not meet the required requirements.

5.2 Conclusion
40
Android Mobile Application

This was our project of System Design Lab about “THE ANDROID
APPLICATION” (FIRE ALARM APPLICATION). Development of this System
takes a lot of efforts from us. We think this system gave a lot of satisfaction to all
of us. Though every task is never said to be perfect in this development field even
more improvement may be possible in this system. We learned so many things and
gained a lot of knowledge about development field. We hope this will prove
fruitful to us.

41
Android Mobile Application

6.data entry form

42
Android Mobile Application

43
Android Mobile Application

7 .Process involved

Main Activity

• This page is used for get the input from user


• When the user enters the First name, last name and phone no is check the all
validation
• After all validation is done on save button it saves the value in to inbuilt
application memory.

My Receiver

• When user click the power button three times then it retrieve the all user data
and send call to the website
• And also send the latitude and longitude of location.

FrmRequestList
44
Android Mobile Application

• It receives all data from an application and store in the database.


• And also send the data to the windows form.

HelpRequest

• If the any changes is made in user data it display on the form


• It also gets the latitude and longitude and form into a link
• After double click on link the location of user is show on the Google
map
• Selected the name of the user that is get respond and right click on
message box will popup ask for responded or not .

8. SOURCE CODE
45
Android Mobile Application

activity_main.xml

<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="fill"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/detail"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#00BFFF"
android:textSize="30sp"
46
Android Mobile Application

android:textColorHighlight="#FFFF00"
/>
<EditText
android:id="@+id/edit_Firstname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/edit_msg1"
android:inputType="text"

/>
<EditText
android:id="@+id/edit_lastname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/edit_msg2"
android:inputType="text"
/>

<EditText
android:id="@+id/edit_ph"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/edit_msg3"
android:inputType="phone"
/>

<Button
android:layout_width="250dp"
android:id="@+id/btnsave"
android:layout_height="wrap_content"
android:text="@string/b_save"
android:layout_gravity="center"
/>

<Button
android:id="@+id/btnexit"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="@string/b_Exit"
android:layout_gravity="center"
/>
47
Android Mobile Application

</LinearLayout>

MainActivity.java

package com.example.myapp;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.Menu;
import android.view.View;
import android.view.WindowManager;
import android.widget.*;

public class MainActivity extends Activity


{
private EditText editText1,editText2,editText3;
48
Android Mobile Application

private Button btn1,btn2;


@Override
protected void onCreate(Bundle savedInstanceState)
{

super.onCreate(savedInstanceState);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYG
UARD);
setContentView(R.layout.activity_main);

editText1=(EditText)findViewById(R.id.edit_Firstname);

editText2=(EditText)findViewById(R.id.edit_lastname);

editText3=(EditText)findViewById(R.id.edit_ph);
btn1=(Button)findViewById(R.id.btnsave);
btn2=(Button)findViewById(R.id.btnexit);

LoadPreferences();
btn1.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
boolean hasError = false;

if( editText1.getText().toString().length() == 0 )
{
editText1.setError( "First name is required!!!" );
hasError = true;

}
if( editText2.getText().toString().length() == 0 )
{
editText2.setError( "Last name is required!!!" );
hasError = true;

}
if(editText3.getText().toString().trim().length()!=10)
{
editText3.setError("please enter 10 digits !!!");
hasError=true;
49
Android Mobile Application

}
if(hasError) return;

SavePreferences("FirstName", editText1.getText().toString());
SavePreferences("LastName", editText2.getText().toString());
SavePreferences("Phone",editText3.getText().toString());
Toast.makeText(getBaseContext(),"Data saved successfully !!!",
Toast.LENGTH_LONG).show();
startService(new Intent(getBaseContext(),MyService.class));

});
btn2.setOnClickListener(new View.OnClickListener()
{

@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
finish();
//System.exit(0);
}
});
}
private void SavePreferences(String key, String value)
{
// TODO Auto-generated method stub
SharedPreferences sharedPreferences =
getSharedPreferences("MyAppPref", MODE_PRIVATE);
//getPreferences(MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(key, value);
editor.commit();
}
private void LoadPreferences()
{
// TODO Auto-generated method stub

50
Android Mobile Application

SharedPreferences sharedPreferences =
getSharedPreferences("MyAppPref",
MODE_PRIVATE);//getPreferences(MODE_PRIVATE);
String strFirstname = sharedPreferences.getString("FirstName","");
String strLastname = sharedPreferences.getString("LastName","");
String strph = sharedPreferences.getString("Phone","");
editText1.setText(strFirstname);
editText2.setText(strLastname);
editText3.setText(strph);
}

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

Myreceiver.java

package com.example.myapp;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
51
Android Mobile Application

import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.widget.Toast;
import android.location.*;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.*;

public class MyReceiver extends BroadcastReceiver


{
private static int countPowerOff=0;
public MyReceiver()
{

double lat, lon;

private Context context;


private void _getLocation(Context con)
{
Log.d("MyApp", "Getting location");

// Get the location manager


LocationManager locationManager = (LocationManager)
con.getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
String bestProvider = locationManager.getBestProvider(criteria, false);
Log.d("MyApp", bestProvider);
Location location = locationManager.getLastKnownLocation(bestProvider);
if(location == null)
Log.d("MyApp", "Location is null");
LocationListener loc_listener = new LocationListener() {

public void onLocationChanged(Location l) {}

52
Android Mobile Application

public void onProviderEnabled(String p) {}

public void onProviderDisabled(String p) {}

public void onStatusChanged(String p, int status, Bundle extras) {}


};
locationManager
.requestLocationUpdates(bestProvider, 0, 0, loc_listener);
location = locationManager.getLastKnownLocation(bestProvider);

if(location == null)
Log.d("MyApp", "Location is null");
try {
lat = location.getLatitude();
lon = location.getLongitude();
}
catch (NullPointerException e)
{
Log.d("MyApp", e.getClass().getName(), e.getCause());
lat = 19.21061;//-1.0;
lon = 72.976445;//-1.0;
}
//Toast.makeText(getApplicationContext(), "Location is Thane(w)...!!!",
Toast.LENGTH_LONG)
// .show();
}
public void Notify()
{
NotificationManager notificationManager = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);

//Define sound URI


Uri soundUri =
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

NotificationCompat.Builder mBuilder = new


NotificationCompat.Builder(getApplicationContext())
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Message from MyApp...!!!")
.setContentText("Data is post to the Website...!!!")
.setSound(soundUri);
53
Android Mobile Application

notificationManager.notify(0, mBuilder.build());
}
public void postData(Context context)
{
//Create a new HttpClient and Post Header
HttpClient httpclient=new DefaultHttpClient();
HttpPost httppost=new
HttpPost("http://10.0.2.2:4073/WebSite/Default.aspx");
try
{
Log.d("MyApp", "Calling web app");
SharedPreferences sharedPreferences =
context.getSharedPreferences("MyAppPref",android.content.Context.MODE_PRI
VATE);
//getPreferences(MODE_PRIVATE);
String strFirstname =
sharedPreferences.getString("FirstName","");
String strLastname =
sharedPreferences.getString("LastName","");
String strph = sharedPreferences.getString("Phone","");
//Add your data
_getLocation(context);
List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>(2);
nameValuePairs.add(new
BasicNameValuePair("id_Firstname",strFirstname));
nameValuePairs.add(new
BasicNameValuePair("id_Lastname",strLastname));
nameValuePairs.add(new
BasicNameValuePair("id_ph",strph));
nameValuePairs.add(new
BasicNameValuePair("id_lon",Double.toString(lon)));
nameValuePairs.add(new
BasicNameValuePair("id_lat",Double.toString(lat)));
httppost.setEntity(new
UrlEncodedFormEntity(nameValuePairs));

//Execute HTTP Post Request


HttpResponse response = httpclient.execute(httppost);

}
54
Android Mobile Application

catch(ClientProtocolException e)
{
Log.d("MyApp", e.getMessage(),e.getCause());
}
catch(IOException e)
{
Log.d("MyApp", e.getMessage(), e.getCause());

}
catch(Exception e)
{
Log.d("MyApp", e.getClass().getName(), e.getCause());
}
}
public void onReceive(Context arg0, Intent arg1)
{
// TODO Auto-generated method stub
Intent intent=arg1;
Log.e("MyReceiver","In OnReceive");
if(intent.getAction().equals(Intent.ACTION_SCREEN_OFF))
{
Log.e("In on receive","In Method:ACTION_SCREEN_OFF");
countPowerOff++;
// message();
}
else if(intent.getAction().equals(Intent.ACTION_SCREEN_ON))
{
Log.e("In on receive","In Method : ACTION_SCREEN_ON");

/** HttpURLConnection urlConnection=null;

try
{
urlConnection.setDoOutput(true);
urlConnection.setChunkedStreamingMode(0);
URL url=new URL("http://localhost:4381/WebSite1/Default.aspx");
urlConnection=(HttpURLConnection)url.openConnection();
OutputStream out= new
BufferedOutputStream(urlConnection.getOutputStream());

writeStream(out);
}
55
Android Mobile Application

catch(IOException e)
{
e.printStackTrace();
}
finally
{
urlConnection.disconnect();
}**/

}
else if(intent.getAction().equals(Intent.ACTION_USER_PRESENT))
{

Log.e("In on receive","In Method :


ACTION_USER_PRESENT");

Log.e("In on receive",Double.toString(countPowerOff));
if(countPowerOff<=1)
{
countPowerOff=0;
/* Context context = null;
Toast.makeText(context, "MAIN ACTIVITY IS BEING
CALLED ", Toast.LENGTH_LONG).show();
Intent i = new Intent(context, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|
Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(i);*/
postData(arg0);

// ringtone();
}

Notify();
}
}

private Context getApplicationContext() {


// TODO Auto-generated method stub
return null;
}
/**private void writeStream(OutputStream out)
56
Android Mobile Application

{
// TODO Auto-generated method stub

}
* @return **/
/* public void ringtone()
{
try
{
Uri notification =
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(),
notification);
r.play();
}
catch (Exception e) {}
}

private Context getApplicationContext() {


// TODO Auto-generated method stub
return null;
}

/*notificationManager = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri
.parse(myBlog));
PendingIntent pi = PendingIntent.getActivity(MainActivity.this, 0, myIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Notification note = new Notification(R.drawable.ic_launcher, "Alarm",
System.currentTimeMillis());
note.setLatestEventInfo(getApplicationContext(), "Alarm", "sound" + "
(alarm)", pi);
Uri alarmSound =
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
if(alarmSound == null){
alarmSound =
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
if(alarmSound == null){
alarmSound =
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
57
Android Mobile Application

}
}
note.sound = alarmSound;
note.defaults |= Notification.DEFAULT_VIBRATE;
note.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(MY_NOTIFICATION_ID, note);*/
//This sets the sound to play

//Display notification

Myservice.java

package com.example.myapp;

import java.lang.annotation.Target;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.os.StrictMode;
import android.util.Log;
import android.widget.Toast;

publicclass MyService extends Service


{
BroadcastReceiver mReceiver;
58
Android Mobile Application

publicvoid onCreate()
{

super.onCreate();
IntentFilter filter=new IntentFilter(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_USER_PRESENT);
filter.addAction(CONNECTIVITY_SERVICE);
mReceiver= new MyReceiver();
registerReceiver(mReceiver,filter);

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
}

publicvoid message()
{
NotificationManager mNotificationManager =(NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = newNotification((Integer)
R.drawable.ic_launcher,"This is the android example Notification
message!!!",System.currentTimeMillis());
Intent notificationIntent = new
Intent(getBaseContext(),Target.class);
PendingIntent contentIntent =
PendingIntent.getActivity(getApplicationContext(),0,notificationIntent,0);

notification.setLatestEventInfo(getApplicationContext(),"Notification","message
from system !!!", contentIntent);
notification.flags=Notification.FLAG_AUTO_CANCEL;
mNotificationManager.notify(143, notification);
}

publicvoid onDestroy()
{
unregisterReceiver(mReceiver);
Log.i("onDestroy Receiver","Called");
super.onDestroy();
}
59
Android Mobile Application

publicint onStartCommand(Intent intent,int flags, int startId)


{
if(intent == null)
Log.d("intent", "intent is null");
else
Log.d("intent", intent.toString());
if(intent != null)
{
boolean screenOn = intent.getBooleanExtra("screen_state", false);
if (!screenOn)
{
Log.i("screenON", "Called");
Toast.makeText(getApplicationContext(), "Screen is on", Toast.LENGTH_LONG)
.show();
//message();
}
else
{
Log.i("screenOFF", "Called");
Toast.makeText(getApplicationContext(), "Screen is off",
Toast.LENGTH_LONG)
.show();
}
}
returnSTART_STICKY;
}

@Override
public IBinder onBind(Intent arg0)
{
// TODO Auto-generated method stub
returnnull;
}

60
Android Mobile Application

frmRequestList.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
using System.Security.Permissions;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Diagnostics;

namespace HelpRequestViewer
{
public partial class frmRequestList : Form
61
Android Mobile Application

// The following objects are reused


// for the lifetime of the application.
private static string ConnectionString = "Data Source=ANKITA-PC\\
SQLEXPRESS;Initial Catalog=MyApp;Integrated Security=True";
private DataSet dataToWatch = null;
private SqlConnection connection = null;
private SqlCommand command = null;

public frmRequestList()
{
InitializeComponent();
}

private void frmRequestList_Load(object sender, EventArgs e)


{

Control.CheckForIllegalCrossThreadCalls = false;
SqlDependency.Stop(ConnectionString);
SqlDependency.Start(ConnectionString);

if (connection == null)
connection = new SqlConnection(ConnectionString);
//connection.Open();
if (command == null)
command = new SqlCommand("select
Id,First_name,Last_name,Contact_no,
[DateTime],Longitude,Latitude,Address,Responded from dbo.HelpRequests
where Responded = 0 order by [DateTime] desc", connection);
//SqlDependency dep = new SqlDependency(comm);
//dep.OnChange += new OnChangeEventHandler(dep_OnChange);

//SqlDataReader reader = comm.ExecuteReader();


//LoadData();
if (dataToWatch == null)
62
Android Mobile Application

dataToWatch = new DataSet();


GetData();

void dep_OnChange(object sender, SqlNotificationEventArgs e)


{
// Remove the handler, since it is only good
// for a single notification.
SqlDependency dependency =
(SqlDependency)sender;

dependency.OnChange -= dep_OnChange;

// At this point, the code is executing on the


// UI thread, so it is safe to update the UI.
//++changeCount;

// Reload the dataset that is bound to the grid.


GetData();
}

private void GetData()


{
// Empty the dataset so that there is only
// one batch of data displayed.
dataToWatch.Clear();

// Make sure the command object does not already have


// a notification object associated with it.
command.Notification = null;

// Create and bind the SqlDependency object


// to the command object.
SqlDependency dependency =
new SqlDependency(command);
63
Android Mobile Application

dependency.OnChange += new
OnChangeEventHandler(dep_OnChange);

using (SqlDataAdapter adapter = new SqlDataAdapter(command))


{

adapter.Fill(dataToWatch);
if (!dataToWatch.Tables[0].Columns.Contains("Link"))
dataToWatch.Tables[0].Columns.Add("Link");
foreach (DataRow dr in dataToWatch.Tables[0].Rows)
{
dr["Link"] = "https://maps.google.com/maps?z=16&t=k&q=loc:" +
dr["Latitude"] + "+" + dr["Longitude"] + "";
}
dgList.DataSource = dataToWatch.Tables[0];
}

private void dgList_CellDoubleClick(object sender,


DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0 && e.ColumnIndex == 9)
{

Process.Start(dgList.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString());
}
}

private void dgList_CellClick(object sender, DataGridViewCellEventArgs e)


{
if (e.RowIndex >= 0)
64
Android Mobile Application

}
}

private void dgList_CellMouseClick(object sender,


DataGridViewCellMouseEventArgs e)
{

private void dgList_MouseClick(object sender, MouseEventArgs e)


{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
var hitTest = dgList.HitTest(e.X, e.Y);
if (hitTest.RowIndex >= 0)
{
dgList.Rows[hitTest.RowIndex].Selected = true;
contextMenuStrip1.Show(dgList, e.Location);
}
}
}
private void respondedToolStripMenuItem_Click(object sender, EventArgs
e)
{
if (dgList.SelectedRows.Count != 0)
// if(dgList.SelectColumn.count!=0)
{
string name = dgList.SelectedRows[0].Cells[1].Value.ToString();
if (MessageBox.Show("Hide " + name + "?", "Confirmation",
MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
{
connection.Open();
command = new SqlCommand(" update HelpRequests set
Responded= 1 where ID=" + dgList.SelectedRows[0].Cells[0].Value, connection);
65
Android Mobile Application

command.ExecuteNonQuery();
GetData();
}
}
else
{
MessageBox.Show("Please select row");
}

private void frmRequestList_FormClosed(object sender,


FormClosedEventArgs e)
{
SqlDependency.Stop(ConnectionString);
if (connection != null)
{
connection.Close();
}
}

/* private void LoadData()


{
using (SqlConnection con = new SqlConnection(ConnectionString))
{
con.Open();
//Location to be obtained from google maps API
SqlCommand comm = new SqlCommand("select
[Name],Phno,Latitude,Longitude,Location,[DateTime] from HelpRequests where
Responded = 0 order by [DateTime] desc", con);

DataSet ds = new DataSet();


SqlDataAdapter adapter = new SqlDataAdapter(comm);
adapter.Fill(ds);
dgList.DataSource = ds.Tables[0];
66
Android Mobile Application

}
}*/
}
}

MyAppDataSet.xsd

<xs:schema id="MyAppDataSet"
targetNamespace="http://tempuri.org/MyAppDataSet.xsd"
attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0"
FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout,
AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema">
<Connections>
<Connection AppSettingsObjectName="Settings"
AppSettingsPropertyName="MyAppConnectionString"
ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly"
Name="MyAppConnectionString (Settings)" ParameterPrefix="@"
PropertyReference="ApplicationSettings.HelpRequestViewer.Properties.Settings.
GlobalReference.Default.MyAppConnectionString"
Provider="System.Data.SqlClient"/>
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component"
DataAccessorModifier="AutoLayout, AnsiClass, Class, Public"
DataAccessorName="HelpRequestsTableAdapter"
GeneratorDataComponentClassName="HelpRequestsTableAdapter"

67
Android Mobile Application

Name="HelpRequests"
UserDataComponentName="HelpRequestsTableAdapter">
<MainSource>
<DbSource ConnectionRef="MyAppConnectionString (Settings)"
DbObjectName="MyApp.dbo.HelpRequests" DbObjectType="Table"
FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both"
GenerateShortCommands="true" GeneratorGetMethodName="GetData"
GeneratorSourceName="Fill" GetMethodModifier="Public"
GetMethodName="GetData" QueryType="Rowset"
ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true"
UserGetMethodName="GetData" UserSourceName="Fill">
<InsertCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>INSERT INTO [dbo].[HelpRequests] ([Name], [Phno],
[Longitude], [Latitude], [Location], [Responded], [DateTime]) VALUES
(@Name, @Phno, @Longitude, @Latitude, @Location, @Responded,
@DateTime)
</CommandText>
<Parameters>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName=""
DbType="String" Direction="Input" ParameterName="@Name" Precision="0"
ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Name"
SourceColumnNullMapping="false" SourceVersion="Current"/>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName=""
DbType="String" Direction="Input" ParameterName="@Phno" Precision="0"
ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Phno"
SourceColumnNullMapping="false" SourceVersion="Current"/>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName=""
DbType="String" Direction="Input" ParameterName="@Longitude"
Precision="0" ProviderType="NVarChar" Scale="0" Size="0"
SourceColumn="Longitude" SourceColumnNullMapping="false"
SourceVersion="Current"/><Parameter AllowDbNull="false"
AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input"
ParameterName="@Latitude" Precision="0" ProviderType="NVarChar"
Scale="0" Size="0" SourceColumn="Latitude"
SourceColumnNullMapping="false" SourceVersion="Current"/>
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName=""
DbType="String" Direction="Input" ParameterName="@Location" Precision="0"
ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Location"
SourceColumnNullMapping="false" SourceVersion="Current"/>
68
Android Mobile Application

<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName=""


DbType="String" Direction="Input" ParameterName="@Responded"
Precision="0" ProviderType="NVarChar" Scale="0" Size="0"
SourceColumn="Responded" SourceColumnNullMapping="false"
SourceVersion="Current"/><Parameter AllowDbNull="false"
AutogeneratedName="" DataSourceName="" DbType="DateTime"
Direction="Input" ParameterName="@DateTime" Precision="0"
ProviderType="DateTime" Scale="0" Size="0" SourceColumn="DateTime"
SourceColumnNullMapping="false" SourceVersion="Current"/>
</Parameters>
</DbCommand>
</InsertCommand>
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT ID, Name, Phno, Longitude, Latitude, Location,
Responded, DateTime FROM dbo.HelpRequests
</CommandText>
<Parameters/>
</DbCommand>
</SelectCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="ID" DataSetColumn="ID"/>
<Mapping SourceColumn="Name" DataSetColumn="Name"/>
<Mapping SourceColumn="Phno" DataSetColumn="Phno"/>
<Mapping SourceColumn="Longitude" DataSetColumn="Longitude"/>
<Mapping SourceColumn="Latitude" DataSetColumn="Latitude"/>
<Mapping SourceColumn="Location" DataSetColumn="Location"/>
<Mapping SourceColumn="Responded" DataSetColumn="Responded"/>
<Mapping SourceColumn="DateTime" DataSetColumn="DateTime"/>
</Mappings>
<Sources/>
</TableAdapter>
</Tables>
<Sources/>
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="MyAppDataSet" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="True"
69
Android Mobile Application

msprop:Generator_DataSetName="MyAppDataSet"
msprop:Generator_UserDSName="MyAppDataSet">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="HelpRequests"
msprop:Generator_TableClassName="HelpRequestsDataTable"
msprop:Generator_TableVarName="tableHelpRequests"
msprop:Generator_TablePropName="HelpRequests"
msprop:Generator_RowDeletingName="HelpRequestsRowDeleting"
msprop:Generator_UserTableName="HelpRequests"
msprop:Generator_RowChangingName="HelpRequestsRowChanging"
msprop:Generator_RowEvHandlerName="HelpRequestsRowChangeEventHandle
r" msprop:Generator_RowDeletedName="HelpRequestsRowDeleted"
msprop:Generator_RowEvArgName="HelpRequestsRowChangeEvent"
msprop:Generator_RowChangedName="HelpRequestsRowChanged"
msprop:Generator_RowClassName="HelpRequestsRow">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true"
msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1"
msprop:Generator_ColumnVarNameInTable="columnID"
msprop:Generator_ColumnPropNameInRow="ID"
msprop:Generator_ColumnPropNameInTable="IDColumn"
msprop:Generator_UserColumnName="ID" type="xs:int"/>
<xs:element name="Name"
msprop:Generator_ColumnVarNameInTable="columnName"
msprop:Generator_ColumnPropNameInRow="Name"
msprop:Generator_ColumnPropNameInTable="NameColumn"
msprop:Generator_UserColumnName="Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phno"
msprop:Generator_ColumnVarNameInTable="columnPhno"
msprop:Generator_ColumnPropNameInRow="Phno"
msprop:Generator_ColumnPropNameInTable="PhnoColumn"
msprop:Generator_UserColumnName="Phno">
<xs:simpleType>
70
Android Mobile Application

<xs:restriction base="xs:string">
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Longitude"
msprop:Generator_ColumnVarNameInTable="columnLongitude"
msprop:Generator_ColumnPropNameInRow="Longitude"
msprop:Generator_ColumnPropNameInTable="LongitudeColumn"
msprop:Generator_UserColumnName="Longitude">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Latitude"
msprop:Generator_ColumnVarNameInTable="columnLatitude"
msprop:Generator_ColumnPropNameInRow="Latitude"
msprop:Generator_ColumnPropNameInTable="LatitudeColumn"
msprop:Generator_UserColumnName="Latitude">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Location"
msprop:Generator_ColumnVarNameInTable="columnLocation"
msprop:Generator_ColumnPropNameInRow="Location"
msprop:Generator_ColumnPropNameInTable="LocationColumn"
msprop:Generator_UserColumnName="Location">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Responded"
msprop:Generator_ColumnVarNameInTable="columnResponded"
msprop:Generator_ColumnPropNameInRow="Responded"
71
Android Mobile Application

msprop:Generator_ColumnPropNameInTable="RespondedColumn"
msprop:Generator_UserColumnName="Responded">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2147483647"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="DateTime"
msprop:Generator_ColumnVarNameInTable="columnDateTime"
msprop:Generator_ColumnPropNameInRow="DateTime"
msprop:Generator_ColumnPropNameInTable="DateTimeColumn"
msprop:Generator_UserColumnName="DateTime" type="xs:dateTime"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

frmRequestList.Designer.cs

namespace HelpRequestViewer
{
partial class frmRequestList
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed;
otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
72
Android Mobile Application

{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.dgList = new System.Windows.Forms.DataGridView();
this.colName = new System.Windows.Forms.DataGridViewTextBoxCol-
umn();
this.colFirst_Name = new System.Windows.Forms.DataGridView-
TextBoxColumn();
this.colLastName = new System.Windows.Forms.DataGridViewTextBox-
Column();
this.colNumber = new System.Windows.Forms.DataGridViewTextBox-
Column();
this.colLat = new System.Windows.Forms.DataGridViewTextBoxCol-
umn();
this.colLon = new System.Windows.Forms.DataGridViewTextBoxCol-
umn();
this.colLocation = new System.Windows.Forms.DataGridViewTextBox-
Column();
this.colDateTime = new System.Windows.Forms.DataGridViewTextBox-
Column();
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxCol-
umn();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuS-
trip(this.components);
this.respondedToolStripMenuItem = new System.Windows.Forms.Tool-
StripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.dgList)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
73
Android Mobile Application

//
// dgList
//
this.dgList.AllowUserToAddRows = false;
this.dgList.AllowUserToDeleteRows = false;
this.dgList.ColumnHeadersHeightSizeMode = System.Windows.Forms.-
DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgList.Columns.AddRange(new System.Windows.Forms.DataGrid-
ViewColumn[] {
this.colName,
this.colFirst_Name,
this.colLastName,
this.colNumber,
this.colLat,
this.colLon,
this.colLocation,
this.colDateTime,
this.Column2});
this.dgList.ContextMenuStrip = this.contextMenuStrip1;
this.dgList.Location = new System.Drawing.Point(7, 58);
this.dgList.Name = "dgList";
this.dgList.RowHeadersVisible = false;
this.dgList.SelectionMode = System.Windows.Forms.DataGridViewSelec-
tionMode.FullRowSelect;
this.dgList.Size = new System.Drawing.Size(1109, 512);
this.dgList.TabIndex = 0;
this.dgList.CellClick += new System.Windows.Forms.DataGridView-
CellEventHandler(this.dgList_CellClick);
this.dgList.CellDoubleClick += new System.Windows.Forms.DataGrid-
ViewCellEventHandler(this.dgList_CellDoubleClick);
this.dgList.CellMouseClick += new System.Windows.Forms.DataGrid-
ViewCellMouseEventHandler(this.dgList_CellMouseClick);
this.dgList.MouseClick += new System.Windows.Forms.MouseEven-
tHandler(this.dgList_MouseClick);
//
// colName
//
this.colName.DataPropertyName = "Id";
this.colName.Frozen = true;
this.colName.HeaderText = "ID";
this.colName.Name = "colName";
74
Android Mobile Application

this.colName.ReadOnly = true;
//
// colFirst_Name
//
this.colFirst_Name.DataPropertyName = "First_name";
this.colFirst_Name.HeaderText = "FirstName";
this.colFirst_Name.Name = "colFirst_Name";
this.colFirst_Name.ReadOnly = true;
//
// colLastName
//
this.colLastName.DataPropertyName = "Last_name";
this.colLastName.HeaderText = "LastName";
this.colLastName.Name = "colLastName";
this.colLastName.ReadOnly = true;
//
// colNumber
//
this.colNumber.DataPropertyName = "Contact_no";
this.colNumber.HeaderText = "Contact No";
this.colNumber.Name = "colNumber";
this.colNumber.ReadOnly = true;
//
// colLat
//
this.colLat.DataPropertyName = "Datetime";
this.colLat.HeaderText = "DateTime";
this.colLat.Name = "colLat";
this.colLat.ReadOnly = true;
//
// colLon
//
this.colLon.DataPropertyName = "Longitude";
this.colLon.HeaderText = "Longitude";
this.colLon.Name = "colLon";
this.colLon.ReadOnly = true;
//
// colLocation
//
this.colLocation.DataPropertyName = "Latitude";
this.colLocation.HeaderText = "Latitude";
75
Android Mobile Application

this.colLocation.Name = "colLocation";
this.colLocation.ReadOnly = true;
//
// colDateTime
//
this.colDateTime.DataPropertyName = "Address";
this.colDateTime.HeaderText = "Address";
this.colDateTime.Name = "colDateTime";
this.colDateTime.ReadOnly = true;
//
// Column2
//
this.Column2.DataPropertyName = "Responded";
this.Column2.HeaderText = "Responded";
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.-
ToolStripItem[] {
this.respondedToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(140, 26);
//
// respondedToolStripMenuItem
//
this.respondedToolStripMenuItem.Name = "respondedToolStripMenu-
Item";
this.respondedToolStripMenuItem.Size = new System.Drawing.Size(152,
22);
this.respondedToolStripMenuItem.Text = "Responded";
this.respondedToolStripMenuItem.Click += new
System.EventHandler(this.respondedToolStripMenuItem_Click);
//
// frmRequestList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1128, 582);
this.Controls.Add(this.dgList);
76
Android Mobile Application

this.Name = "frmRequestList";
this.Text = "Request List";
this.FormClosed += new System.Windows.Forms.FormClosedEven-
tHandler(this.frmRequestList_FormClosed);
this.Load += new System.EventHandler(this.frmRequestList_Load);
((System.ComponentModel.ISupportInitialize)(this.dgList)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);

#endregion

private System.Windows.Forms.DataGridView dgList;


private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem respondedToolStripMe-
nuItem;
private System.Windows.Forms.DataGridViewTextBoxColumn colName;
private System.Windows.Forms.DataGridViewTextBoxColumn
colFirst_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn colLast-
Name;
private System.Windows.Forms.DataGridViewTextBoxColumn colNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn colLat;
private System.Windows.Forms.DataGridViewTextBoxColumn colLon;
private System.Windows.Forms.DataGridViewTextBoxColumn colLocation;
private System.Windows.Forms.DataGridViewTextBoxColumn colDate-
Time;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
}
}

77
Android Mobile Application

9.SCREEN LAYOUT
WITH TEST DATA
AND TEST RESULTS

78
Android Mobile Application

Android mobile screen

79
Android Mobile Application

Android application (My App)

80
Android Mobile Application

User registration screen

81
Android Mobile Application

Data saved

82
Android Mobile Application

10.REPORT
LAYOUTS

Request list

83
Android Mobile Application

Gps location

84
Android Mobile Application

Delete update

85
Android Mobile Application

11.REFERENCES/
BIBLIOGRAPHY/
WEBSITE USED
86
Android Mobile Application

References:

Android 2 Application Development

Android Apps for Absolute Beginners

Apress -Beginning Android 3

Beginning Android

Wrox – Beginning Android Application Development

Website:

www.google.com

www.developer.android.com

www.stackoverflow.com

www.codeproject.com

87
Android Mobile Application

88

You might also like