You are on page 1of 49

Content

TITLE Page No.


INTRODUCTION

CHAPTER-I

MOTIVATION & AIM

FEASIBILITY

SCOPE

FEATURES

SOFTWARE REQUIRED

HARDWARE REQUIRED

TOOL DESCRIPTION

ER + DFD’s

CHAPTER-II(Coding)

CONCLUSION

BIBLIOGRAPHY

1
INTRODUCTION

The online Medicine ordering service is a local Pharmistical and Medical


cooperative application for customer to provide more interactive Menu so that the
ordering process could be carried out. Ordering Medicine online is design for its
more flexibility and performance, some website is make sure that the system has
enough navigation function through the picture information or significant logo to
guide customer like students follow the steps to finish the ordering Medicine
process, apart from that it has been constructed to dealing with large number of
orders simultaneously to prevent the Medicine overload. Basically, this online
ordering project illustrate how to supervise for good performance and better service
for the users. Some businesses are highly engaged an online technology aiming for
a high production, and also to become more competitive in the world of business.
There were countless pharmacies and workers across the country that faces the
agonizing choice between forfeiting their income and risking their health to keep
people fed. This system is created to assist people to send medicines from a
particular location to another area.

It’s a choice that implicates people on the receiving end. Experts generally agree
that delivery and curbside pickup are safer for patients than going into a pharmacy
or store. Most delivery workers would also prefer that people keep ordering. It’s
essential for these workers to be able to survive. Our industry is definitely worried
about people’s safety, including their own, but they’re also worried about survival
and feeding their kids. Many people especially senior citizens, lactating mother and
PWD’s who couldn’t leave their homes relied on these services to get access to buy
medicines. The advent of dedicated delivery research companies that significant
advances in drug delivery technology were made. The recognition that specific
research had to be undertaken in order to overcome the problems of conventional
drug delivery led to the evolution of modern-day pharmaceutical science and
technology. A drug delivery system could deliver the correct amount of drug to the
site of action at the correct rate and timing, in order to maximize the desired

2
therapeutic response. Specialized drug delivery systems constitute a relatively
recent addition to the field of pharmaceutical technology.

Motivation
The motivation for designing this app came because my family is involved in the
medical business and I personally do not like waiting for long in the store or to
have to call store to place an order especially during the peak any events and
function every time. Moreover, I value recent learning about the Java Programming
languages as well as seeing how powerful and dynamic they are when it comes to
website designing and apps. The language used to build this website is HTMLand
CSS as client facing Where as mysql and java at the back-end because I found them
to be extremely useful while working on the technologies.

FEASIBILITY ANALYSIS
Whatever we think need not be feasible. It is wise to think about the feasibilities of
any problem we undertake. Feasibilities is the study of impact, which happen in the
organization by the development of the system. The impact can be either positive
or negative. When the positive nominate the negative, then the system is considered
feasible. Here the feasibility study can be perform to ways such as technical
feasibility and economic feasibility.

TECHNICAL FEASIBILITY
We can strongly say that it is technically feasible, since there will not be much
difficulty in getting required the resources for the development and maintaining the
system as well. All the resources for the development of the software as well as
maintenance of the same is available in the organization hare we are utilizing the
resources which are available already.

3
ECONOMICAL FEASIBILITY
Spend much money f Development of this application is highly online food
ordering feasible. The organization needed not or the development of the system
already available. The only think is to be done is making an environment for the
development with an effective supervision. If we are doing so, we can attain the
maximum usability of the corresponding resources. Even after the development, the
organization will not be in condition to invest more in the online food ordering .
Therefore, the system is economically feasible.

General Objectives
To develop Pharmaceutical delivery system using web applications which will help
the company manage their medicine delivery ordering system.

Specific Objectives

To develop a system with following features:

 Administration ensures an organization’s activities run smoothly and efficiently.


The primary goals of an administration are to direct, control and supervise the
support services of the organization to facilitate its success. The manager achieves
this goal by ensuring free flow of communication and efficient use of resources
throughout the organization. Delivery Rider communicates to the Admin that
understands the

 Principles associated with customer service and have knowledge regarding the
medicine and pharmacies. Maintain records and billing statements regarding the
product based on cash on hand of every rider and inspect supplies and carry out a
number of other tasks. Customer inquiries can give a lot of valuable insight to
ensure

4
 Customer satisfaction manipulation of orders to the customers be so easy and
quick by just clicking on the menu and choosing the desired item. Management
reports aim at informing managers of different aspects of the timely, clear,
relevant, and easily-accessed and has the capability of running automated reports.

Scope and Limitation


The researchers focused on the development of the Medicine Delivery System
during the Second Semester of Academic Year 2020-2021 at Carlos Hilado
Memorial State College – Binalbagan. The function what the system do is to home
delivery, search medicine delivery, update effectively, delete, and edit medicine
delivery information. It generates report on medicine delivery; prepare bills, gives
navigation and information for company.

The Medicine delivery system is password protected and controlled only by the
administrator. The system is available based on the needs of user, can work
properly, and do transactions efficiently including safe data management of the
delivery system. The system will cater two towns and one city in Negros namely;
Hinigaran, Binalbagan and Himamaylan City.

Each town or city there will be number of riders assigned. The delivery fee may
vary to certain barangays of every town or city. There are restricted areas that are
not system supported. The company provides daily budget for the riders and at the
end of the day the riders will remit the exact amount of all transactions that was
made in a day aside from the maintaining budget of the rider in hand for the next
day. The admin will be the one to dispatch rider and will manually approved the
online registration of the customer through call to prevent these scams or cancels
orders that might be a waste of the riders’ time and effort, it also hurts financially.
Bogus buyer account will be banned in the system the next time they will order
again. The company has an agreement with the pharmacies if the rider is directed to
a bogus buyer or location to deliver the medicine and the buyer never shows up the
items will be returned to the pharmacy. This system is strictly no cancellation of
orders. The rider will pay for the product, and meet up with him or her at a
specified location stated in their account. Rider will be responsible for the day to
day delivery of jobs assigned to him. The system doesn’t require a necessary
5
authorization forms from the patients on the prescription. This allows the pharmacy
to help get the process started, potentially shortening the wait time for the patients
to place an order via online. Online sending of prescription, the patients will upload
an image of prescription and identification card attached for verification. The
senior citizens in the Philippines can enjoy discounts and freebies for any medicine
purchased however, Senior Citizen’s booklet is not important. The system support
online transaction and as a means of security, the service allows for cash on
delivery (COD) to cater to customers without a credit card or electronic payment
system it does not support scanner tracking of products for their prices and foreign
currency. Riders in in all weathers and adverse road conditions, always in a hurry
to fulfill the assignment on time both sectors are at risk of being involved in road
traffic accidents, and are exposed to pollution. Salary paid of riders is based on
70% that will be get from delivery fee for the total transaction in every 15th and
30th of the month and 30% for the company.

Significance of the study

Medicine delivery management has its own significance to the company. Using this
system help to records all transaction made at the daily sales, it helps to recognize
all customers, employees etc. It manage all activities around the delivery that
increases productivity and minimize the risk of getting loss because all transaction
recorded to the system and viewed id needed and the whole reports of the business
will be shown at any time needed to be done.

This study is significance to the following:


Admin/ Manager This study will help the admin to match clients to riders
according to the order in which clients ordered online and the proximity of vehicles
to each client’s pick-up location. This allows for more flexible management of the

6
workers out in the field as a job can be dispatched to multiple users to accept or
reject the job.

Patients
This study will help the customer save time in spending extra time in service
interaction in the pharmacy. This translates into cost and time-saving for the
practice and improved care delivery.

Employee/ Rider
This study will help the employee trace customer and speeding process of orders
and delivery.

Researcher
The developed system will enhance and deepen our knowledge in programming
and system development. This will improve our skills in analyzing and solving
problems which may we apply in the real world.

Future Researcher
The developed systems will benefit the future researcher by making this as their
future reference in conducting similar studies.

Definition of Terms
For the clarification of the common understanding, the key word that has been used
in this study will be defined as follows:

7
System is a set of things working together as parts of a mechanism or an
interconnecting network. Operationally, is representing for monitoring of stock
inventory and cashiering of sales in online medicine delivery System.

Receipt is a document acknowledging that a person has received money or


property in payment following a sale or other transfer of goods or provision of a
service. All receipts must have the date of purchase on them. Operationally, receipt
form web app to generate new service invoices that include delivery information,
create an itemized list of the goods delivered with total amount and delivery
charge.

Medicine the science or practice of the diagnosis, treatment, and prevention of


disease. Operationally, medicine ordered online through web app delivered by rider
assigned. Report is a computer program whose purpose is take data from a source
such as a database, XML stream or a spreadsheet, and use it to produce a document
in a format with satisfies a particular human readership. Operationally, displays the
list of customer transactions with the respective invoice.

SMS Notification are text messages that are sent when an event occurs. An event,
in this case, can refer to something as exciting as an app update to something as
urgent as a whether alert. SMS stand for “Short Message Service.” SMS
Notification are sent the same way as any other text message. Operationally,
Admin will notify the customer via SMS that the medicine is ready to deliver

8
FEATURES

• Product and Component based

• Creating and changing issue at ease

• User accounts to control the access and maintain security

• Attachments and additional comments for more information

• Robust database backend

• Reporting & Charting in more comprehensive way

• Accuracy in work

• Easy and fast retrieval of information

• Well-designed reports

• Access of any information individually

• Work become very speedy

• Easy to update information

9
ANALYSIS

The medicine ordering system administrator is the super user and has complete
control over all the activities that can be performed.

The Application notifies the administrator of all medicine creation requests and
then administrator can approve or reject them. The administrator also manages the
list of available recipes categories. The administrator can also view and delete
entries in the guestbook.

SOFTWARE AND HARDWARE REQUIREMENTS

FRONT- END: - XML,Android Design Tools

BACK-END: - FireBase SQL, Java.

SOFTWARE REQUIREMENTS

Android Studio Version-4.0

Web Browser – chrome and fire-fox etc.

OS – windows- based system(windows 8 and above version)

Android App is Applicable for Android Version 5 and Above IDE – Dream viewer

10
HARDWARE REQUIREMENTS

RAM – Min 4 GB

Hard disk – 20 GB

Processor – INTEL- PENTIUM 5

SCOPE

This Online Medicine Service project aimed at developing an Online Medicine


Ordering System which can be used in small places, and medium cities firstly and
then on a large scale. It is developed to help Pharmist to simplify their daily
operational and managerial task as well as improve the Service experience of
customers. And also helps Pharmist develop healthy customer relationships by
providing good services. The system enables staff to let update and make changes
to their medicine list information based on the orders placed and the orders
completed.

TOOL DESCRIPTION

Firebase Realtime
Database Store and sync data with our NoSQL cloud database. Data is synced
across all clients in realtime, and remains available when your app goes offline.
The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON
and synchronized in realtime to every connected client. When you build
crossplatform apps with our iOS, Android, and JavaScript SDKs, all of your clients
share one Realtime Database instance and automatically receive updates with the
newest data. The Firebase Realtime Database lets you build rich, collaborative
applications by allowing secure access to the database directly from client-side
code. Data is persisted locally, and even while offline, realtime events continue to
11
fire, giving the end user a responsive experience. When the device regains
connection, the Realtime Database synchronizes the local data changes with the
remote updates that occurred while the client was offline, merging any conflicts
automatically. The Realtime Database provides a flexible, expression-based rules
language, called Firebase Realtime Database Security Rules, to define how your
data should be structured and when data can be read from or written to. When
integrated with Firebase Authentication, developers can define who has access to
what data, and how they can access it.

Overview of FrontEnd

An important issue for the development of a project is the selection of suitable


front-end and back-end. When we decided to develop the project we went through
an extensive study to determine the most suitable platform that suits the needs of
the organization as well as helps in development of the project. The aspects of our
study included the following factors. Front-end selection:

1. It must have a graphical user interface that assists employees that are not from IT
background.

2.Scalability and extensibility.

3. Flexibility.

4. Robustness.

5. According to the organization requirement and the culture.

6. Must provide excellent reporting features with good printing support.

7. Platform independent.

8. Easy to debug and maintain.

9. Event driven programming facility.

12
10. Front end must support some popular backend like MySQL.

According to the above stated features we selected PHP and CSS as the front-end
for developing.

About Java:
Java is a general-purpose, class-based, object oriented programming language
designed for having lesser implementation dependencies. It is a computing platform
for application development. Java is fast, secure, and reliable, therefore. It is widely
used for developing Java applications in laptops, data centers, game consoles,
scientific supercomputers, cell phones etc.

Here are some important Java applications:

 It is used for developing Android Apps.

 Helps you to create Enterprise Software.

 Wide range of Mobile java Applications.

 Scientific Computing Applications.

 Use for BigData Analytics.

 Java Programming of Hardware devices.

 Used for Server-Side Technologies like Apache, J Boss, Glass Fish, etc.

Overview of Back-End Selection:

1. Multiple user support.

2. Efficient data handling.

3. Provide inherent features for security.

4. Efficient data retrieval and maintenance.

5. Stored procedures.

13
6. Popularity.

7. Operating System compatible.

8. Easy to install.

9. Various drivers must be available.

10. Easy to implant with the Front-end.

According to above stated features we selected MySQL as the backend. The


technical feasibility is frequently the most difficult area encountered at this stage. It
is essential that the process of analysis and definition be conducted in parallel with
an assessment to technical feasibility. It centers on the existing computer system
(hardware, software etc.) and to what extent it can support the proposed system

About SQL:
SQL is Structured Query Language, which is a computer language for storing,
manipulating and retrieving data stored in a relational database. SQL is the standard
language for Relational Database System. All the Relational Database Management
Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and
SQL Server use SQL as their standard database language. MySQL is a fast, easy-
touse RDBMS being used for many small and big businesses. MySQL is
developed, marketed and supported by MySQL AB, which is a Swemedicine
company. MySQL is becoming so popular because of many good reasons.

[1] MySQL is released under an open-source license. So you have nothing to pay
to use it.

[2] MySQL is a very powerful program in its own right. It handles a large subset
of the functionality of the most expensive and powerful database packages.

14
[3] MySQL uses a standard form of the well-known SQL data language. MySQL
works on many operating systems and with many languages including PHP, PERL,
C, C++, JAVA, etc.

[4] MySQL works very quickly and works well even with large data sets. MySQL
is very friendly to PHP, the most appreciated language for web development.

[5] MySQL supports large databases, up to 50 million rows or more in a table. The
default file size limit for a table is 4GB, but you can increase this (if your operating
system can handle it)to a theoretical limit of 8millionterabytes (TB). Also, they are
using different dialets such as− Oracle usingPL/SQL.

 SQL is widely popular because it offers the following advantages−

 Allow users to access data in the database management systems.

 Allow users to describe the data relation.

 Allow users to define the data in a database and manipulate that data.

Allow to embed within other languages using SQL modules, libraries &pre
compilers.

 Allow users to create and drop databases and tables.

 Allow users to create view, stored, procedure, functions in a database.

 Allow users to set permissions on tables, procedures and views.

[6] Android Studio is the official Integrated development environment (IDE) for
Google's Android operating system, built on JetBrain’s Intelli J IDEA software
and designed specifically for Android development.

15
[7] It is available for download on Windows, Mac OS and Linux based operating
systems or as a subscription-based service in 2020.

[8] It is a replacement for the Eclipse Android Development Tools (E ADT) as the
primary IDE for native Android application development. Android Studio was
announced on May 16, 2013 at the Google I/O conference.

[9] It was in early access preview stage starting from version 0.1 in May 2013,
then entered beta stage starting from version 0.8 which was released in June 2014.

[10] The first stable build was released in December 2014, starting from version
1.0.

[11] On May 7, 2019, Kotlin replaced Java as Google's preferred language for
Android app development.

[12] Java is still supported, as is C++. Features A specific feature of the Android
Studio is an absence of the possibility to switch auto save feature off.

[13] The following features are provided in the current stable version:

16
Gradle-based build support

 Android-specific refactoring and quick fixes

 Lint tools to catch performance, usability, version compatibility and other


problems

 Pro Guard integration and app-signing capabilities

 Template-based wizards to create common Android designs and components

 A rich layout editor that allows users to drag-and-drop UI components, option to

preview layouts on multiple screen configurations

 Support for building Android Wear apps

 Built-in support for Google Cloud Platform, enabling integration with Firebase

Cloud

 Messaging (Earlier 'Google Cloud Messaging') and Google App Engine

 Android Virtual Device (Emulator) to run and debug apps in the Android studio.

 Android Studio supports all the same programming languages of IntelliJ (and

CLion) e.g. Java, C++, and more with extensions, such as Go and Android Studio

3.0 or later supports Kotlin and "all Java 7 language features and a subset of Java

8 language features that vary by platform version. External projects back port

some Java 9 features. While IntelliJ states that Android Studio supports all

released Java versions, and Java 12, it's not clear to what level Android Studio

supports Java versions.

17
ER-DIAGRAM

“Entity Relationship MODEL”

Here, are prime reasons for using the ER Diagram

• Helps in definining terms related to entity relationship modeling.

• Provide a preview of how the tables should connect, what fields are going to be
on each table.

• Helps to describe entities, attributes, relationships.

• ER diagrams can be used by database designers as a blueprint for implementing


data in specific software applications.

• The database designer gains a better understanding of the information to be


contained in the database with the help of ERP diagram.

• ER Diagram allows us to communicate with the logical structure of the database


to users.

ER Diagrams contain different symbols that use rectangles to represent entities,


ovals to define attributes and diamond shapes to represent relationships.

18
19
“Data Flow Diagram”

A data flow diagram is a graphical view of how data is processed in a system in


terms of input and output. Data flow diagrams can be divided into logical and
physical.

The logical data flow diagram describes flow of data through a system to perform
certain functionality of a business.

The physical data flow diagram describes the implementation of the logical data
flow.

“WHY DFD”?

The visual representation makes it a good communication tool between User and
System designer. Structure of DFD allows starting from a broad overview and
expand it to a hierarchy of detailed diagrams.

The Data flow diagram (DFD) contains some symbol for drawing the data flow
diagram.

20
”Context level DFD – 0 level”

The context level data flow diagram (dfd) describes the whole system. The (0) level
dfd describes that all user module who operate the system.

Below data flow diagram of an android application shows the two users can operate
the system, one as Admin and the other as Member user.

21
“DFD – 1 st level”
ADMIN

22
”DFD – 2nd level”
ADMIN

23
“DFD- 1st LEVEL”
BUYER

24
“DFD-1ST LEVEL”
SELLER

25
“DFD-2nd LEVEL”
BUYER

26
“DFD-2nd LEVEL”
SELLER

27
Coding Parts Contains:

In the coding part of Online Medicine Service. We have many formats of files
and codes for Android App like:

 Manifest Files

 Source code in Java Files

 Layout Files

 Deployment Descriptor Files

 Gradle Build Files

 Apk Files

 Logs Files

 FireBase Files

 Assembles Files

 Firebase Connectivity File

 RealTime Database File

 Java BackEnds Files

 App Builder Gradles

28
CODING
Home Page:

package com.medicine_on.app;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.food_on.app.R;
import com.google.firebase.auth.FirebaseAuth;
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;

public class MainActivity extends AppCompatActivity


{
FirebaseAuth Fauth;
FirebaseDatabase firebaseDatabase;
DatabaseReference databaseReference;
ImageView imageVieww; TextView textView;
@Override

29
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

imageVieww=(ImageView)findViewById(R.id.imageView);
textView=(TextView)findViewById(R.id.textView7);
imageVieww.animate().alpha(0f).setDuration(0);
textView.animate().alpha(0f).setDuration(0);

imageVieww.animate().alpha(1f).setDuration(1000).setListener(new
AnimatorListenerAdapter()
{
@Override

public void onAnimationEnd(Animator animation) {


textView.animate().alpha(1f).setDuration(800);
}
});
new Handler().postDelayed(new Runnable()
{
@Override
public void run()
{
Fauth = FirebaseAuth.getInstance();
if (Fauth.getCurrentUser() != null)
{
if (Fauth.getCurrentUser().isEmailVerified()) {
Fauth = FirebaseAuth.getInstance(); databaseReference =
FirebaseDatabase.getInstance().getReference("User").child(
FirebaseAuth.getInstance().getUid() + "/Role");
databaseReference.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) { String role =


dataSnapshot.getValue(String.class);
if (role.equals("Customer")) {
Intent n = new Intent(MainActivity.this,
CustomerFoodPanel_BottomNavigation.class); startActivity(n); finish();
}
30
if (role.equals("pharmacist"))
{
Intent a = new Intent(MainActivity.this,
pharmacistPanel_BottomNavigation.class); startActivity(a); finish();
}

if (role.equals("DeliveryPerson")) { Intent intent = new Intent(MainActivity.this,


Delivery_FoodPanelBottomNavigation.class); startActivity(intent); finish();
}}

@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}

Update Code:

package com.food_on.app.PharmacistFoodPanel;

import androidx.annotation.NonNull;

import androidx.appcompat.app.AppCompatActivity;

import androidx.recyclerview.widget.LinearLayoutManager;

import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.food_on.app.R;

import com.google.firebase.auth.FirebaseAuth;

import com.google.firebase.database.DataSnapshot;

import com.google.firebase.database.DatabaseError;

import com.google.firebase.database.DatabaseReference;

import com.google.firebase.database.FirebaseDatabase;

31
import com.google.firebase.database.ValueEventListener ;

import java.6util.ArrayList;

import java.util.List;

public class Pharmacist_order_medicinees extends AppCompatActivity {

RecyclerView recyclerViewmedicine;

private List pharmacistPendingOrdersList;

private PharmacistOrderMedicineesAdapter adapter;

DatabaseReference reference;

String RandomUID;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState); 6

setContentView(R.layout.activity_pharmacist_order_medicinees);

recyclerViewmedicine = findViewById(R.id.Recycle_orders_medicine);

recyclerViewmedicine.setHasFixedSize(true);

recyclerViewmedicine.setLayoutManager
(new LinearLayoutManager(this));

pharmacistPendingOrdersList = new ArrayList<>();

Pharmacistordermedicinees(); }

private void Pharmacistordermedicinees() {

RandomUID = getIntent().getStringExtra("RandomUID");

reference = FirebaseDatabase.getInstance().getReference("PharmacistPending
Orders").child(FirebaseAuth.getInstance().getCurrentUser().

32
getUid()).child(RandomUID).child("Medicinees");
reference.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(

@NonNull DataSnapshot dataSnapshot) {

pharmacistPendingOrdersList.clear();

for (DataSnapshot snapshot : dataSnapshot.getChildren())

{ pharmacistPendingOrders pharmacistPendingOrders =
snapshot.getValue(PharmacistPendingOrders.class);
pharmacistPendingOrdersList.add(pharmacistPendingOrders); }

adapter = new
PharmacistOrderMedicineesAdapter(Pharmacist_order_medicinees.this,
pharmacistPendingOrdersList); recyclerViewmedicine.setAdapter(adapter); }

@Override

public void onCancelled(

@NonNull DatabaseError databaseError) { }

});

Verify phone:
package com.food_on.app;

import androidx.annotation.NonNull;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;

import android.os.Bundle;

33
import android.os.CountDownTimer;

import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.TextView;

import android.widget.Toast;

import com.food_on.app.R;

import com.food_on.app.ReusableCode.ReusableCodeForAll;

import com.google.android.gms.tasks.OnCompleteListener;

import com.google.android.gms.tasks.Task;

import com.google.android.gms.tasks.TaskExecutors;

import com.google.firebase.FirebaseException; import


com.google.firebase.auth.AuthResult;

import com.google.firebase.auth.FirebaseAuth;

import com.google.firebase.auth.PhoneAuthCredential;

import com.google.firebase.auth.PhoneAuthProvider; Resend = (Button)


findViewById(R.id.Resendcode); FAuth = FirebaseAuth.getInstance();

verify = (Button) findViewById(R.id.Verifycode);

Resend.setVisibility(View.INVISIBLE); txt.setVisibility(View.INVISIBLE);

verify.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

String code = entercode.getText().toString().trim();


Resend.setVisibility(View.INVISIBLE);

34
if (code.isEmpty() && code.length() < 6) {

entercode.setError("Enter code");

entercode.requestFocus(); return; }

verifyCode(code);

});

new CountDownTimer(60000, 1000) {

@Override

public void onTick(long millisUntilFinished) { txt.setVisibility(View.VISIBLE);

txt.setText("Resend Code within " + millisUntilFinished / 1000 + " Seconds"); }

@Override

public void onFinish() { Resend.setVisibility(View.VISIBLE);


txt.setVisibility(View.INVISIBLE);

} }.start();

Resend.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Resend.setVisibility(View.INVISIBLE); Resendotp(phonenumber);

new CountDownTimer(60000, 1000) {

@Override

public void onTick(long millisUntilFinished) { txt.setVisibility(View.VISIBLE);

txt.setText("Resend Code within " + millisUntilFinished / 1000 + " Seconds"); }

@Override

35
public void onFinish() { Resend.setVisibility(View.VISIBLE);
txt.setVisibility(View.INVISIBLE);

} }.start();

});

} private void Resendotp(String phonenumber) {


sendverificationcode(phonenumber); }

private void verifyCode(String code)

{ PhoneAuthCredential credential =
PhoneAuthProvider.getCredential(verificationId, code); linkCredential(credential);

private void linkCredential(PhoneAuthCredential credential) {


FAuth.getCurrentUser().linkWithCredential(credential)
.addOnCompleteListener(Delivery_VerifyPhone.this, new OnCompleteListener() {

@Override

public void onComplete(

@NonNull Task task) {

if (task.isSuccessful()

{ Intent intent = new Intent(Delivery_VerifyPhone.this, MainMenu.class);


startActivity(intent); finish(); }

else {

ReusableCodeForAll.ShowAlert(Delivery_VerifyPhone.this, "Error",
task.getException().getMessage());

}}

36
});

private void sendverificationcode(String number) {


PhoneAuthProvider.getInstance().verifyPhoneNumber( number, 60,
TimeUnit.SECONDS, TaskExecutors.MAIN_THREAD, mCallBack );

private

PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallBack = new


PhoneAuthProvider.OnVerificationStateChangedCallbacks() {

@Override

public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken


forceResendingToken) { super.onCodeSent(s, forceResendingToken);
verificationId = s; }

@Override

public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential)

{ String code = phoneAuthCredential.getSmsCode(); if (code != null) {


entercode.setText(code); verifyCode(code);

}}

@Override

public void onVerificationFailed(FirebaseException e) {


Toast.makeText(Delivery_VerifyPhone.this, e.getMessage(),
Toast.LENGTH_LONG).show();

} };

37
Payment coding:

package com.food_on.app.CustomermedicinePanel;

public class CustomerPaymentOrders

private String
pharmacistId,medicineId,medicineName,medicinePrice,medicineQuantity,Random
UID,TotalP rice,UserId; public CustomerPaymentOrders(String pharmacistId,
String medicineId, String medicineName, String medicinePrice, String
medicineQuantity, String randomUID, String totalPrice, String userId) {
PharmacistId = pharmacistId;

MedicineId = medicineId;

MedicineName = medicineName;

MedicinePrice = medicinePrice;

MedicineQuantity = medicineQuantity;

RandomUID = randomUID;

TotalPrice = totalPrice; UserId = userId; }

public CustomerPaymentOrders() { }

public String getpharmacistfId()

{ return PharmacistId; }

public void setPharmacistId(String pharmacistId) { PharmacistId = pharmacistId; }

public String getMedicineId() { return MedicineId; }

public void setMedicineId(String medicineId) { MedicineId = medicineId; }

public String getMedicineName() { return MedicineName; }

38
public void setMedicineName(String medicineName) { MedicineName =
medicineName; }

public String getMedicinePrice() { return MedicinePrice; }

public void setMedicinePrice(String medicinePrice) { MedicinePrice =


medicinePrice; }

public String getMedicineQuantity() { return MedicineQuantity; }

public void setMedicineQuantity(String medicineQuantity) { MedicineQuantity =


medicineQuantity; }

public String getRandomUID() { return RandomUID; }

public void setRandomUID(String randomUID) { RandomUID = randomUID; }

public String getTotalPrice() { return TotalPrice; }

public void setTotalPrice(String totalPrice) { TotalPrice = totalPrice; }

public String getUserId() { return UserId; } public void setUserId(String userId) {


UserId = userId; }

Pharmist:

package com.food_on.app;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;

import android.os.Bundle; import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.TextView;

39
import com.food_on.app.R;

import com.google.firebase.auth.FirebaseAuth;

import com.hbb20.CountryCodePicker; public class LoginPhone extends


AppCompatActivity

{ EditText num; TextView txtsignup; Button sendotp,signinemail;

CountryCodePicker cpp;

FirebaseAuth FAuth; String numberr;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_login_phone);

num=(EditText)findViewById(R.id.number);

sendotp=(Button)findViewById(R.id.otp);

cpp=(CountryCodePicker)findViewById(R.id.CountryCode);

signinemail=(Button)findViewById(R.id.btnEmail);

txtsignup=(TextView)findViewById(R.id.acsignup);

FAuth=FirebaseAuth.getInstance(); sendotp.setOnClickListener(new

View.OnClickListener() {

@Override

public void onClick(View v) {

numberr=num.getText().toString().trim();

String phonenumber= cpp.getSelectedCountryCodeWithPlus() + numberr;

40
Intent b=new Intent(LoginPhone.this,sendotp.class);
b.putExtra("phonenumber",phonenumber);

startActivity(b);

finish();

);

txtsignup.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) { Intent a=new

Intent(LoginPhone.this,Registeration.class);

startActivity(a); finish();

});

signinemail.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent em=new Intent(LoginPhone.this, Login.class);

startActivity(em); finish();

});

41
Customer code:
package com.food_on.app;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.TextView;

import com.food_on.app.R; import com.google.firebase.auth.FirebaseAuth;

import com.hbb20.CountryCodePicker; public class LoginPhone extends


AppCompatActivity {

EditText num; TextView txtsignup;

Button sendotp,signinemail;

CountryCodePicker cpp;

FirebaseAuth FAuth;

String numberr;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_log6in_phone);

num=(EditText)findViewById(R.id.number);

sendotp=(Button)findViewById(R.id.otp);

42
cpp=(CountryCodePicker)findViewById(R.id.CountryCode);

signinemail=(Button)findViewById(R.id.btnEmail);

txtsignup=(TextView)findViewById(R.id.acsignup);

FAuth=FirebaseAuth.getInstance(); sen66dotp.setOnClickListener(new

View.OnClickListener() {

@Override

public void onClick(View v) { numberr=num.getText().toString().trim();

String phonenumber= cpp.getSelectedCountryCodeWithPlus() + numberr;

Intent b=new Intent(LoginPhone.this,sendotp.class);

b.putExtra("phonenumber",phonenumber); startActivity(b);

finish();

});

txtsignup.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) { Intent a=new


Intent(LoginPhone.this,Registeration.class);

startActivity(a);

finish(); }

});

signinemail.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

43
Intent em=new Intent(LoginPhone.this, Login.class); startActivity(em); finish(); }

});

XML Layout Codes:

66Post Medicine:

<xml version="1.0" encoding="utf-8">

6androidx.constraintlayout.widget.ConstraintLayout
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.food_on.app.ChefFoodPanel.Chef_PostDish"

android:background="@drawable/pic14"

>

<Linear layout

android:id="@+id/linearLayout" android:layout_width="280dp"

android:layout_height="wrap_content" android:orientation="horizontal"

android:layout_marginTop="10dp"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

44
app:layout_constraintHorizontal_bias="0.496"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toTopOf="parent"

app:layout_constraintVertical_bias="0.312"

>

<Text view

android:id="@+id/textView" android:layout_width="wrap_content"

android:layout_height="30dp"

android:layout_marginLeft="5dp" android:text="Medicine Name"

android:textColor="@color/white"

android:textSize="18sp" app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.191"

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

app:layout_constraintVertical_bias="0.37" />

<Spinner

android:id="@+id/dishes" android:layout_width="162dp"
android:layout_height="30dp"

android:layout_marginLeft="12dp" android:entries="@array/DishName"

android:background="@color/white"

app:layout_constraintBottom_toBottomOf="parent"

45
app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toBottomOf="@+id/textView"

app:layout_constraintVertical_bias="0.04" />

46
Conclusion

While developing the system a conscious effort has been made to create and

develop a software package, making use of available tools, techniques and

resources -- that would generate a proper system for cases. While making the

system , an eye has been kept in making it as user- friendly. As such one may
hope

that the system will be acceptable to any user will adequately meet his/her
needs.

As in case of any system development process where there are a number of


short

comings, there have been some shortcomings in the development of this system

also.

47
Bibliography

This is reference page containing all the useful references used in the Online
Medicine Service ("MediCare").

Android studio 4.0

 RealTime Database Firebase

 XML

 Android Emulator for Realtime Running App

 Gradle Builds for Packages container

 Deployment Descriptor

 1)BootStrap-4 –>

href=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0 /css/bootstrap.min.css

2)Font-awesome link ->

https://cdnjs.cloudflare.com/ajax/libs/fontawesome/4.7.0/css/font-awesome.min.css

3)css-link ->

4)For documentation details-> "WWW.GOOGLE.COM" &


"WWW.WIKIPEDIA.COM" &

5:)JQUERY -> "https://code.jquery.com/jquery3.5.1.min.js"

6:)AJAX -> https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/

 umd/popper.min.js

HTML5

 CSS

 JAVASCRIPT

48
 AJAX

 JQUERY

 JAVA PROGRAMMING LANGUAGE

 JAVA SERVER PAGE(JSP)

 JAVA SERVLET(FOR SERVER SIDE SCRIPTING)

 FOR ICONS –

> FONT-AWESOME SITE

7) for database-

>MySQL database: www.mysql.com

8) for database connectivity with java using jdbcDriver –>

9) mysqlconnector.5.1.49.jar file for server using wammp

 server for running mysql command ->

www.wapmserver.com for

10) server ->

Glassfish server 4

11) java jdk -> jdk 1.8

12) java IDE Netbeans Integrated

 developementenvironment(IDE)

13) Tutorials using -> Javatpoint; javaswing tutorial .

49

You might also like