Chapter 1 Introduction: 1.1 Project Title
Chapter 1 Introduction: 1.1 Project Title
1.2 Objective
Women are adept at mobilizing diverse groups for a frequent
cause. They often work across racial, sacred, opinionated, and
intellectual divides to encourage serenity. We are all aware of
importance of women's security, but we must recognize that they
should be well secluded. Women's are not physically powerful as
compared to men, in crisis situation a helping hand would be a relief
for them. The best way to minimize your chances of becoming a victim
of violent crime (robbery, sexual assault, rape, domestic violence) is to
identify and call on resources to help you out of unsafe situations.
Whether you're in instant trouble or get separated from friends during
a night out and don't know how to get home, having these apps on
your phone can diminish your risk and bring assistance when you
require it. Although several were formerly developed for students to
reduce the risk of physical attack on campus, they are also suitable for
all women.
In the light of recent outrage in Delhi which shook the nation and
woke us to the safety issues for our daughters, public are gearing
upbeat in different ways to fight back. A swarm of new apps have been
developed to provide security systems to women on their phones. Here
we introduce an app which ensures the safety of women. This reduces
risk and brings assistance when we need it and help us to identify the
1
location of the one in danger. We propose our app since it have some
key features which diverse it from others are as follows:
1) At first user have to save some details. These details consist
of: contact numbers like friends, family etc. And send the Text
Message to the recipient.
2) Then initialize this app as a "widget", so that a finger touch is
enough to alert your recipient.
3) It will also record voice in the region of surrounds for 45
seconds and then save this recording.
This message also includes the current position (latitude and
longitude) of the victim. Android is the first truly open and
comprehensive
software
platform
for
mobile
devices,
its
see how they can be improved. Some of the Android Apps that offer
the relatively similar service:
1. ADT bundle.
2. Android SDK Manager min v 8.
3. Computer system with software specification:
Operating system: windows XP and above.
2.2 Operational FeasibilityThe proposed system is operationally feasible as the final output of the
project can be used by the android users and it will be easy and user
friendly to use. The proposed system does not require special training
to operate the application. This app will fulfill the need the user in
emergency situations.
ab
bb
cb
db
Organic
2.4
1.05
2.5
0.38
Semi-detached
3.0
1.12
2.5
0.35
Embedded
3.6
1.20
2.5
0.32
b
b
d
b
(1)
.
(2)
(3)
= 2.5 (4.96)
0.38
= 4.6 months
10
activities. Fig 4 shows the use case model for the project.
11
12
13
15
CHAPTER 4
16
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.location.LocationClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MainActivity extends Activity implements
com.google.android.gms.location.LocationListener,
GooglePlayServicesClient.ConnectionCallbacks,
GooglePlayServicesClient.OnConnectionFailedListener,
OnSharedPreferenceChangeListener {
GoogleMap map;
boolean recording = false;
Activity act;
SharedPreferences globalPreferences;
Context context;
double lng = 0;
double lat = 0;
ComponentName s;
LocationManager locationManager;
LocationListener listener;
final int PICK_PANIC_CONTACT = 100;
final int PICK_NOTI_CONTACT = 101;
LocationRequest mLocationRequest;
LocationClient mLocationClient;
PasswordDialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.startService(new Intent(this, GpsService.class));
ActionBar actionBar = getActionBar();
actionBar.setBackgroundDrawable(new ColorDrawable(Color
.parseColor("#FF7F00")));
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setSubtitle("Securing You");
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
17
@Override
public void run() {
try {
Log.e("tring...","mail");
String sourceSender =
globalPreferences.getString("email_username", "");
String sourcePassword =
globalPreferences.getString("email_password", "");
String sendEmail =
globalPreferences.getString("email_send", "");
GMailSender sender = new GMailSender(
sourceSender,
sourcePassword);
sender.sendMail("Emergency Audio
Recording", "I am in emergency. Attached Audio Recording.",
sourceSender,
sendEmail);
} catch (Exception e) {
Log.e("SendMail", e.getMessage(), e);
}
}
}, 1000 * 60);
}
});
Button stop = (Button) findViewById(R.id.stopApp);
stop.setOnClickListener(new android.view.View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (((Button) v).getText().toString().equals("Stop App")) {
dialog = new PasswordDialog();
dialog.show(getFragmentManager(), "password");
stopService(new Intent(getApplicationContext(),
GpsService.class));
((Button) v).setText("Start App");
mLocationClient.removeLocationUpdates(MainActivity.this);
mLocationClient.disconnect();
((Button)
v).setBackgroundColor(Color.parseColor("#00AAFF"));
} else if (((Button) v).getText().toString()
19
.equals("Start App")) {
mLocationClient.connect();
((Button) v).setText("Stop App");
((Button)
v).setBackgroundColor(Color.parseColor("#00D4FF"));
}
}
});
globalPreferences = getPrefs();
globalPreferences.registerOnSharedPreferenceChangeListener(this);
mLocationRequest = LocationRequest.create();
mLocationClient = new LocationClient(this, this, this);
// Use high accuracy
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
// Set the update interval to 5 seconds
mLocationRequest.setInterval(10000);
// Set the fastest update interval to 1 second
mLocationRequest.setFastestInterval(10000);
if (status != ConnectionResult.SUCCESS) {
int requestCode = 10;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this,
requestCode);
dialog.show();
} else {
MapFragment fragmentManager = (MapFragment) getFragmentManager()
.findFragmentById(R.id.map);
map = fragmentManager.getMap();
map.setMyLocationEnabled(true);
}
}
public SharedPreferences getPrefs() {
SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(this);
Log.e("Prefs", prefs.toString());
return prefs;
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
20
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
Log.e("On Pause", "Called");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.app_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public void onLocationChanged(Location location) {
// TODO Auto-generated method stub
double latitude = location.getLatitude();
// Getting longitude of the current location
double longitude = location.getLongitude();
lng = longitude;
lat = latitude;
LatLng latLng = new LatLng(latitude, longitude);
Log.e("Loc", location.toString());
map.moveCamera(CameraUpdateFactory.newLatLng(latLng));
map.clear();
Log.e("Activity", "Location changed");
map.addMarker(new MarkerOptions().position(new LatLng(lat, lng)))
.setTitle(
"lat:" + String.valueOf(lat) + "\nlng:"
+ String.valueOf(lng));
// Zoom in the Google Map
map.animateCamera(CameraUpdateFactory.zoomTo(15));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
switch (item.getItemId()) {
21
case R.id.settings:
startActivity(new Intent(this, SettingsActivity.class));
break;
case R.id.contact:
Intent pickContactIntent = new Intent(Intent.ACTION_PICK,
Uri.parse("content://contacts"));
pickContactIntent.setType(Phone.CONTENT_TYPE); // Show user only
// contacts w/ phone
// numbers
startActivityForResult(pickContactIntent, PICK_PANIC_CONTACT);
break;
case R.id.notificationcontact:
pickContactIntent = new Intent(Intent.ACTION_PICK,
Uri.parse("content://contacts"));
pickContactIntent.setType(Phone.CONTENT_TYPE); // Show user only
// contacts w/ phone
// numbers
startActivityForResult(pickContactIntent, PICK_NOTI_CONTACT);
break;
case R.id.viewnoticontact:
Intent intent = new Intent(this, DisplayContactActivity.class);
Bundle args = new Bundle();
args.putString("list_name", "NOTIFICATION");
intent.putExtras(args);
startActivity(intent);
break;
case R.id.viewpaniccontact:
intent = new Intent(this, DisplayContactActivity.class);
args = new Bundle();
args.putString("list_name", "PANIC");
intent.putExtras(args);
startActivity(intent);
break;
case R.id.help:
intent = new Intent(this,HelpActivity.class);
startActivity(intent);
break;
case R.id.about:
intent = new Intent(this,AboutActivity.class);
startActivity(intent);
break;
case R.id.password:
22
24
};
@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
Log.e("Start", "Start Called");
if (!mLocationClient.isConnected())
mLocationClient.connect();
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
// TODO Auto-generated method stub
Log.e("What Changed?", key);
if (key.equals("gps_time")) {
mLocationClient.removeLocationUpdates(this);
int newInterval = 1000 * Integer.parseInt(sharedPreferences
.getString("gps_time", "10"));
mLocationRequest.setInterval(newInterval);
mLocationRequest.setFastestInterval(newInterval);
Log.e("New Interval", String.valueOf(newInterval));
mLocationClient.disconnect();
mLocationClient.connect();
}
}
public void checkPassword(String password){
String stored = globalPreferences.getString("password", "256249");
if(password.equals(stored)){
Log.e("Password","Enetered");
dialog.dismiss();
}else{
dialog.dismiss();
dialog.show(getFragmentManager(), "password");
}
}
}
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import
android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.location.Location;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.location.LocationClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
GooglePlayServicesClient.OnConnectionFailedListener,LocationListener,OnSh
aredPreferenceChangeListener {
LocationClient client;
26
LocationRequest locationRequest;
int status;
SharedPreferences prefs;
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
}
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
status =
GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (status != ConnectionResult.SUCCESS) {
}
}
27
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// TODO Auto-generated method stub
locationRequest = LocationRequest.create();
locationRequest.setInterval(1000*60*1);
locationRequest.setFastestInterval(1000*60*1);
client = new LocationClient(this, this, this);
client.connect();
Log.e("Service"," Started");
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
return START_STICKY;
@Override
public void onConnectionFailed(ConnectionResult arg0) {
// TODO Auto-generated method stub
@Override
public void onConnected(Bundle arg0) {
// TODO Auto-generated method stub
28
Log.e("Location Client","Connected");
client.requestLocationUpdates(locationRequest, this);
}
@Override
public void onDisconnected() {
// TODO Auto-generated method stub
Log.e("Location Client","Disconnected");
}
@Override
public void onLocationChanged(Location arg0) {
// TODO Auto-generated method stub
Log.e("Service","Location Changed");
Set<String> notification = prefs.getStringSet("noti_nos", null);
String messageTemplate =
prefs.getString("notification_template","Help Me Plz!");
messageTemplate+="Lat"+ arg0.getLatitude() + "Long:" +
arg0.getLongitude();
if(notification!=null){
Log.e("Panic Nos",notification.toString());
for (String string : notification) {
Log.e("No",string);
android.telephony.SmsManager sms =
android.telephony.SmsManager.getDefault();
29
sms.sendTextMessage(string, null,
messageTemplate,null, null);
}
}
}
@Override
public void onSharedPreferenceChanged(SharedPreferences
sharedPreferences,
String key) {
// TODO Auto-generated method stub
Log.e("What Changed",key);
if(key.equals("gps_time")){
client.removeLocationUpdates(this);
int newInterval =
1000*Integer.parseInt(sharedPreferences.getString("gps_time","10"));
locationRequest.setInterval(newInterval);
locationRequest.setFastestInterval(newInterval);
client.disconnect();
client.connect();
}
}
}
30
package com.codemental.a;
import java.io.File;
import java.io.IOException;
import
import
import
import
import
import
android.app.Service;
android.content.Intent;
android.media.MediaRecorder;
android.os.Environment;
android.os.IBinder;
android.util.Log;
recorder.prepare();
} catch (IllegalStateException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
31
e1.printStackTrace();
}
File instanceRecordDirectory = new File(
Environment.getExternalStorageDirectory() + File.separator
+ Environment.DIRECTORY_DCIM + File.separator
+ "FILE_NAME");
if (!instanceRecordDirectory.exists()) {
instanceRecordDirectory.mkdirs();
}
File instanceRecord = new File(
instanceRecordDirectory.getAbsolutePath() + File.separator
+ "Recondsound.mp4");
if (!instanceRecord.exists()) {
try {
instanceRecord.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
recorder.setMaxDuration(1000*45);
recorder.setOutputFile(instanceRecord.getAbsolutePath());
try {
recorder.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
recorder.start(); // Recording is now started
}
private void stopRecording() {
Log.e("REcording ", "Stopped");
if (recorder != null) {
recorder.stop();
recorder.release();
recorder = null;
}
}
}
32
package com.codemental.a;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.Security;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.Multipart;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
33
import android.os.Environment;
import android.util.Log;
static {
Security.addProvider(new com.codemental.a.JSSEProvider());
}
props.put("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.quitwait", "false");
String filename =
Environment.getExternalStorageDirectory() +
File.separator
+ Environment.DIRECTORY_DCIM + File.separator
+ "FILE_NAME"+File.separator+"Recondsound.mp4";
MimeMessage message = new MimeMessage(session);
message.addRecipient(Message.RecipientType.TO, new
InternetAddress(
recipients));
messageBodyPart.setFileName(filename);
multipart.addBodyPart(messageBodyPart);
// Send message
Transport.send(message);
Log.e("Message Sent", "Successfully");
} catch (Exception e) {
e.printStackTrace();
39
Figure 2: Menu
40
Figure 4 Contacts
41
Figure 5 Help
42
CHAPTER 5
Validation refers to a different set of tasks that ensure that the software that has been built
is traceable to customer requirements. Validation checks that the product design satisfies or fits
the intended use (high-level checking), i.e., the software meets the user requirements. This is
done through dynamic testing and other forms of review. Here I have Checked login is done by
authorised user or not. And also checked that the entered land area is not exceeded to the total
area of the land.
6.1.2Unit Testing
43
As the name says the way of testing that is followed is to test smaller components or
modules. This testing focuses mainly on internal processing logic of the component. This testing
can be conducted in parallel order for multiple components. In this testing, I have tested whether
I could add and modify agricultural details.
This testing is done in the later part of the project, after unit testing is completed, and the
components are integrated together and tested. Testing upon this integration is done to find out
whether the result the system should give is accurate to the result planned or not. It helps find out
whether the integration way is correct or not. In this testing, I have tested whether the crop
details were saved or not. And also I have tested whether the Lot Mandal note and encroacher
details are saved or not.
44
Chapter 6
Conclusion
In this, there is one module. The module for women attack Handler System
will help in Prevention of attacks on women and being victim of any sex
scandal. This system will give assurance for women to live secured life.
45
References
[1]
VaijayantiPawar,
Prof.
N.R.Wankhade,
DipikaNikam,
KanchanJadhav,
[Online]. Available:
http://www.mhhe.com/engcs/compsci/pressman/information/olc/COCOMO.html
[3] Roger S. Pressman, Software Engineering, 6th Edition.
46