Hawassa University: Hawassa University Institute of Technology Department of Information Technology
Hawassa University: Hawassa University Institute of Technology Department of Information Technology
UNIVERSITY
HAWASSA UNIVERSITY
INSTITUTE OF TECHNOLOGY DEPARTMENT OF
INFORMATION TECHNOLOGY
Industrial project 2
This is to certify that I have read this project and that in my opinion it is fully adequate, in scope
and quality, as a senior project for the degree of Bachelor of Science.
First and foremost, we are very grateful to the almighty God for letting us finish our final
year industrial project one and give us strength that we need in order to fulfill our duty as
an Information Technology student.
Here, we wish to express our sincere appreciation to our advisor, MR. Tewodros Tilahun,
for encouragement, guidance, suggestions, critics, and friendship throughout finishing
this project.
Thanks also to all of the kind lecturers in the Department of information technology for
their accommodation, suggestion, and opinion during the project progress in university.
In particular, we would like to thank all the staff and lab assistants, for their cooperation,
indirect or direct contribution upon completing our project.
Table of Contents
Acknowledgment.........................................................................................................................................3
INTRODUCTION...........................................................................................................................................5
ALGORITHM DESIGN..............................................................................................................................5
Class ActivityCustomerLogin..................................................................................................................5
Class FragmentLoadServiceProviders.....................................................................................................6
Class Constants........................................................................................................................................6
CODING PROCEDURES...........................................................................................................................7
Coding standards and principles..............................................................................................................7
CODING PROCESS.................................................................................................................................11
TESTING STATEGY...............................................................................................................................11
Unit Testing...........................................................................................................................................11
Integration Testing.................................................................................................................................12
System Testing......................................................................................................................................12
Structural testing....................................................................................................................................13
SECURITY OF THE SYSTEM................................................................................................................14
System Maintenance and documentation...............................................................................................15
Availability............................................................................................................................................15
Corrective Maintenance.........................................................................................................................15
Preventive Maintenance........................................................................................................................15
Perfective Maintenance.........................................................................................................................15
INTRODUCTION
The implementation phase represents the work done to meet the requirements of the scope of
work and fulfill the charter. During the implementation the project team accomplished the work
defined in the plan and made adjustments when factors changed. This is what we call software
implementation. The purpose of these activities is to convert the final physical system
specification into working model with reliable software and hardware, document the work that
has been done, and provide help for current and future users and take care of the system.
ALGORITHM DESIGN
Algorithm design is a sequence of steps to solve a problem and approaches to meet the
requirements of our system. The following sample used algorithm design way of our system. It is
just similar with our code functionality and validity. There are so many different classes in our
system, but we selected very few of them to justify the way of algorithm the system follows. The
algorithm we used is pseudo code.
Class ActivityCustomerLogin
The activity customer login class has properties and methods to hold user account information
and process the information according to the system logic.
Properties
Method
Precondition: provided information should not empty and should match the required format.
THEN
ELSE
ENDIF
END
Class FragmentLoadServiceProviders
Class FragmentServices is used to retrieve services found in the database.
Methods
Post condition: load the service provider in the specified services category from the database.
BEGIN
ELSE
ENDIF
END
Class Constants
This class holds the properties and methods that can be as an input and processing class for other
classes.
Properties
Methods
encryptData
BEGIN
CODING PROCEDURES
Coding standards and principles
We use java programming for and XML for the android and use HTML, PHP, JAVASCRIPT
AND CSS for the website. We followed the standard naming conventions, Standards and
Principles for each programming language. The examples in the following naming principles and
rules are taken from our project.
Packages
It should be a lowercase letter and if it contains multiple words it should be separated by dots (.).
Class
It should start with the upper case letter and it should be nouns. Ex. public class Constants
Constants
Variables
Methods
It should start with lower case letter. Ex. private void loadFeedback();
Oder to follow
Use the following order to declare members of a class or Activity in Android studio:
Class variables (static members).
Instance variables.
Class Methods (protected methods)
Other methods
package com.example.common;
this.serviceId = serviceId;
this.serviceType = serviceType;
this.servicePhoto = servicePhoto;
return serviceId;
return serviceType;
}
return servicePhoto;
@Override
return "Services{" +
"serviceId=" + serviceId +
'}';
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.FragmentManager;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonArrayRequest;
import com.android.volley.toolbox.StringRequest;
import com.bumptech.glide.Glide;
import com.example.common.Constants;
import com.example.common.MySingleton;
CODING PROCESS
Incremental Coding Process
The coding activity starts when some form of design has been done and the specifications of the
modules to be developed are available. Throughout our project we used the incremental coding
process. The incremental coding process is a coding process often used by experienced
developers.
We first wrote the code for implementing only part of a functionality of a module. We then
compiled and tested with some quick tests to check the code. When the code passes these tests,
we added further functionality to the code, which is then tested again. In other words, we built
the code incrementally, testing it as we built it. For example first we try to connect to the
database and then test if the connection is successful and then try to do CRUD operations and
test the operation and so on.
TESTING STATEGY
The test plan is designed to analyze the logic used in the implementation of the Android Based
home to home service system app. The tests will allow us to ensure correct program flow, and to
determine the error-handling capability of the system.
Unit Testing
Unit test is a way of testing each of the system functionality independently. Accordingly our
group member has tested each one of the three major activities. The first is accompanying
activities independently using different user input, the second is different login mechanisms and
any technique of fault finding so that an incorrect functioning of the activities was corrected at
the right time.
Integration Testing
By combining each individual form and report with their concerned database we had tested by
giving general data. From this we had understood and realized that how the system works using
separate module.
System Testing
It is the final step of testing. In this system tested the entire system as a whole with all forms,
code, modules. In this we tested all the functionalities in the System. All errors in the forms,
functions, modules have been tested. Finally by the system testing we had ensured that the entire
integrated software system meets the desired requirements.
Input data validation: We are going to validate inputs a person gives to login into the
admin page in server side PHP for validation. Because if we put our validation in
JavaScript some browser would allow the intruders to turn off the JavaScript on that
browser.
Password encryption: We use Md5 to encrypt the password data on a data base so no
one can access the password stored on the database since md5 hasher is a one-way
inscription method.
Proper error handling: It’s good to know all the errors that occur while we are
developing a website, but when we make the application accessible to end users we
should take to hide the errors. If errors are shown to users, it may make our application
vulnerable. So, we will configure our server differently for development and production
environments.
Protecting session data: To protect session data we encrypt the information stored in
the session.
Preventing SQL Injection attacks: To prevent SQL injection so as the attacker can’t
inject malicious SQL query, we used php methods like mysqli_real_escape_string() in
order to prevent the system from being attacked by malicious codes entered in forms.
This way we can make our system secures. Using Prepared statements/parameterized
query.
Availability
We will ensure availability by rigorously maintaining all hardware, performing hardware
repairs immediately when needed and maintaining a correctly functioning operating
system environment.
Primary methods that we will use to protect against loss of availability are fault tolerant
systems, redundancies, and backups. Fault tolerance means that a system can develop a
fault, yet tolerate it and continue to operate. Backups ensure that that important data is
backed up and can be restored if the original data becomes corrupt.
Corrective Maintenance
We will conduct corrective maintenance which involves repairing of faults and basically errors
in design, logic or coding in the daily system functions.
Preventive Maintenance
We will conduct Preventive maintenance which is essentially the intervention that is focused on
reducing or eliminating the occurrence of errors.
Perfective Maintenance
• As the end users use the system, certain new or changed user requirements are
discovered. We will conduct Perfective maintenance which takes those feedbacks into
account.
Database connection
Constants.php
<?php
define('HOST','localhost');
define('USER','root');
define('PASSWORD','');
define('DB_NAME','huluhome');
?>
DbConnection.php
<?php
define('ERROR','Error Occured');
class DbConnection
{
private $conn;
function __construct()
{
}
function connectDb()
{
include_once dirname(__FILE__).'/Constants.php';
$this->conn = new mysqli(HOST,USER,PASSWORD,DB_NAME);
if(mysqli_connect_errno())
{
echo ERROR.mysqli_connect.err();
}
return $this->conn;
}
}
Dboperation.php
<?php
class DbOperation {
function __construct(){
require_once dirname(__FILE__). '/DbConnection.php';
$db = new DbConnection();
$this->conn = $db->connectDb();
function loadServices(){
$statement =$this->conn->prepare("SELECT * FROM `services` ");
$statement->execute();
$result = $statement->get_result();
if($result->num_rows>0)
{
while($row=$result->fetch_all(MYSQLI_ASSOC))
{
$this->services=$row;
}
return 1;
}
return 0;
}
loadService.php
<?php
require_once '../Includes/DbOperation.php';
$response =array();
if($_SERVER['REQUEST_METHOD']=='POST')
{
$db = new DbOperation();
if($db->loadServices())
{
$counter=0;
foreach($db->services as $row)
{
$row['photo'] = base64_encode(file_get_contents("../uploadServices/".
$row['photo']));
$serviceProviders[$counter++]=$row;
}
}
else{
$response['error']=true;
$response['msg']="The server request method is not post!!";
}
//echo json_encode($response);
echo json_encode($serviceProviders);
Constants.java
package com.example.common;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.provider.DocumentsContract;
import android.util.Base64;
FragmentService.java
package com.example.huluhome;
, RecyclerAdapterMaker.OnItemClickListener {
ProgressDialog progressDialog ;
SharedPreferences preferences;
//widget
ImageView img;
RadioButton knowLocation;
RadioButton differentLocation;
RadioGroup radioGroup;
Button selectLocation;
//holder
RecyclerView recyclerview;
ArrayList<Services> listOfServices;
int counter;
RecyclerAdapterMaker recyclerAdapterMaker;
@Override
Bundle savedInstanceState) {
recyclerview = view.findViewById(R.id.recyclerForServices);
recyclerview.setHasFixedSize(true);
recyclerview.setLayoutManager(gridLayoutManager);
loadServices();
return view;
progressDialog.show();
progressDialog.setContentView(R.layout.layout_progress_dialog);
progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
JsonArrayRequest jsonArrayRequest;
MySingleton.getInstance(getContext()).addToRequestQueue(jsonArrayRequest);
@Override
progressDialog.dismiss();
@Override
progressDialog.dismiss();
// Toast.makeText(getContext(),response.toString(),Toast.LENGTH_LONG).show();
try {
processJsonArray(response);
} catch (JSONException e) {
e.printStackTrace();
JSONObject jsonObject;
for (int i = 0; i < response.length(); i++) {
jsonObject = response.getJSONObject(i);
recyclerview.setAdapter(recyclerAdapterMaker);
recyclerAdapterMaker.setOnItemClickListener(this);
@Override
openDialog();
serviceId = clickedItem.getServiceId();
sP.putExtra(CATEGORY_EXTRA,clickedItem.getServiceId());
Toast.makeText(getContext(),"serviceId:"+clickedItem.getServiceId(),Toast.LENGTH_LONG).
show();
// startActivity(sP);
//
Toast.makeText(getContext(),clickedItem.getServiceType(),Toast.LENGTH_LONG).show();
}
radioGroup = customDialog.findViewById(R.id.rdgLocation);
knowLocation = customDialog.findViewById(R.id.chBxKnown);
differentLocation = customDialog.findViewById(R.id.chBxDifferent);
selectLocation = customDialog.findViewById(R.id.btnSelectLocation);
dialog.setContentView(customDialog);
dialog.show();
selectLocation.setOnClickListener(new View.OnClickListener() {
@Override
if(knowLocation.isChecked())
sP.putExtra(CATEGORY_EXTRA,serviceId);
startActivity(sP);
dialog.dismiss();
//Toast.makeText(getContext(),"you checked
known:"+serviceId,Toast.LENGTH_LONG).show();
}
else
map.putExtra(CATEGORY_EXTRA,serviceId);
startActivity(map);
dialog.dismiss();
}) }}
Conclusion
Throughout the implementation of our project starting from writing a single line of code to fully working
interconnection of functions we have followed the basic naming standards and principles in each
programming languages we used. We have tested our code according to the rules and requirements of our
project and remarkable outcomes have been observed. The important issues to be discussed in every
system such as security issue and maintenance issue are also implemented in our project. So our system
has the ability to last long by using those basic parameters and improving and maintaining what we have
seen as weakness and a threat.