Академический Документы
Профессиональный Документы
Культура Документы
PROJECT REPORT
ON
SUBMITTED BY
Abhishek Santosh Beloshe
PROJECT GUIDE
Mrs. MOUSMI PAWAR
K.J. Somaiya College of Science & Commerce
Vidyanagar, Vidyavihar, Mumbai – 400077.
Autonomous – Affiliated to University Of Mumbai
CERTIFICATE
Date:
Achievement is finding out what you would be doing rather than what you have to do.
It is not until you undertake such a project that you realize how much effort and hard work to
it really is, what your capabilities are and how well you present yourself or other things. It tells
you how much we rely on the efforts and goodwill of others. It gives me immense pleasure to
present this report towards fulfillment of my project.
It has been rightly said that we are built on the shoulder of others. For everything I have
achieved, the credit goes to all those who had helped me to complete this project successfully.
A special vote of thanks to my teachers, Mrs. Mousmi Pawar, Miss. Kirti Amberkar,
for their most sincere, useful and encouraging contribution throughout the project span.
Finally I would like to thank all my friends and the entire Computer Science department
who directly or indirectly helped me in the completion of this project and to my family without
whose support, motivation and encouragement this would not have been possible.
1. Organizational overview 7
5. Stakeholders 12
6. Gantt Chart 13
8. Event Table 15
19. Bibliography 89
Organizational Overview
IAMS is a system to handle the basic task and activities for the insurance agents. It
offers a robust insurance solution, which has the flexibility of customizations to match the
specific needs of Clients for achieving their business goal of good service and revenue
generation. The main function in IAMS is policy management, customer/policy holder details
management.
Nowadays, Insurance have been widely accepted by the public. The users that will benefit from
IAMS are the insurance agents from various life insurance companies. For this project LIC
[Life Insurance Corporation] insurance company will be my reference organization. The policy
holder details required by LIC will be integrated into the IAMS
I intend to design and develop a system which is more effective and systematic. I will handle
the tasks of information gathering and management, interface layout, database design, network
set, implementation and testing.
Modules:
Agent Registration: The new agent has to register into the system with his basic details.
Agent Login: The agent has to login into the system keeping the data secure.
Profile: The agent can see and update his personal details.
Add Policy: It stores the policy holder information required by the insurance agency.
Policy Search: The agent can search for the desired policy holder.
View Dues: The system notifies the agent for the policy premium dues.
Send Notifications: The system sends an auto generated message to policy holder.
Description of Existing System
The insurance business nowadays have been developing very fast. The insurance
company needs to keep track of details of its target companies, agents, policyholders and the
various products available with it. The typical insurance agent’s life at work looks like this.
Generate leads, meet them. Convert potential leads into clients. Introduce products, sell
products and do the follow up. The nature of work and the requisite regulatory confirmations
demand lot of paperwork. The use of manual ways of handling insurance management has been
a problem for the insurance agents. Entire records have to be updated timely, even a slight
mistake could complicate things. And it is very difficult to handle bulk data since human
memory is weaker than electronic counterpart.
The 21st century client is very number-savy, this makes it necessary for the agent to carry
a lot of papers or lug a laptop explaining the pros and cons of various products and in the order
to be ahead in the rise the agent is continuously on the move with his financial forms,
documents etc. This hampers his efficiency and accuracy at times. Since the whole of the
system was to be maintained with hands the process of keeping, maintaining, and retrieving
the information is very tedious and lengthy.
Limitations of Present System
People of remote areas who do not have knowledge about the Technology cannot use
this application.
All the files are stored in a single database so chances of database failure become
more. Any accidental failure of component may cause loss of valuable data.
There is a higher risk of maintaining the aspects such as data integrity and
confidentiality from those with malicious intentions.
The main goal of the application is to automate the existing system of manually
maintaining the policy holder records. This system can help to minimise the work load of
Agent. IAMS provides a paperless work environment to the agent because all the policyholder
information is saved into IAMS. Insurance agent can easily find the customer record needed,
by searching the database. IAMS will also automatically inform the agent regarding customer
Premium Dues so that the agent will not forget to collect the premium from their customers.
The update, delete and insert record function will also be available in IAMS. IAMS must be
installed into your smartphones before it can be used by the target user. As a result of this
system, the activities of the company are performed within the stipulated time and the reliable
efficient service is ensured to its users.
Advantages:
1) Insurance agents mobile solutions helps the agent to register clients and close the
deals with reduced paperwork and that too online.
2) The solution collects the necessary data from the back end which allows the agent to
do away from the regular paperwork. The agent can access corporate data anytime,
anywhere.
3) The app allows the user to check the status of the insurance regarding any premiums
due.
5) Data manipulation procedure like data add, update, delete and modify can be doe
easily with a well-designed architecture, which can maintain the data validation.
Stakeholders
Service Providers:
Service Providers is the administrator of the system. Service provider is the person who has all
the access to the system. The Service provider monitors the system for its working. Service
provider knows all the information about the system.The one who will be developing and
testing the applications future enhancements and look for reports
Agent:
The person who browses, register and uses the application in any possible way.
Gantt Chart
Preliminary Phase
System Analysis
System Design
System Coding
System
Implementation
Expected Date
Date of completion
Technologies Used and their Description
Software Requirements:
Android Studio is the official integrated development environment (IDE) for Google's Android
operating system, built on JetBrains' IntelliJ IDEA software and designed specifically for
Android development. It is available for download on Windows, macOS and Linux based
operating systems
Firebase:
Firebase is a mobile and web application development platform developed by Firebase, Inc. in
2011. Firebase is a cloud based computing service and it provides a variety of services like
Firebase Analytics, Firebase Cloud Messaging, Firebase Auth, Firebase Realtime Database,
Firestore, Firebase Storage, Firebase Hosting, Firebase ML kit, Crashlytics, Performance, Test
Labs, Firebase remoting service, etc and has evolved over the years.
JSON:
JavaScript Object Notation (JSON) is an open-standard file format that uses human-readable
text to transmit data objects consisting of attribute–value pairs and array data types (or any
other serializable value). It is a very common data format used for asynchronous browser–
server communication, including as a replacement for XML.
Hardware Requirements:
View Dues Select View Agent Enters the Popsup and Agent
Dues layout displays dues
policyno.
In the Unified Modeling Language (UML), a use case diagram can summarize the details of
your system's users (also known as actors) and their interactions with the system. To build one,
you'll use a set of specialized symbols and connectors. A proper use case diagram depicts a
high-level overview of the relationship between use cases, actors, and systems. Use cases are
represented with a labeled oval shape. Stick figures represent actors in the process, and the
actor's participation in the system is modeled with a line between the actor and use case.
Components:
Actors: The users that interact with a system. An actor can be a person, an organization,
or an outside system that interacts with your application or system. They must be
external objects that produce or consume data.
Use cases: Horizontally shaped ovals that represent the different uses that a user might
have.
Associations: A line between actors and use cases. In complex diagrams, it is important
to know which actors are associated with which use cases.
System: A specific sequence of actions and interactions between actors and the system.
A system may also be referred to as a scenario.
Entity-Relationship Diagram
An entity relationship diagram (ERD) shows the relationships of entity sets stored in a
database. An entity in this context is an object, a component of data. An entity set is a
collection of similar entities. These entities can have attributes that define its properties.
Entities:
These are represented by rectangles. An entity is an object or concept about which you want to
store information. A weak entity is an entity that must defined by a foreign key relationship
with another entity as it cannot be uniquely identified by its own attributes
Attributes:
These are represented by ovals. A key attribute is the unique, distinguishing characteristic of
the entity.
Relationships:
These are represented by diamond shape, shows how two entities share information in the
database.
Data-Flow Diagram
A data flow diagram (DFD) maps out the flow of information for any process or system. It uses
defined symbols like rectangles, circles and arrows, plus short text labels, to show data inputs,
outputs, storage points and the routes between each destination. They can be used to analyse
an existing system or model a new one. A data flow diagram can dive into progressively more
detail by using levels and layers, zeroing in on a particular piece. DFD levels are numbered 0,
1 or 2, and occasionally go to even Level 3 or beyond. The necessary level of detail depends
on the scope of what you are trying to accomplish.
DFD Level 0:
DFD Level 1:
DFD Level 2:
Class Diagram
The class diagram is one of the most commonly used diagrams in UML. Software engineers
and business professionals often choose class diagrams to map the structure of particular
systems because they clearly display the various classes, attributes, operations, and
relationships between objects. In our example below, each class shape is labeled with its name
in the first row, the second row displays each attribute of the class on a separate line, and the
third row displays each operation on a separate line.
Sequence Diagram
Sequence diagrams are a popular dynamic modeling solution in UML because they specifically
focus on lifelines, or the processes and objects that live simultaneously, and the messages
exchanged between them to perform a function before the lifeline ends. A sequence diagram is
a type of interaction diagram because it describes how—and in what order—a group of objects
works together.
Menu Tree
The Menu Tree element, and its child elements, are used to define a menu, in a horizontal or
vertical orientation, with optional sub-menu branches and menu items.
List of Tables with Attributes and Constraints
1. Registration:
2. Agent:
3. Policies:
AndroidManifest.xml –
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>
MainActivity.java –
package com.example.abhishek.policyhandler;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
EditText ed1;
EditText ed2;
Button b1;TextView tv;
FirebaseAuth fauth;
public long backPressedTime;
public Toast backToast;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ed1=(EditText)findViewById(R.id.editText);
ed2=(EditText)findViewById(R.id.editText2);
tv=(TextView)findViewById(R.id.textView);
b1=(Button)findViewById(R.id.button2);
SharedPreferences spref=getSharedPreferences("sp12" , Context.MODE_PRIVATE);
String tempUname=spref.getString("username",null);
String tempPass=spref.getString("password",null);
System.out.println(tempUname+"\\\\\\\\t**********"+tempPass);
if(!(tempUname==null) && !(tempPass==null)) {
ed1.setText(tempUname);
ed2.setText(tempPass);
}
fauth=FirebaseAuth.getInstance();
tv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent in=new Intent(getApplicationContext(),Main2Activity.class);
startActivity(in);
}
});
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final String email = ed1.getText().toString();
final String password = ed2.getText().toString();
SharedPreferences spref=getSharedPreferences("sp12" ,
Context.MODE_PRIVATE);
spref.edit().putString("username",email).commit();
spref.edit().putString("password",password).commit();
if (TextUtils.isEmpty(email)) {
Toast.makeText(getApplicationContext(), "Enter email address!",
Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(password)) {
Toast.makeText(getApplicationContext(), "Enter password!",
Toast.LENGTH_SHORT).show();
return;
}
fauth.signInWithEmailAndPassword(email,
password).addOnCompleteListener(MainActivity.this, new
OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()) {
if (password.length() < 6) {
Toast.makeText(getBaseContext(),
getString(R.string.minimum_password), Toast.LENGTH_LONG).show();
return;
} else {
Toast.makeText(getBaseContext(), getString(R.string.auth_failed),
Toast.LENGTH_LONG).show();
return;
}
} else {
Intent intent = new Intent(MainActivity.this, Main3Activity.class);
startActivity(intent);
finish();
}
}
});
}
});
}
public void onBackPressed(){
if(backPressedTime + 6000 > System.currentTimeMillis()){
backToast.cancel();
super.onBackPressed();
return;
}
else {
backToast = Toast.makeText(getBaseContext(),"Press back again to exit",
Toast.LENGTH_SHORT);
backToast.show();
}
backPressedTime = System.currentTimeMillis();
}
}
Main2Activity.java –
package com.example.abhishek.policyhandler;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Main3Activity.java –
package com.example.abhishek.policyhandler;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.view.View;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
public class Main3Activity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main3);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main3, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
return super.onOptionsItemSelected(item);
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
FragmentManager fragmentManager=getFragmentManager();
if (id == R.id.nav_first_layout) {
fragmentManager.beginTransaction().replace(R.id.content_frame,new
FirstFragment()).commit();
} else if (id == R.id.nav_second_layout) {
fragmentManager.beginTransaction().replace(R.id.content_frame,new
SecondFragment()).commit();
} else if (id == R.id.nav_third_layout) {
fragmentManager.beginTransaction().replace(R.id.content_frame,new
ThirdFragment()).commit();
} else if (id == R.id.nav_logout_layout) {
fragmentManager.beginTransaction().replace(R.id.content_frame,new
LogoutFragment()).commit();
}
else if(id==R.id.nav_profile_layout){
fragmentManager.beginTransaction().replace(R.id.content_frame,new
FourthFragment()).commit();
}
import android.app.Fragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
FirstFragment.java –
package com.example.abhishek.policyhandler;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import java.util.HashMap;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
Bundle savedInstanceState) {
myview=inflater.inflate(R.layout.first_layout,container,false);
return myview;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getActivity().setTitle("Add Policy");
term=(EditText)getActivity().findViewById(R.id.term);
cname=(EditText)getActivity().findViewById(R.id.cname);
sumass=(EditText)getActivity().findViewById(R.id.sumass);
policyNumber=(EditText)getActivity().findViewById(R.id.policyNumber);
age=(EditText)getActivity().findViewById(R.id.age);
commence=(EditText)getActivity().findViewById(R.id.commence);
dob=(EditText)getActivity().findViewById(R.id.dob);
mob=(EditText)getActivity().findViewById(R.id.mob);
add=(EditText)getActivity().findViewById(R.id.add);
commence=(EditText)getActivity().findViewById(R.id.commence);
b5=(Button)getActivity().findViewById(R.id.button5);
String[] array;
spinner2=(Spinner)getActivity().findViewById(R.id.plansub);
ArrayAdapter adapter3 = ArrayAdapter.createFromResource(
getActivity(), R.array.health_plans, android.R.layout.simple_spinner_item);
adapter3.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner2.setAdapter(adapter3);
spinner = (Spinner) getActivity().findViewById(R.id.plan);
ArrayAdapter adapter = ArrayAdapter.createFromResource(
getActivity(), R.array.main_list, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setSelection(0);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
int ip = spinner.getSelectedItemPosition();
spinner2.setVisibility(View.VISIBLE);
if(ip==0){
adapter2= ArrayAdapter.createFromResource(
getActivity(), R.array.health_plans, android.R.layout.simple_spinner_item);
}
if(ip==1){
adapter2 = ArrayAdapter.createFromResource(
getActivity(), R.array.endowment_plans,
android.R.layout.simple_spinner_item);
}
if(ip==2){
adapter2 = ArrayAdapter.createFromResource(
getActivity(), R.array.term_plans, android.R.layout.simple_spinner_item);
}
if(ip==3){
adapter2 = ArrayAdapter.createFromResource(
getActivity(), R.array.pension_plans,
android.R.layout.simple_spinner_item);
}
if(ip==4){
adapter2 = ArrayAdapter.createFromResource(
getActivity(), R.array.life_Plan, android.R.layout.simple_spinner_item);
}
adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner2.setAdapter(adapter2);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
spinner2.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
planval=adapterView.getItemAtPosition(i).toString();
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
});
b5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String termval = term.getText().toString();
String cnameval = cname.getText().toString();
String ageval = age.getText().toString();
String policyNumberval = policyNumber.getText().toString();
String sumassval = sumass.getText().toString();
String dobval = dob.getText().toString();
String mobval = mob.getText().toString();
String addval = add.getText().toString();
String commence2 = commence.getText().toString();
if (TextUtils.isEmpty(cnameval)) {
Toast.makeText(getActivity(), "Enter Name!", Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(ageval)) {
Toast.makeText(getActivity(), "Enter Age!", Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(sumassval)) {
Toast.makeText(getActivity(), "Enter Amount!",
Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(termval)) {
Toast.makeText(getActivity(), "Enter Term!", Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(policyNumberval)) {
Toast.makeText(getActivity(), "Enter PolicyNumber!",
Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(dobval)) {
Toast.makeText(getActivity(), "Enter DOB!", Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(mobval)) {
Toast.makeText(getActivity(), "Enter Mobile No!",
Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(addval)) {
Toast.makeText(getActivity(), "Enter Address!",
Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(commence2)) {
Toast.makeText(getActivity(), "Enter Commencedate!",
Toast.LENGTH_SHORT).show();
return;
}
if (!(Integer.parseInt(ageval)>20 && Integer.parseInt(ageval)<60)){
Toast.makeText(getActivity(), "Invalid Age!", Toast.LENGTH_SHORT).show();
}
if (!(Integer.parseInt(sumassval)>5000 &&
Integer.parseInt(sumassval)<1500000)){
Toast.makeText(getActivity(), "Invalid Amount!",
Toast.LENGTH_SHORT).show();
}
if (!(Integer.parseInt(termval)>2 && Integer.parseInt(termval)<20)){
Toast.makeText(getActivity(), "Invalid Term!",
Toast.LENGTH_SHORT).show();
}
if (!(policyNumber.length()==8)) {
Toast.makeText(getActivity(), "Invalid PolicyNumber!",
Toast.LENGTH_SHORT).show();
return;
}
if (!(mobval.length()==10)) {
Toast.makeText(getActivity(), "Invalid Mobile no!",
Toast.LENGTH_SHORT).show();
return;
}
if (policyNumber.length()==8 && Integer.parseInt(sumassval)>5000 &&
Integer.parseInt(sumassval)<1500000 && Integer.parseInt(ageval)>20 &&
Integer.parseInt(ageval)<60 && Integer.parseInt(termval)>2 &&
Integer.parseInt(termval)<20)
{
dbr = FirebaseDatabase.getInstance().getReference();
DatabaseReference childref = dbr.child("policies");
HashMap<String, Object> result = new HashMap<>();
result.put("1) Name:",cnameval);
result.put("2) Age:",ageval);
result.put("3) Plan:",planval);
result.put("4) Term:",termval);
result.put("5) Amount:",sumassval);
result.put("6) DOB:",dobval);
result.put("7) Mobile:",mobval);
result.put("8) Address:",addval);
result.put("9) CommenceDate:",commence2);
childref.child(policyNumberval).updateChildren(result);
Toast.makeText(getActivity(), "Data send successfully",
Toast.LENGTH_SHORT).show();
term.setText("");
cname.setText("");
sumass.setText("");
policyNumber.setText("");
age.setText("");
commence.setText("");
dob.setText("");
mob.setText("");
add.setText("");
}
}
});
}
}
SecondFragment.java –
package com.example.abhishek.policyhandler;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
getFragmentManager().beginTransaction().replace(R.id.content_frame,seventhFragment).co
mmit();
ed8.setText("");
}
else {
Toast.makeText(getActivity(), "Data not available",
Toast.LENGTH_SHORT).show();
}}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
});
b5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
deletePolicy();
}
});
}
public void deletePolicy() {
String get = ed8.getText().toString();
if (get.length()==8){
myref = FirebaseDatabase.getInstance().getReference();
DatabaseReference childref = myref.child("policies");
childref = childref.child(get);
childref.removeValue();
Toast.makeText(getActivity(), "Policy Deleted", Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(getActivity(), "Enter Policy Number",
Toast.LENGTH_SHORT).show();
return;
}
}
}
ThirdFragment.java –
package com.example.abhishek.policyhandler;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
FourthFragment.java –
package com.example.abhishek.policyhandler;
import android.app.Fragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import java.util.HashMap;
b8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dbr = FirebaseDatabase.getInstance().getReference();
DatabaseReference childref = dbr.child("users");
childref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for(DataSnapshot d:dataSnapshot.getChildren()){
out+=d.getKey()+"\t\t\t\t"+d.getValue()+"\n";
}
if(!TextUtils.isEmpty(out)){
Bundle args = new Bundle();
args.putString("param",out);
Fragment eightFragment = new EightFragment();
eightFragment.setArguments(args);
getFragmentManager().beginTransaction().replace(R.id.content_frame,eightFragment).comm
it();
}
else {
Toast.makeText(getActivity(), "Data not available",
Toast.LENGTH_SHORT).show();
}}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
});
}
}
SeventhFragment.java –
package com.example.abhishek.policyhandler;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
LogoutFragment.java –
package com.example.abhishek.policyhandler;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.google.firebase.auth.FirebaseAuth;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
Bundle savedInstanceState) {
myview = inflater.inflate(R.layout.home_layout, container, false);
return myview;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getActivity().setTitle("Home");
alertsignout();
return;
}
public void alertsignout() {
AlertDialog.Builder alertDialog2 = new AlertDialog.Builder(getActivity());
alertDialog2.setTitle("Confirm SignOut");
alertDialog2.setMessage("Are you sure you want to Signout?");
alertDialog2.setPositiveButton("YES",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// Write your code here to execute after dialog
FirebaseAuth.getInstance().signOut();
Intent i = new Intent(getActivity(), MainActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
}
});
alertDialog2.setNegativeButton("NO",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getActivity(), "Logout Failed",
Toast.LENGTH_SHORT).show();
dialog.cancel();
}
});
alertDialog2.show();
}
}
activity_main.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.abhishek.policyhandler.MainActivity">
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="160dp"
android:layout_y="73dp"
android:cursorVisible="true"
android:ems="10"
android:hint="Email"
android:inputType="textEmailAddress"
tools:layout_editor_absoluteX="84dp"
tools:layout_editor_absoluteY="65dp" />
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="159dp"
android:layout_y="156dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
android:textColorLink="@color/colorPrimary"
tools:layout_editor_absoluteX="84dp"
tools:layout_editor_absoluteY="153dp" />
<Button
android:id="@+id/button2"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_x="89dp"
android:layout_y="266dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="Login"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default"
tools:layout_editor_absoluteX="148dp"
tools:layout_editor_absoluteY="252dp" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="69dp"
android:layout_y="363dp"
android:text="Not Yet Registered! Create Account"
android:textAllCaps="false"
android:textColor="@color/colorAccent"
android:textSize="18sp"
tools:layout_editor_absoluteX="81dp"
tools:layout_editor_absoluteY="319dp" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="51dp"
android:layout_x="41dp"
android:layout_y="83dp"
android:text="Username:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="100dp" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="47dp"
android:layout_x="42dp"
android:layout_y="169dp"
android:text="Password:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="38dp"
tools:layout_editor_absoluteY="167dp" />
</AbsoluteLayout>
activity_main2.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.abhishek.policyhandler.Main2Activity">
<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="161dp"
android:layout_y="94dp"
android:ems="10"
android:hint="Email"
android:inputType="textEmailAddress"
tools:layout_editor_absoluteX="84dp"
tools:layout_editor_absoluteY="40dp" />
<EditText
android:id="@+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="160dp"
android:layout_y="182dp"
android:ems="10"
android:hint="Password"
android:inputType="textPassword"
tools:layout_editor_absoluteX="111dp"
tools:layout_editor_absoluteY="161dp" />
<EditText
android:id="@+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="160dp"
android:layout_y="273dp"
android:ems="10"
android:hint="Retype Password"
android:inputType="textPassword"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="174dp" />
<Button
android:id="@+id/button3"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_x="91dp"
android:layout_y="372dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="Sign Up"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default"
tools:layout_editor_absoluteX="56dp"
tools:layout_editor_absoluteY="270dp" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="41dp"
android:layout_x="48dp"
android:layout_y="105dp"
android:text="Username:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="45dp"
tools:layout_editor_absoluteY="104dp" />
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_x="50dp"
android:layout_y="189dp"
android:text="Password:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="61dp"
tools:layout_editor_absoluteY="200dp" />
<TextView
android:id="@+id/textView10"
android:layout_width="98dp"
android:layout_height="71dp"
android:layout_x="50dp"
android:layout_y="264dp"
android:text="Confirm Password:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="63dp"
tools:layout_editor_absoluteY="278dp" />
</AbsoluteLayout>
activity_main3.xml –
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main3"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main3"
app:menu="@menu/activity_main3_drawer" />
</android.support.v4.widget.DrawerLayout>
app_bar_main3.xml –
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.abhishek.policyhandler.Main3Activity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main3" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="69dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
content_main3.xml –
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.abhishek.policyhandler.Main3Activity"
tools:showIn="@layout/app_bar_main3">
</FrameLayout>
first_layout.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
<EditText
android:id="@+id/cname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText6"
android:layout_alignStart="@+id/editText6"
android:layout_marginTop="21dp"
android:layout_x="18dp"
android:layout_y="11dp"
android:ems="10"
android:hint="Customer Name"
android:inputType="textPersonName" />
<EditText
android:id="@+id/age"
android:layout_width="109dp"
android:layout_height="wrap_content"
android:layout_x="262dp"
android:layout_y="12dp"
android:ems="10"
android:hint="Age"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="71dp" />
<Spinner
android:id="@+id/plan"
android:layout_width="210dp"
android:layout_height="43dp"
android:layout_x="20dp"
android:layout_y="67dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="178dp" />
<EditText
android:id="@+id/sumass"
android:layout_width="199dp"
android:layout_height="wrap_content"
android:layout_x="22dp"
android:layout_y="180dp"
android:ems="10"
android:hint="Sum Assured"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="44dp"
tools:layout_editor_absoluteY="250dp" />
<EditText
android:id="@+id/term"
android:layout_width="108dp"
android:layout_height="wrap_content"
android:layout_x="266dp"
android:layout_y="178dp"
android:ems="10"
android:hint="Term"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="26dp"
tools:layout_editor_absoluteY="315dp" />
<EditText
android:id="@+id/policyNumber"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_x="24dp"
android:layout_y="237dp"
android:ems="10"
android:hint="Policy Number"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="50dp"
tools:layout_editor_absoluteY="368dp" />
<Button
android:id="@+id/button5"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_x="89dp"
android:layout_y="528dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="Submit"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default"
tools:layout_editor_absoluteX="115dp"
tools:layout_editor_absoluteY="429dp" />
<Spinner
android:id="@+id/plansub"
android:layout_width="354dp"
android:layout_height="46dp"
android:layout_x="20dp"
android:layout_y="121dp"
android:visibility="invisible"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="196dp" />
<EditText
android:id="@+id/commence"
android:layout_width="322dp"
android:layout_height="wrap_content"
android:layout_x="27dp"
android:layout_y="468dp"
android:ems="10"
android:hint="Commencement Date(DD/MM/YYYY))"
android:inputType="date"
tools:layout_editor_absoluteX="159dp"
tools:layout_editor_absoluteY="280dp" />
<EditText
android:id="@+id/dob"
android:layout_width="201dp"
android:layout_height="wrap_content"
android:layout_x="25dp"
android:layout_y="295dp"
android:ems="10"
android:hint="DateOfBirth"
android:inputType="date"
tools:layout_editor_absoluteX="25dp"
tools:layout_editor_absoluteY="292dp" />
<EditText
android:id="@+id/mob"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_x="26dp"
android:layout_y="354dp"
android:ems="10"
android:hint="Mobile No"
android:inputType="number"
tools:layout_editor_absoluteX="28dp"
tools:layout_editor_absoluteY="356dp" />
<EditText
android:id="@+id/add"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_x="27dp"
android:layout_y="411dp"
android:ems="10"
android:gravity="start|top"
android:hint="Address"
android:inputType="textPostalAddress"
android:nestedScrollingEnabled="false"
android:scrollbars="vertical"
android:singleLine="true"
tools:layout_editor_absoluteX="28dp"
tools:layout_editor_absoluteY="411dp" />
</AbsoluteLayout>
second_layout.xml –
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<Button
android:id="@+id/button6"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="false"
android:layout_below="@+id/editText8"
android:layout_alignStart="@+id/editText8"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_marginStart="2dp"
android:layout_marginLeft="198dp"
android:layout_marginTop="109dp"
android:layout_marginRight="98dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="Delete"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default" />
<EditText
android:id="@+id/editText8"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_below="@+id/textView2"
android:layout_alignParentStart="true"
android:layout_marginStart="57dp"
android:layout_marginTop="60dp"
android:ems="10"
android:hint="Policy Number"
android:inputType="textPersonName"
android:textAlignment="viewStart" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/editText8"
android:layout_alignParentTop="true"
android:layout_marginStart="2dp"
android:layout_marginTop="111dp"
android:text="Search Policy Details"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="18sp"
android:textStyle="bold" />
<Button
android:id="@+id/button4"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_below="@+id/editText8"
android:layout_alignStart="@+id/editText8"
android:layout_marginStart="1dp"
android:layout_marginTop="46dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="Search"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default" />
</RelativeLayout>
third_layout.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
</AbsoluteLayout>
fourth_layout.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
<EditText
android:id="@+id/editText7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="152dp"
android:layout_y="110dp"
android:ems="10"
android:hint="Name"
android:inputType="textPersonName"
tools:layout_editor_absoluteX="78dp"
tools:layout_editor_absoluteY="27dp" />
<EditText
android:id="@+id/editText9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="152dp"
android:layout_y="178dp"
android:ems="10"
android:hint="D.O.B"
android:inputType="date"
tools:layout_editor_absoluteX="12dp"
tools:layout_editor_absoluteY="96dp" />
<EditText
android:id="@+id/editText10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="152dp"
android:layout_y="252dp"
android:ems="10"
android:hint="Address"
android:inputType="textPostalAddress"
tools:layout_editor_absoluteX="27dp"
tools:layout_editor_absoluteY="191dp" />
<Button
android:id="@+id/button16"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_x="89dp"
android:layout_y="350dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="Update Profile"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default"
tools:layout_editor_absoluteX="124dp"
tools:layout_editor_absoluteY="353dp" />
<TextView
android:id="@+id/textView5"
android:layout_width="210dp"
android:layout_height="47dp"
android:layout_x="149dp"
android:layout_y="53dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
tools:layout_editor_absoluteX="80dp"
tools:layout_editor_absoluteY="45dp" />
<TextView
android:id="@+id/textView11"
android:layout_width="75dp"
android:layout_height="37dp"
android:layout_x="74dp"
android:layout_y="121dp"
android:text="Name:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="45dp"
tools:layout_editor_absoluteY="131dp" />
<TextView
android:id="@+id/textView12"
android:layout_width="71dp"
android:layout_height="38dp"
android:layout_x="78dp"
android:layout_y="190dp"
android:text="D.O.B:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="173dp" />
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_x="54dp"
android:layout_y="263dp"
android:text="Address:"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="22dp"
tools:layout_editor_absoluteY="263dp" />
<Button
android:id="@+id/button7"
android:layout_width="216dp"
android:layout_height="wrap_content"
android:layout_x="89dp"
android:layout_y="412dp"
android:background="@color/colorAccent"
android:ellipsize="start"
android:text="View Details"
android:textAlignment="center"
android:textColor="@color/common_google_signin_btn_text_dark_default" />
<TextView
android:id="@+id/textView14"
android:layout_width="43dp"
android:layout_height="51dp"
android:layout_x="98dp"
android:layout_y="51dp"
android:text="User:"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="@color/colorAccent"
android:textSize="18sp"
tools:layout_editor_absoluteX="54dp"
tools:layout_editor_absoluteY="67dp" />
</AbsoluteLayout>
home_layout.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_x="4dp"
android:layout_y="56dp"
app:srcCompat="@mipmap/lic"
tools:layout_editor_absoluteX="156dp"
tools:layout_editor_absoluteY="19dp" />
<TextView
android:id="@+id/textView4"
android:layout_width="294dp"
android:layout_height="47dp"
android:layout_x="7dp"
android:layout_y="6dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
tools:layout_editor_absoluteX="41dp"
tools:layout_editor_absoluteY="0dp" />
</AbsoluteLayout>
nav_header_main3.xml –
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
app:srcCompat="@mipmap/ic_launcher_round" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="Life Insurance Corporation"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="life_insurance@india.com" />
</LinearLayout>
seventh_layout.xml –
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
android:id="@+id/textView3"
android:layout_width="353dp"
android:layout_height="473dp"
android:layout_x="14dp"
android:layout_y="11dp"
android:textAlignment="textStart"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/colorAccent"
android:textSize="20sp"
android:textStyle="bold"
tools:layout_editor_absoluteX="47dp"
tools:layout_editor_absoluteY="53dp" />
</AbsoluteLayout>
activity_main3_drawer.xml –
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_profile_layout"
android:icon="@drawable/ic_menu_manage"
android:title="Update Profile" />
<item
android:id="@+id/nav_first_layout"
android:icon="@drawable/ic_menu_camera"
android:title="Add policy" />
<item
android:id="@+id/nav_second_layout"
android:icon="@drawable/ic_menu_gallery"
android:title="Policy Search" />
<item
android:id="@+id/nav_third_layout"
android:icon="@drawable/ic_menu_slideshow"
android:title="View dues" />
<item
android:id="@+id/nav_logout_layout"
android:icon="@drawable/ic_menu_manage"
android:title="Logout" />
</group>
</menu>
main3.xml –
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"></menu>
colors.xml –
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#605DBB</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#409CFF</color>
</resources>
dimens.xml –
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
strings.xml –
<resources>
<string name="app_name">PolicyHandler</string>
<string name="title_activity_main3">Main3Activity</string>
<string-array name="main_list">
<item>Health Plans</item>
<item>Endowment Plans</item>
<item>Term Plans</item>
<item>Pension Plans</item>
<item>Life Plans</item>
</string-array>
<string-array name="health_plans">
<item>1 . LIC Jeevan Arogya</item>
<item>2 . LIC Cancer Cover Plan</item>
</string-array>
<string-array name="endowment_plans">
<item>1 . LIC New Jeevan Anand</item>
<item>2 . LIC New Bima Bachat</item>
<item>3 . LIC Single Premium Endowment Plan</item>
<item>4 . LIC New Money Back Plan</item>
<item>5 . LIC Jeevan Rakshak</item>
<item>6 . LIC New Children Money Back Plan</item>
</string-array>
<string-array name="term_plans">
<item>1 . LIC Anmol Jeevan 2</item>
<item>2 . LIC Amulya Jeevan 2</item>
<item>3 . LIC Pradhan Mantri Vaya Vandana Yojna</item>
</string-array>
<string-array name="pension_plans">
<item>1 . LIC Jeevan Akshay VI</item>
<item>2 . LIC New Jeevan Nidhi</item>
<item>3 . LIC eTerm</item>
</string-array>
<string-array name="life_Plan">
<item>1 . LIC Jeevan Umang</item>
</string-array>
<string name="action_settings">Settings</string>
</resources>
styles.xml –
<resources>
<string name="minimum_password">Password too short, enter minimum 6
characters!</string>
<string name="auth_failed">Authentication failed, check your email and password or sign
up</string>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay"
parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Screen Layouts and Report Layouts
Future Enhancements
This system can be further used as a tool for the agent to calculate their monthly profit
based on their insurance sales. It will be a tool for report generation for the agents. The
generation of report can let the agents understand their business situations such as what type of
policies are most popular. The agents analyse the information and make some improvements
in their insurance business strategy.
The system may further updated or modified at will owing to its simple structure. We
can further add a transaction entity which will look after the payments made by the customer
towards their policy. Depending on future requirements moreo changes can be made owing to
the organisations need.
Bibliography
https://www.youtube.com/watch?v=lBOD1rj9AnI
https://stackoverflow.com/
Firebase Connection
https://firebase.google.com/docs/auth?authuser=0
https://www.simplifiedcoding.net/firebase-realtime-database-crud/
Send Notifications
https://www.youtube.com/watch?v=NdtE_1u0cq4&feature=youtu.be