MAD_GRP3

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

MICRO PROJECT

Academic year

2023-24

QR CODE GENERATOR

Program: Computer Engineering Program code:CO6I


Course: Mobile Application Development Course code: 22617

1
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION

Certificate
This is to certify that Mr. / Ms. Anish Dharnidhar,Sheril Dawra,Ritika Dingra
Roll No’s. 07,08,09 Group No. 03 of Sixth Semester Diploma in Computer
Engineering has completed the Micro-Project work satisfactory in Mobile
Application Development (22617) for the academic year 2023 - 2024 as
prescribed in the MSBTE curriculum.

Place: Chembur Enrollment No.: 2100040221,222,223

Date: _________________ Exam Seat No.: ____________________

Subject Teacher Head of the Department Principal

Seal of
Institution

2
INDEX

Academic year: 2023-24 Name of the faculty: Mrs. Meena Talele

Program code: CO6IB Course & course code: MAD (22617)

Name of the candidate: Anish Dharnidhar,Sheril Dawra,Ritika Dingra

Roll No.: 07,08,09 Enrollment No.: 2100040221-223

Sr.No Page No.

Content

1 Project Proposal 04

2 Action plan 06

3 Resource required 07

4 Introduction 08

5 Actual Procedure 04

6 Output 08

7 Skill developed 25

8 Evaluation sheet 28-29

3
Annexure – I

Micro-Project Proposal

QR Code Generator

1.0 Aim/Benefits of the Micro-Project

Aim of the project is to


 Prepare a QR Code Generator App using android.
 Learn the various layouts and other components used in android.
 Prepare a report on the given topic.

2.0 Course Outcomes Addressed

CO1. Interpret Features of Android Operating System []

CO2. Configure Android environment and development tools [ ]

CO3. Develop Rich User interfaces by using layouts and components []

CO4. Use user interface components for android application development [ ]

CO5. Create Android application using database []

CO6. Publish android applications []

3.0 Proposed Methodology


 Discussion: Initial exploration and brainstorming sessions to refine the project's focus
and objectives.

 Program survey: Conducting surveys to gather relevant data or insights from potential
users or stakeholders.

 Submission of project proposal: Formal documentation outlining the project's scope,


objectives, methodology, and expected outcomes.

 Information collection: Gathering relevant data, literature, or resources related to the

4
project topic.

 Analysis of Data: Processing and interpreting collected data to extract meaningful


insights or patterns.

 Discussing about concepts: Collaborative discussion on theoretical frameworks,


methodologies, and approaches to be applied in the project.

 Writing the code to design the application: Developing software or applications based
on identified requirements and specifications.

 Analyzing the outputs obtained: Evaluating the results or outcomes generated by the
developed application or system.

 Editing and revising the content: Reviewing and refining project documentation, code,
or other deliverables to ensure quality and accuracy.

 Report Preparation: Compiling findings, insights, and outcomes into a comprehensive


report or presentation for stakeholders or evaluation purposes.

5
4.0 Action Plan

SR. Details of activity Planned Planned Name of


No. Start date Responsible Team
Finish date Members
1 Finalization of project Title and Scope 08/01/24 19/01/24 All

2 Project Definition 23/01/24 02/02/24 All

3 Information Collection and Analysis of Data 06/02/24 09/02/24 All

4 Algorithm and Flow Diagram 13/02/24 16/02/24 All

5 Coding 20/02/24 06/03/24 All

6 Output 12/03/24 15/03/24 All

7 Report writing 19/03/24 22/03/24 All

8 Demonstration of project & final submission 01/04/24 05/04/24 All

5.0 Resources Required

Sr. Name of Resource/material Specifications Quantity Remarks

6
No.

Minimum 8
1. IDE Android Studio 1
GB RAM

Windows 11
2. Computer 1
Intel i5 13th
gen

For testing
3. Mobile 1
applications

For document
4. MS Word(2019) 1
editing

Names of Team Members with Roll Nos

Roll.
Sr. No. Name of Team Members
No.

1. 07 Anish Dharnidhar

2. 08 Sheril Dawra

3. 09 Ritika Dingra

Teacher Signature

(Mrs Meena Talele)

Annexure – II

Micro-Project Report

7
QR Code Generator

1.0 Rationale

A QR code generator app offers users a convenient solution to quickly create QR codes from
various text inputs. This tool serves multiple purposes and can be beneficial for individuals and
businesses alike. In everyday scenarios, a QR code generator simplifies tasks such as sharing
contact information, website URLs, or other data in a scannable format. For businesses, QR
codes can be utilized for marketing purposes, event ticketing, or product packaging to provide
additional information or promotions to customers. The app's interface is designed to be user-
friendly, featuring an EditText field where users can input the text they want to encode into a QR
code. Below the input field, a "Generate QR Code" button triggers the QR code generation
process when clicked. Once generated, the QR code is displayed in an ImageView, allowing
users to easily save or share the generated QR code. Moreover, the app offers advanced
functionality to open the generated QR code as a link in a web browser. This feature enhances
the app's versatility, enabling users to seamlessly access the content encoded in the QR code. If
no web browser is available on the device, the app provides guidance on installing one or offers a
Google search page link to help users find a suitable web browser. Overall, a QR code generator
app provides users with a powerful tool for creating QR codes from text inputs and offers
additional features to enhance its usability and functionality. Whether for personal or business
use, the app offers a reliable solution for generating QR codes on the go.

2.0 Aim/Benefits of the Micro-Project

Aim of the project is to


 Prepare a QR Code Generator App using android.
 Learn the various layouts and other components used in android.
 Prepare a report on the given topic.

3.0 Course Outcomes Addressed

CO1. Interpret Features of Android Operating System []

CO2. Configure Android environment and development tools [ ]

8
CO3. Develop Rich User interfaces by using layouts and components []

CO4. Use user interface components for android application development [ ]

CO5. Create Android application using database []

CO6. Publish android applications []

4.0 Literature Review


The brief review for a QR code generator app would typically cover existing research,
publications, and technologies related to QR codes, mobile app development, and
usability. Here's a brief outline:

1. QR Code Technology: Discuss the history, development, and current trends in QR


code technology. Highlight its applications across various industries such as marketing,
logistics, and authentication.

2. Mobile App Development: Review literature on mobile app development, focusing


on Android platforms. Explore best practices, frameworks, and tools commonly used in
developing mobile applications.

3. User Interface and Experience (UI/UX): Examine studies and guidelines related to
designing user-friendly interfaces for mobile apps. Discuss principles of usability,
accessibility, and user engagement.

4. QR Code Generator Apps: Analyze existing QR code generator apps available in


app stores. Evaluate their features, functionalities, user feedback, and ratings. Identify
strengths, weaknesses, and areas for improvement.

5. Security and Privacy: Address concerns regarding the security and privacy
implications of QR code usage. Discuss measures to mitigate risks associated with
malicious QR codes and unauthorized access to personal data.

6. QR Code Usage in Different Contexts: Explore case studies or research papers that
demonstrate the diverse applications of QR codes in various fields such as education,
healthcare, and retail.

7. Emerging Technologies: Investigate emerging technologies that complement QR


code functionality, such as augmented reality (AR), near-field communication (NFC),
and blockchain integration.

8. Future Directions: Offer insights into potential advancements and innovations in QR


code technology and mobile app development. Propose ideas for enhancing QR code

9
generator apps, such as incorporating advanced customization options, real-time
analytics, or integration with other platforms.

5.0 Actual Procedure Followed.

Description:

The project involves the development of a cutting-edge QR code generator tool, named QR
Magic, designed to simplify the creation and utilization of QR codes for various purposes. QR

10
Magic leverages advanced technology and user-centric design principles to offer a seamless
and intuitive QR code generation experience, enhancing accessibility and efficiency for users.

Key Features:

1. Intuitive User Interface: QR Magic provides users with an intuitive and visually appealing
interface, ensuring effortless navigation and straightforward QR code creation. The platform
prioritizes user experience, making QR code generation accessible to individuals of all
technological backgrounds.

2. Versatile Code Generation: The platform offers a comprehensive range of QR code types,
including URL links, text, contact information, Wi-Fi credentials, and more. Users can easily
customize QR codes to suit their specific needs, whether for personal or professional use.

3. Personalized QR Codes: QR Magic utilizes advanced algorithms to generate personalized


QR codes tailored to users' preferences and requirements. Users can customize QR codes with
colors, logos, and other branding elements to enhance recognition and engagement.

4. Secure QR Code Generation: Security and privacy are paramount for QR Magic. The
platform implements robust encryption protocols and data protection measures to ensure the
security of generated QR codes and user information.

5. Convenient Sharing Options: QR Magic facilitates seamless sharing of generated QR


codes through various channels, including email, social media, messaging apps, and more.
Users can distribute QR codes effortlessly to their intended audience, enhancing
communication and engagement.

6. Compliance with Standards: QR Magic adheres to industry standards and best practices for
QR code generation and usage. The platform ensures compliance with relevant regulations and
guidelines to guarantee the reliability and integrity of generated QR codes.

By offering a user-friendly interface, versatile code generation capabilities, and robust security
measures, QR Magic empowers users to create and utilize QR codes effectively for diverse
applications.

Code:-

activity_main.xml: /apk/res/android"
android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?> android:layout_height="match_parent"
<RelativeLayout android:background="@color/white"
xmlns:android="http://schemas.android.com android:gravity="center">

11
<ImageView app:layout_constraintStart_toStartOf="paren
android:id="@+id/logo" t"
android:layout_width="wrap_content"
android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent
android:src="@drawable/splash" ">
android:layout_centerInParent="true"
/>
</RelativeLayout> <com.google.android.material.textfield.Text
InputEditText
activity_login.xml: android:id="@+id/emailEt"

android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.Constrain android:layout_height="wrap_content"
tLayout android:hint="Type your Email"
xmlns:android="http://schemas.android.com
/apk/res/android" android:inputType="textEmailAddress" />

xmlns:app="http://schemas.android.com/apk </com.google.android.material.textfield.Tex
/res-auto" tInputLayout>

xmlns:tools="http://schemas.android.com/to
ols" <com.google.android.material.textfield.Text
android:layout_width="match_parent" InputLayout
android:layout_height="match_parent" android:id="@+id/passwordLayout"
android:layout_width="match_parent"
android:background="@drawable/signin_scr android:layout_height="wrap_content"
een"
tools:context=".LoginActivity"> android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
app:boxStrokeColor="@color/yellow"
app:hintTextColor="@color/yellow"
<com.google.android.material.textfield.Text
InputLayout app:layout_constraintEnd_toEndOf="parent
android:id="@+id/emailLayout" "
android:layout_width="match_parent"
android:layout_height="wrap_content" app:layout_constraintHorizontal_bias="0.5"

android:layout_marginHorizontal="16dp" app:layout_constraintStart_toStartOf="paren
android:layout_marginTop="350dp" t"
app:boxStrokeColor="@color/yellow"
app:hintTextColor="@color/yellow" app:layout_constraintTop_toBottomOf="@i
d/emailLayout"
app:layout_constraintEnd_toEndOf="parent app:passwordToggleEnabled="true">
"

app:layout_constraintHorizontal_bias="0.5" <com.google.android.material.textfield.Text
InputEditText

12
android:id="@+id/passET"
app:layout_constraintStart_toStartOf="paren
android:layout_width="match_parent" t"

android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@
android:hint="Type Your Password" +id/passwordLayout" />

android:inputType="textPassword" /> <TextView


android:id="@+id/textView"
</com.google.android.material.textfield.Tex android:layout_width="wrap_content"
tInputLayout> android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="Not Registered Yet ,
<androidx.appcompat.widget.AppCompatB
Sign Up !"
utton
android:id="@+id/button" app:layout_constraintBottom_toBottomOf="
android:layout_width="0dp" parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent
android:layout_marginHorizontal="16dp" "
android:background="@color/yellow"
android:text="Sign In" app:layout_constraintHorizontal_bias="0.5"
android:textColor="@color/black"
android:textStyle="bold" app:layout_constraintStart_toStartOf="paren
t"
app:layout_constraintBottom_toBottomOf="
parent" app:layout_constraintTop_toBottomOf="@
+id/button" />
app:layout_constraintEnd_toEndOf="parent
" </androidx.constraintlayout.widget.Constrai
ntLayout>
app:layout_constraintHorizontal_bias="0.5"

/res-auto"

xmlns:tools="http://schemas.android.com/to
ols"
android:layout_width="match_parent"
android:layout_height="match_parent"
Activity_sign_up.xml: android:background="@drawable/signup_sc
reen"
<?xml version="1.0" encoding="utf-8"?> tools:context=".SignUpActivity">
<androidx.constraintlayout.widget.Constrain
tLayout
xmlns:android="http://schemas.android.com
/apk/res/android" <com.google.android.material.textfield.Text
InputLayout
xmlns:app="http://schemas.android.com/apk

13
android:id="@+id/emailLayout" "
android:layout_width="match_parent"
android:layout_height="wrap_content" app:layout_constraintHorizontal_bias="0.5"

android:layout_marginHorizontal="16dp" app:layout_constraintStart_toStartOf="paren
android:layout_marginTop="300dp" t"
app:boxStrokeColor="@color/yellow"
app:hintTextColor="@color/yellow" app:layout_constraintTop_toBottomOf="@i
d/emailLayout"
app:layout_constraintEnd_toEndOf="parent app:passwordToggleEnabled="true">
"

app:layout_constraintHorizontal_bias="0.5" <com.google.android.material.textfield.Text
InputEditText
app:layout_constraintStart_toStartOf="paren android:id="@+id/passET"
t"
android:layout_width="match_parent"
app:layout_constraintTop_toTopOf="parent
"> android:layout_height="wrap_content"
android:hint="Type Your Password"

<com.google.android.material.textfield.Text android:inputType="textPassword" />


InputEditText
android:id="@+id/emailEt" </com.google.android.material.textfield.Tex
tInputLayout>
android:layout_width="match_parent"

android:layout_height="wrap_content" <com.google.android.material.textfield.Text
android:hint="Type your Email" InputLayout

android:inputType="textEmailAddress" /> android:id="@+id/confirmPasswordLayout"


android:layout_width="match_parent"
</com.google.android.material.textfield.Tex android:layout_height="wrap_content"
tInputLayout>
android:layout_marginHorizontal="16dp"
android:layout_marginTop="24dp"
<com.google.android.material.textfield.Text app:boxStrokeColor="@color/yellow"
InputLayout app:hintTextColor="@color/yellow"
android:id="@+id/passwordLayout"
android:layout_width="match_parent" app:layout_constraintEnd_toEndOf="parent
android:layout_height="wrap_content" "

android:layout_marginHorizontal="16dp" app:layout_constraintHorizontal_bias="0.5"
android:layout_marginTop="24dp"
app:boxStrokeColor="@color/yellow" app:layout_constraintStart_toStartOf="paren
app:hintTextColor="@color/yellow" t"

app:layout_constraintEnd_toEndOf="parent app:layout_constraintTop_toBottomOf="@i
d/passwordLayout"

14
app:passwordToggleEnabled="true"> android:textColor="@color/black"
android:text="Already Registered ,
Sign In !"
<com.google.android.material.textfield.Text
InputEditText app:layout_constraintBottom_toBottomOf="
android:id="@+id/confirmPassEt" parent"

android:layout_width="match_parent" app:layout_constraintEnd_toEndOf="parent
"
android:layout_height="wrap_content"
android:hint="Retype Your app:layout_constraintHorizontal_bias="0.5"
Password"
app:layout_constraintStart_toStartOf="paren
android:inputType="textPassword" /> t"

</com.google.android.material.textfield.Tex app:layout_constraintTop_toBottomOf="@
tInputLayout> +id/button" />
</androidx.constraintlayout.widget.Constrai
ntLayout>
<androidx.appcompat.widget.AppCompatB
utton
android:id="@+id/button"
android:layout_width="0dp" Cart_item_layout.xml:
android:layout_height="wrap_content"
<!-- cart_item_layout.xml -->
android:layout_marginHorizontal="16dp"
<LinearLayout
android:background="@color/yellow"
xmlns:android="http://schemas.android.com
android:text="Sign Up"
/apk/res/android"
android:textColor="@color/black"
android:layout_width="match_parent"
android:textStyle="bold"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf=" android:orientation="horizontal"
parent" android:padding="8dp">

app:layout_constraintEnd_toEndOf="parent <ImageView
"
android:id="@+id/imageViewCartItem"
app:layout_constraintHorizontal_bias="0.5" android:layout_width="64dp"
android:layout_height="64dp"
app:layout_constraintStart_toStartOf="paren />
t"
<LinearLayout
app:layout_constraintTop_toBottomOf="@ android:layout_width="0dp"
+id/confirmPasswordLayout" /> android:layout_height="wrap_content"
<TextView android:layout_weight="1"
android:id="@+id/textView" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_marginStart="8dp">
android:layout_height="wrap_content"

15
<TextView <TextView

android:id="@+id/textViewCartItemName" android:id="@+id/textViewCartItemQuantit
y"
android:layout_width="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Item Name" android:layout_height="wrap_content"
android:textStyle="bold" android:text="Quantity: 0"
android:textSize="16sp"/> android:textSize="14sp"/>

<TextView </LinearLayout>

android:id="@+id/textViewCartItemPrice" <Button
android:id="@+id/buttonDelete"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="wrap_content"
android:text="Delete"/>
android:text="Price: $0.00"
android:textSize="14sp"/>
</LinearLayout>

LoginActivity.java: private FirebaseAuth firebaseAuth;

package com.example.pills_n_more; @Override


import android.content.Intent; protected void onCreate(Bundle
import android.os.Bundle; savedInstanceState) {
import android.util.Log; super.onCreate(savedInstanceState);
import android.view.View;
import android.widget.Button; setContentView(R.layout.activity_login);
import android.widget.EditText;
import android.widget.TextView; firebaseAuth =
import android.widget.Toast; FirebaseAuth.getInstance();
import
androidx.appcompat.app.AppCompatActivit emailEditText =
y; findViewById(R.id.emailEt);
import passwordEditText =
com.google.firebase.auth.FirebaseAuth; findViewById(R.id.passET);
signInButton =
public class LoginActivity extends findViewById(R.id.button);
AppCompatActivity { signUpTextView =
private EditText emailEditText; findViewById(R.id.textView);
private EditText passwordEditText;
private Button signInButton;
private TextView signUpTextView; signUpTextView.setOnClickListener(new

16
View.OnClickListener() { }
@Override });
public void onClick(View v) { }
Intent intent = new @Override
Intent(LoginActivity.this, protected void onStart() {
SignUpActivity.class); super.onStart();
startActivity(intent); if (firebaseAuth.getCurrentUser() !=
} null) {
}); Intent intent = new Intent(this,
HomeActivity.class);
signInButton.setOnClickListener(new startActivity(intent);
View.OnClickListener() { finish(); // Finish this activity to
@Override prevent going back to it
public void onClick(View v) { }
String email = }
emailEditText.getText().toString().trim(); }
String password =
passwordEditText.getText().toString().trim() SignUpActivity.java:
;
package com.example.pills_n_more;
if (!email.isEmpty() && ! import android.content.Intent;
password.isEmpty()) { import android.os.Bundle;
import android.view.View;
firebaseAuth.signInWithEmailAndPassword import android.widget.Button;
(email, import android.widget.EditText;
password).addOnCompleteListener(task -> import android.widget.TextView;
{ import android.widget.Toast;
if (task.isSuccessful()) { import
Intent intent = new androidx.appcompat.app.AppCompatActivit
Intent(LoginActivity.this, y;
HomeActivity.class); import
startActivity(intent); com.google.firebase.auth.FirebaseAuth;
finish(); // Finish this
activity to prevent going back to it public class SignUpActivity extends
} else { AppCompatActivity {
private EditText emailEditText;
Toast.makeText(LoginActivity.this, private EditText passwordEditText;
task.getException().getMessage(), private EditText
Toast.LENGTH_SHORT).show(); confirmPasswordEditText;
} private Button signUpButton;
}); private TextView signInTextView;
} else { private FirebaseAuth firebaseAuth;
Toast.makeText(LoginActivity.this, "Empty
fields are not allowed", @Override
Toast.LENGTH_SHORT).show(); protected void onCreate(Bundle
} savedInstanceState) {

17
super.onCreate(savedInstanceState); (password.equals(confirmPassword)) {

setContentView(R.layout.activity_sign_up); firebaseAuth.createUserWithEmailAndPass
word(email,
firebaseAuth = password).addOnCompleteListener(task ->
FirebaseAuth.getInstance(); {
if (task.isSuccessful()) {
emailEditText = Intent intent = new
findViewById(R.id.emailEt); Intent(SignUpActivity.this,
passwordEditText = LoginActivity.class);
findViewById(R.id.passET); startActivity(intent);
confirmPasswordEditText = finish(); // Finish this
findViewById(R.id.confirmPassEt); activity to prevent going back to it
signUpButton = } else {
findViewById(R.id.button); Toast.makeText(SignUpActivity.this,
signInTextView = task.getException().getMessage(),
findViewById(R.id.textView); Toast.LENGTH_SHORT).show();
}
signInTextView.setOnClickListener(new });
View.OnClickListener() { } else {
@Override
public void onClick(View v) { Toast.makeText(SignUpActivity.this,
Intent intent = new "Password is not matching",
Intent(SignUpActivity.this, Toast.LENGTH_SHORT).show();
LoginActivity.class); }
startActivity(intent); } else {
}
}); Toast.makeText(SignUpActivity.this,
"Empty fields are not allowed",
signUpButton.setOnClickListener(new Toast.LENGTH_SHORT).show();
View.OnClickListener() { }
@Override } });
public void onClick(View v) { }}
String email =
emailEditText.getText().toString().trim(); HomeActivity.java:
String password =
passwordEditText.getText().toString().trim() package com.example.pills_n_more;
; import android.content.Context;
String confirmPassword = import android.content.Intent;
confirmPasswordEditText.getText().toString import android.content.SharedPreferences;
().trim(); import android.os.Bundle;
import android.text.TextUtils;
if (!email.isEmpty() && ! import android.util.Log;
password.isEmpty() && ! import android.view.MenuItem;
confirmPassword.isEmpty()) { import android.view.View;
if import android.widget.Button;
import android.widget.ImageView;

18
import android.widget.LinearLayout;
import android.widget.PopupMenu; // Custom class to represent each item in
import android.widget.TextView; the cart
import android.widget.Toast; static class CartItem {
String name;
import androidx.annotation.NonNull; double price;
import String image;
androidx.appcompat.app.AppCompatActivit int quantity;
y;
CartItem(String name, double price,
import String image, int quantity) {
com.google.android.gms.tasks.OnComplete this.name = name;
Listener; this.price = price;
import com.google.android.gms.tasks.Task; this.image = image;
import this.quantity = quantity;
com.google.android.material.badge.BadgeD }
rawable; }
import
com.google.android.material.bottomnavigati // Declare variables to store total items
on.BottomNavigationView; count and total price
import int totalItemsCount = 0;
com.google.firebase.auth.FirebaseAuth; double totalPrice = 0.0;
import
com.google.firebase.firestore.FirebaseFirest // Declare HashMap to store cart items
ore; HashMap<String, CartItem> cartItems =
import new HashMap<>();
com.google.firebase.firestore.QueryDocume
ntSnapshot; @Override
import protected void onCreate(Bundle
com.google.firebase.firestore.QuerySnapsho savedInstanceState) {
t; super.onCreate(savedInstanceState);
import com.squareup.picasso.Picasso;
setContentView(R.layout.activity_home);
import java.util.HashMap;
import java.util.Map; bottomNavigationView =
findViewById(R.id.bottom_navigation);
public class HomeActivity extends linearLayoutMedicines =
AppCompatActivity { findViewById(R.id.linearLayoutMedicines);
private static final String TAG = cartItemsContainer =
"HomeActivity"; findViewById(R.id.cartItemsContainer);
BottomNavigationView
bottomNavigationView; // Initialize SharedPreferences
LinearLayout linearLayoutMedicines; sharedPreferences =
LinearLayout cartItemsContainer; getSharedPreferences("CartItems",
SharedPreferences sharedPreferences; Context.MODE_PRIVATE);
SharedPreferences.Editor editor; editor = sharedPreferences.edit();

19
if (item.getItemId() ==
R.id.navigation_medicines) {
bottomNavigationView.setOnNavigationIte fetchMedicines();
mSelectedListener(nav);
linearLayoutMedicines.setVisibility(View.V
bottomNavigationView.setSelectedItemId(R ISIBLE);
.id.navigation_medicines); } else {

ImageView imageViewCart = linearLayoutMedicines.setVisibility(View.G


findViewById(R.id.imageViewCart); ONE);
if (item.getItemId() ==
imageViewCart.setOnClickListener(new R.id.navigation_my_orders) {
View.OnClickListener() { Intent orderIntent = new
@Override Intent(HomeActivity.this,
public void onClick(View v) { OrderActivity.class);
Intent intent = new startActivity(orderIntent);
Intent(HomeActivity.this, } else if (item.getItemId() ==
CartActivity.class); R.id.navigation_more) {
startActivity(intent); PopupMenu popupMenu = new
} PopupMenu(HomeActivity.this,
}); findViewById(R.id.navigation_more));
ImageView logout =
findViewById(R.id.imageLogout); popupMenu.getMenuInflater().inflate(R.me
logout.setOnClickListener(new nu.menu_more, popupMenu.getMenu());
View.OnClickListener() {
@Override popupMenu.setOnMenuItemClickListener(n
public void onClick(View v) { ew
PopupMenu.OnMenuItemClickListener() {
FirebaseAuth.getInstance().signOut(); @Override
Intent intent = new public boolean
Intent(HomeActivity.this, onMenuItemClick(MenuItem menuItem) {
LoginActivity.class); if (menuItem.getItemId()
startActivity(intent); == R.id.menu_change_password) {
finish(); String userEmail =
} FirebaseAuth.getInstance().getCurrentUser()
}); .getEmail();
}
if (!
private TextUtils.isEmpty(userEmail)) {
BottomNavigationView.OnNavigationItemS
electedListener nav = new FirebaseAuth.getInstance().sendPasswordRe
BottomNavigationView.OnNavigationItemS setEmail(userEmail)
electedListener() { .addOnComplete
@Override Listener(new OnCompleteListener<Void>()
public boolean {
onNavigationItemSelected(@NonNull @Override
MenuItem item) { public void

20
onComplete(@NonNull Task<Void> task) { popupMenu.show();
if }
(task.isSuccessful()) { }
// Email return true;
sent successfully }
};
Toast.makeText(HomeActivity.this,
"Password reset email sent to " + userEmail, public void fetchMedicines() {
Toast.LENGTH_SHORT).show(); FirebaseFirestore db =
} else { FirebaseFirestore.getInstance();
// Email db.collection("medicine")
not sent, display error message .get()
.addOnCompleteListener(new
Toast.makeText(HomeActivity.this, "Failed OnCompleteListener<QuerySnapshot>() {
to send password reset email", @Override
Toast.LENGTH_SHORT).show(); public void
} onComplete(@NonNull
} Task<QuerySnapshot> task) {
}); if (task.isSuccessful()) {
} else {
// User is not signed linearLayoutMedicines.removeAllViews();
in or email is empty
for
Toast.makeText(HomeActivity.this, "User (QueryDocumentSnapshot document :
not signed in", task.getResult()) {
Toast.LENGTH_SHORT).show(); String name =
} document.getString("name");
Toast.makeText(HomeActivity.this, double price =
"Change Password clicked", document.getDouble("price");
Toast.LENGTH_SHORT).show(); String image =
} else if document.getString("image");
(menuItem.getItemId() == String discount =
R.id.menu_logout) { document.getString("discount"); //
// Handle Logout Assuming you have discount information

FirebaseAuth.getInstance().signOut(); View itemView =


Intent logoutIntent = getLayoutInflater().inflate(R.layout.item_me
new Intent(HomeActivity.this, dicine, null);
LoginActivity.class);
TextView
startActivity(logoutIntent); textViewMedicineName =
finish(); itemView.findViewById(R.id.textViewMedi
} cineName);
return true; TextView
} textViewMedicinePrice =
}); itemView.findViewById(R.id.textViewMedi

21
cinePrice); // Increment quantity if item already
ImageView exists
imageViewMedicine = CartItem existingItem =
itemView.findViewById(R.id.imageViewM cartItems.get(itemName);
edicine); existingItem.quantity++;
itemQuantity =
existingItem.quantity;
textViewMedicineName.setText(name); Toast.makeText(HomeActivity.this,
itemName + " added to cart. Quantity: " +
textViewMedicinePrice.setText("Price: RS " itemQuantity,
+ price); Toast.LENGTH_SHORT).show();
} else {
// Add new item to cart
Picasso.get().load(image).into(imageViewM
cartItems.put(itemName, new
edicine);
CartItem(name, price, image,
itemQuantity));
Button
Toast.makeText(HomeActivity.this,
buttonAddToCart =
itemName + " added to cart. Quantity: 1",
itemView.findViewById(R.id.buttonAddTo
Toast.LENGTH_SHORT).show();
Cart);
}
buttonAddToCart.setOnClickListener(new
View.OnClickListener() { // Update totalItemsCount and
@Override totalPrice
public void totalItemsCount++;
onClick(View v) { totalPrice += price;
addCartItem(name, price, image);
}});
bottomNavigationView.getOrCreateBadge(
linearLayoutMedicines.addView(itemView) R.id.imageViewCart).setNumber(totalItems
; Count);
}
} else { // Save cart items to SharedPreferences
Log.w(TAG, "Error getting saveCartItems();
documents.", task.getException()); }
}
} // Method to save cart items to
}); SharedPreferences
} private void saveCartItems() {
editor.clear();
private void addCartItem(String name, for (Map.Entry<String, CartItem> entry
double price, String image) { : cartItems.entrySet()) {
String itemName = name; String itemName = entry.getKey();
int itemQuantity = 1; CartItem item = entry.getValue();
editor.putInt(itemName +
if (cartItems.containsKey(itemName)) "_quantity", item.quantity);
{ editor.putString(itemName +

22
"_name", item.name); getSharedPreferences("CartItems",
editor.putString(itemName + Context.MODE_PRIVATE);
"_image", item.image);
editor.putFloat(itemName + // Get cart items and total price from
"_price", (float) item.price); SharedPreferences
} HashMap<String,
editor.putInt("totalItemsCount", HomeActivity.CartItem> cartItems =
totalItemsCount); loadCartItems();
editor.putFloat("totalPrice", (float) double totalPrice =
totalPrice); sharedPreferences.getFloat("totalPrice",
editor.apply(); 0.0f);
}
} // Display cart items in the layout
displayCartItems(cartItems, totalPrice);
CartActivity.java:
// Handle checkout button click
package com.example.pills_n_more; Button checkoutButton =
import android.content.Context; findViewById(R.id.checkoutButton);
import android.content.Intent;
import android.content.SharedPreferences; checkoutButton.setOnClickListener(new
import android.os.Bundle; View.OnClickListener() {
import android.view.View; @Override
import android.widget.Button; public void onClick(View v) {
import android.widget.ImageView; Intent inp=new
import android.widget.LinearLayout; Intent(CartActivity.this,
import android.widget.TextView; PaymentActivity.class);
import
androidx.appcompat.app.AppCompatActivit inp.putExtra("Amount",totalPrice);
y; startActivity(inp);
import com.squareup.picasso.Picasso;
import java.util.HashMap; }
import java.util.Map; });
}
public class CartActivity extends
AppCompatActivity { private HashMap<String,
SharedPreferences sharedPreferences; HomeActivity.CartItem> loadCartItems() {
HashMap<String,
@Override HomeActivity.CartItem> cartItems = new
protected void onCreate(Bundle HashMap<>();
savedInstanceState) { for (Map.Entry<String, ?> entry :
super.onCreate(savedInstanceState); sharedPreferences.getAll().entrySet()) {
String key = entry.getKey();
setContentView(R.layout.activity_cart); if (key.endsWith("_quantity")) {
String itemName =
// Initialize SharedPreferences key.substring(0,
sharedPreferences = key.lastIndexOf("_quantity"));

23
int quantity = getLayoutInflater().inflate(R.layout.cart_ite
sharedPreferences.getInt(itemName + m_layout, null);
"_quantity", 0);
String name = // Find views inside cart item layout
sharedPreferences.getString(itemName + ImageView imageViewCartItem =
"_name", ""); cartItemLayout.findViewById(R.id.imageVi
String image = ewCartItem);
sharedPreferences.getString(itemName + TextView textViewCartItemName =
"_image", ""); cartItemLayout.findViewById(R.id.textVie
double price = wCartItemName);
sharedPreferences.getFloat(itemName + TextView textViewCartItemPrice =
"_price", 0.0f); cartItemLayout.findViewById(R.id.textVie
cartItems.put(itemName, new wCartItemPrice);
HomeActivity.CartItem(name, price, image, TextView textViewCartItemQuantity
quantity)); =
} cartItemLayout.findViewById(R.id.textVie
} wCartItemQuantity);
return cartItems; Button buttonDelete =
} cartItemLayout.findViewById(R.id.buttonD
elete);
private void
displayCartItems(HashMap<String, // Set data to views
HomeActivity.CartItem> cartItems, double
totalPrice) { textViewCartItemName.setText(itemName);
LinearLayout cartItemsLayout =
findViewById(R.id.cartItemsLayout); textViewCartItemPrice.setText("Price: RS "
TextView totalPriceTextView = + item.price);
findViewById(R.id.totalPriceTextView); //
Moved declaration here textViewCartItemQuantity.setText("Quantit
y: " + item.quantity);
// Declare totalPrice as effectively final
Picasso.get().load(item.image).into(imageVi
final double[] finalTotalPrice =
ewCartItem);
{totalPrice};
// Add click listener for delete button
// Iterate through cart items and
populate the layout
buttonDelete.setOnClickListener(new
for (Map.Entry<String,
View.OnClickListener() {
HomeActivity.CartItem> entry :
@Override
cartItems.entrySet()) {
public void onClick(View v) {
String itemName = entry.getKey();
// Remove item from cart
HomeActivity.CartItem item =
cartItems.remove(itemName);
entry.getValue();
// Update display
// Inflate cart item layout
cartItemsLayout.removeView(cartItemLayo
LinearLayout cartItemLayout =
ut);
(LinearLayout)
// Recalculate total price

24
finalTotalPrice[0] -= item.price }
* item.quantity; });
// Update total price display
// Add cart item view to the cart
totalPriceTextView.setText("Total Price: " + items layout
finalTotalPrice[0]);
// Save updated cart items to cartItemsLayout.addView(cartItemLayout);
SharedPreferences }

CartUtils.saveCartItems(getApplicationCont // Display total price


ext(), cartItems, cartItems.size(), totalPriceTextView.setText("Total
finalTotalPrice[0]); Price: " + totalPrice);

6.0 Actual Resources Used


Sr.
Name of Resource/material Specifications Quantity Remarks
No.

Minimum 8
1. IDE Android Studio 1
GB RAM

2. Database Firebase NOSQL 1

Windows 11
3. Computer 1
AMD Ryzen 3

For testing
4. Mobile 1
applications

For document
5. MS Word(2019) 1
editing

25
7.0 Outputs of the Micro-Projects

26
27
8.0 Skill Developed / learning out of this Micro-Project

The following skills were developed while performing and developing this micro-project:-

1. Designing: Designing of micro project with minimum required resources and at low
Cost.
2. Teamwork: Learned to work in a team and boost individual confidence.
3. Time Management: Timely completion of micro project as scheduled.
4. Data Analysis: Interpretation of data
5. Problem-solving: Develop good problem-solving habits.
6. Technical writing: Preparing a report of the proposed plan and final report.

9.0 Application of this Micro-Project

1. User-friendly Interface: The QR code generator tool boasts a user-friendly interface


designed for effortless QR code creation and customization. With clear instructions and intuitive
design elements, users can easily navigate the platform and generate QR codes without technical
expertise.

2. Customization Options: The QR code generator provides users with a range of customization
options to tailor their QR codes to specific needs. From adding logos and colors to customizing
content, users can personalize their QR codes to align with their branding or informational
requirements.

3. Accurate Code Management: Leveraging advanced algorithms, the QR code generator


ensures accurate code management and tracking. By analyzing usage patterns and data, the
platform offers insights into code performance and effectiveness, enabling users to optimize their
QR code strategies for maximum impact.

4. Security Measures: Security is a top priority for the QR code generator, which implements
robust encryption and data protection measures. By adhering to industry standards and best
practices, the platform safeguards users' information and QR code data from unauthorized
access.

28
Annexure – IV

Micro Project Evaluation Sheet

Name of Student: Anish D, Sheril D, Ritika D Enrollment No.: 2100040221-223

Name of Program: Computer Engineering Semester: Sixth

Course Title: Mobile Application Development Course Code: MAD (22617)

Title of the Micro-Project: QR CODE GENERATOR

CO’s addressed by Micro Project:


CO1. Interpret Features of Android Operating System [ ]

CO2. Configure Android environment and development tools [ ]

CO3. Develop Rich User interfaces by using layouts and components [ ]

CO4. Use user interface components for android application development [ ]

CO5. Create Android application using database []

CO6. Publish android applications []

Sr. Characteristic to be Poor Average Good (Marks Excellent Sub Total


No assessed (Marks 4-5 ) 6-8) ( Marks9-10)
( Marks1-3

)
(A) Process and Product Assessment (Convert Above Total marks out of 6 Marks)

1 Relevance to the course


2 Literature review/
Information Collection
3 Completion of the Target as
per project proposal
4 Analysis of Data and
representation
5 Quality of Prototype/Model
6 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 marks)

29
7 Presentation
8 Defense/Viva

Total
Roll Process and Product Assessment Individual Presentation / Viva Marks
No. (6 Marks) (4 Marks)
10
04

05

06

Comments/Suggestions about team work/leadership/interpersonal communication

The project was implemented with good leadership & teamwork with active cooperation of all
the team members. Everyone contributed equally and met with good outcomes. Hence, overall
project was done with harmony with good team spirit.

Name and designation of the Faculty Member: Mrs. Meena Talele(Lecturer)

Signature________________

30

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy