Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Grocery Shopping Application

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

Grocery Shopping Application

Mobile Application

Project Report

BS (CS)-2015

Instructor: Miss Kainat

Submitted by:

Anbreen Jahan

Juwairiah Saleem

Mahwish Naseem

Naveera Jamil

3-May-2018

DEPARTMENT OF COMPUTER SCIENCE & INFORMATION TECHNOLOGY

JINNAH UNIVERSITY FOR WOMEN


5-C NAZIMABAD, KARACHI-74600
Project Report: Grocery Shopping

ABSTRACT

An online Grocery Store permits a customer to submit online orders for items and/or services
from a store that serves both walk-in customers and online customers. The online Grocery Store
system presents an online display of all the items they want to sell. This application helps
customers to choose their daily needs and add products to their shopping cart. Customers provide
their complete detail of address and contact and they get their chosen products in their home.
This application saves lots of time of customers.

2
Project Report: Grocery Shopping

TABLE OF CONTENTS

ABSTRACT................................................................................................................................................2
INTRODUCTION.......................................................................................................................................3
SYSTEM ANALYSIS.................................................................................................................................3
PROJECT SCOPE:..................................................................................................................................3
FEATURES.............................................................................................................................................3
SYSTEM DESIGN......................................................................................................................................4
DATA DICTIONARY:.............................................................................................................................4
 Sign Up:.......................................................................................................................................4
 Log In:.........................................................................................................................................4
 Category:.....................................................................................................................................4
 Product:.......................................................................................................................................5
 Cart Details:.................................................................................................................................5
 Order............................................................................................................................................5
IMPLEMENTATION..................................................................................................................................6
DESCRIPTION CODE...........................................................................................................................6
SNIPPETS...........................................................................................................................................6
SCREEN SHOTS................................................................................................................................9
CONTRIBUTIONS...................................................................................................................................12
CONCLUSION.........................................................................................................................................12
FUTURE WORK......................................................................................................................................12
REFERENCES..........................................................................................................................................13

3
Project Report: Grocery Shopping

INTRODUCTION
A grocery shopping is an android application where users can purchase and order groceries
online. The system is developed with a user-friendly and attractive GUI. It delivers a wide range
of groceries available online. Users have to first login into the system to view the groceries and
add them into their cart. The system functionality of products and orders is stored on server side
in a Firebase. The android app is for client usage. It consists of client side scripting for placing
orders by connecting to the server side firebase.

4
Project Report: Grocery Shopping

SYSTEM ANALYSIS

PROJECT SCOPE:

This product has great future scope. This project also provides security with the use of Login-id
and Password, so that any unauthorized users cannot use your account. The only Authorized that
will have proper access authority can access the software. Small scale shopkeeper can enhance
their area. Buyer registers themselves and access. Multiple products available at one place to
one shop (Grocery Application. All the types of products available to buyer like dairy products,
vegetables etc.

FEATURES
 User details once login will be saved in the database for further use.
 User will select categories.
 User will select product listed in each category and add to the cart.
 User will be fill personal details e.g Name, Address, Number for home delivery. Payment
will be cash on delivery.

5
Project Report: Grocery Shopping

SYSTEM DESIGN

DATA DICTIONARY:

 Sign Up:

Field name Data type size Constraints Description


First name varchar 25 Primary key First name
Last name varchar 25 Not null Last name
Email varchar 25 Not null Email
Password varchar 25 Not null Password

 Log In:

Field name Data type size Constraints Description


Number Number 25 Not null Number
Password varchar 25 Not null Password

 Category:

Field name Data type Size Constraints Description


Category Id Varchar 6 Primary key Category id
Category name varchar 25 Not null Category name
Description varchar 30 Not null Description

6
Project Report: Grocery Shopping

 Product:

Field name Data type size Constraints Description


Product id varchar 10 Primary key Product id
Product name Varchar 30 Not null Product name
Image int 3 Not null Image
Price int 5 Not null Price
Description varchar 50 Not null Description

 Cart Details:

Field name Data type size Constraints Description


Cart ID varchar 6 Primary key Cart ID
User name varchar 12 Foreign key User name
Product ID varchar 13 Foreign key Product ID
Quantity per number 3 Not null Quantity per product
product
Unit price number 5 Unit price
Total Amount number 3 Total Amount
status varchar 50 status

 Order:
Field name Data type size Constraints Description
Order ID varchar 10 Primarykey Order ID
User ID varchar 10 Foreign key User ID
Address varchar 30 Not null Address
Amount int 6 Not null Amount

phone int 11 Not null phone

IMPLEMENTATION

7
Project Report: Grocery Shopping

CODE DESCRIPTION

SNIPPETS

 Cart Adapter.java
TextDrawable drawable = TextDrawable.builder()
.buildRound(""+listData.get(position).getQuantity(), Color.RED);
holder.img_cart_count.setImageDrawable(drawable);

Locale locale = new Locale("en","PK");


NumberFormatfmt = NumberFormat.getCurrencyInstance(locale);
int price =
(Integer.parseInt(listData.get(position).getPrice()))*(Integer.parseInt(listData
.get(position).getQuantity()));
holder.txt_price.setText(fmt.format(price));

holder.txt_cart_name.setText(listData.get(position).getProductName());

 Cart.java
private void showAlertDialog() {

AlertDialog.BuilderalertDialog = new AlertDialog.Builder(Cart.this);


alertDialog.setTitle("One more step!");
alertDialog.setMessage("Enter your address");

final EditTextedtAddress = new EditText(Cart.this);


LinearLayout.LayoutParamslp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
);

edtAddress.setLayoutParams(lp);
alertDialog.setView(edtAddress);
alertDialog.setIcon(R.drawable.ic_shopping_cart_black_24dp);

alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {


@Override
public void onClick(DialogInterfacedialogInterface, int i) {

Request request = new Request(


Common.currentUser.getPhone(),
Common.currentUser.getName(),
edtAddress.getText().toString(),
txtTotalPrice.getText().toString(),cart
);
requests.child(String.valueOf(System.currentTimeMillis()))
.setValue(request);

new Database(getBaseContext()).cleanCart();
Toast.makeText(Cart.this, "Thankyou,Your Order has been Placed",
Toast.LENGTH_SHORT).show();
finish();
}
});

 Home.java

8
Project Report: Grocery Shopping

adapter = new FirebaseRecyclerAdapter<Category,


MenuViewHolder>(Category.class,R.layout.menu_item,MenuViewHolder.class,category)
{
@Override
protected void populateViewHolder(MenuViewHolderviewHolder, Category model, int
position) {

viewHolder.txtMenuName.setText(model.getName());
Picasso.with(getBaseContext()).load(model.getImage())
.into(viewHolder.imageView);

final Category clickItem = model;


viewHolder.setItemClickListner(new ItemClickListener() {
@Override
public void onClick(View view, int position, booleanisLongClick) {
Intent foodList=new Intent(Home.this,FoodList.class);

foodList.putExtra("CategoryId",adapter.getRef(position).getKey());
startActivity(foodList);
}
});
}
};
recycler_menu.setAdapter(adapter);
}

 SignIn.java
 final FirebaseDatabase database=FirebaseDatabase.getInstance();
final DatabaseReferencetable_user=database.getReference("User");

btnSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

final ProgressDialogmDialog=new ProgressDialog(SignIn.this);


mDialog.setMessage("please waiting.....");
mDialog.show();
table_user.addValueEventListener(new ValueEventListener() {

@Override
public void onDataChange(DataSnapshotdataSnapshot) {
if (dataSnapshot.child(edtPhone.getText().toString()).exists()) {
mDialog.dismiss();
User user =
dataSnapshot.child(edtPhone.getText().toString()).getValue(User.class);

user.setPhone(edtPhone.getText().toString());
if (user.getpassword().equals(edtPassword.getText().toString())) {
Toast.makeText(SignIn.this, "Sign in successfully", Toast.LENGTH_SHORT).show();

Intent homeIntent = new Intent(SignIn.this,Home.class);


Common.currentUser= user;
startActivity(homeIntent);
finish();

} else {
Toast.makeText(SignIn.this, "sign in failed", Toast.LENGTH_SHORT).show();
}
}
else {
mDialog.dismiss();
Toast.makeText(SignIn.this,"user not exist in

9
Project Report: Grocery Shopping

database",Toast.LENGTH_SHORT).show();
}

}
 SignUp.java
final FirebaseDatabase database = FirebaseDatabase.getInstance();
final DatabaseReferencetable_user = database.getReference("User");

btnSignUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final ProgressDialogmDialog=new ProgressDialog(SignUp.this);
mDialog.setMessage("please waiting.....");
mDialog.show();

table_user.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshotdataSnapshot) {

if(dataSnapshot.child(edtPhone.getText().toString()).exists()){
mDialog.dismiss();
Toast.makeText(SignUp.this, "Phone Number Already
reigister",Toast.LENGTH_SHORT).show();
}
else
{
mDialog.dismiss();
User user = new
User(edtName.getText().toString(),edtPassword.getText().toString());
table_user.child(edtPhone.getText().toString()).setValue(user);
Toast.makeText(SignUp.this, "SignUP Successfully",Toast.LENGTH_SHORT).show();
finish();

}
}

SCREEN SHOTS

10
Project Report: Grocery Shopping

11
Project Report: Grocery Shopping

12
Project Report: Grocery Shopping

CONTRIBUTIONS

Designer: Naveera Jamil, Anbreen Jahan,

Developer: Mahwish Naseem ,Juwairiah Saleem

13
Project Report: Grocery Shopping

CONCLUSION

 Online shopping is the best way to purchase any item but be careful because there
may be some fake products on different sites
 Only purchase those items which can be recognized easily that item is fake or not
or choose according rating of buyers.
 But not to worry, on my site you will get all items genuine and trusty, just check
once here before buy anywhere.

FUTURE WORK

 Advertisements of new products.


 Notifications of user cart, sales, discount offer etc.
 Online payment gateway.
 Developed for other devices also such as blackberry, IOS etc.
 We think that not a single project is ever considered as complete forever because our
mind is always thinking new and our necessities also are growing.
 The system is modified in future as per the owner requirement.
 The project made here is just to ensure that this product could be valid in today real
challenging world. Here all the facilities are made and tested

14
Project Report: Grocery Shopping

REFERENCES

 https://www.youtube.com/watch?v=nlQTN7vkc0c&t=1140s
 http://nevonprojects.com/grocery-shopping-android/
 https://www.slideshare.net/AmitaJain7/grocery-app-aj
 https://projectsgeek.com/2016/05/grocery-shopping-android-project.html
 https://www.slideshare.net/kmshakya/online-shopping-full-project-presentation-20-slides

15

You might also like