Bakery Management System
Bakery Management System
Report
on
BACHELOR OF ENGINEERING
in
By
1 Introduction
1.1 Problem Statement 3
1.2 Objective 3
1.3 Scope 3
2 Technology Review
2.1 Android Studio 4
2.2 Flutter 4
2.3 Visual Studio 5
2.4 DART 5
5
3 System Requirements
3.1 Software Requirements 6
3.2 Hardware Requirements 6
4 System Design
4.1 Use Case Diagram 7
5 Implementation
9
1. Introduction 9
10
2. Set up your Flutter environment
3. Getting started
6. Widget testing
7 Conclusion 17
8 References 17
1.1:PROBLEM STATEMENT
This bakery app provides you the comprehensive view of all information regarding to the bakery.
This app is more customized and easy to navigate. This app provides detailed information on
bakery products offers by the bakery such as bread, cookies, cake and sandwich etc. One can
easily get registered with the bakery by the simple sign up option. Users can set their profile with
the help of this app. One can add his/her favorites and get frequent notification related to the
specific product.
1.2:ABSTRACT
This App is an online bakery shop that allows users to check for different
bakery items available at the online shop and then purchase online. The
project provides a list of bakery products displayed online in various
categories. The user may browse through these items. If the user wants to
purchase any product(s), he/she may add it to his shopping cart.
Keeping the features of an e-commerce site, an online bakery shop
software project acts as a central database containing various bakery
products. It provides customers online shopping facilities from their homes.
1.3:SCOPE
As one of the largest segments in the food processing sector in India,
the bakery industry offers huge opportunities for growth, innovation, and job
generation. Separated into three categories, bread, biscuits, and cakes and
pastries.As the second largest producer of biscuits after the USA, India is a
key player internationally, and with the entrepreneurial spirit of Indian
companies and individuals it is one of the most exciting regions for the
bakery sector.
Android Studio is the official integrated development environment (IDE) for Google's
Android operating system, built on JetBrains' IntelliJ IDEA software and designed
specifically for Android development. It is available for download on Windows, macOS
and Linux based operating systems or as a subscription-based service in 2020.It is a
replacement for the Eclipse Android Development Tools (E-ADT) as the primary IDE for
native Android application development.
2.2 Flutter
Flutter is an open source framework by Google for building beautiful,
natively compiled, multi-platform applications from a single codebase.Flutter
code compiles to ARM or Intel machine code as well as JavaScript, for fast
performance on any device.

Visual Studio Community. A fully-featured, extensible, free IDE for creating modern
applications for Android, iOS, Windows, as well as web applications and cloud services.Visual
Studio Code is a lightweight, cross-platform development environment that runs on Windows,
Mac, and Linux systems. The Microsoft C/C++ for Visual Studio Code extension supports
IntelliSense, debugging, code formatting, auto-completion. Visual Studio for Mac doesn't
support Microsoft C++, but does support
2.4 DART :
Dart is a programming language designed for client development, such as for the web and mobile
apps. It is developed by Google and can also be used to build server and desktop applications. Dart is an
object-oriented, class-based, garbage-collected language with C-style syntax.Dart is an open-source
general-purpose programming language. It is originally developed by Google and later approved as a standard
by ECMA.
CHAPTER 3- SYSTEM REQUIREMENTS
3.1 Software Requirements
Development Deployment
Functional Non
Functional
Development Deployment
A Use Case Diagram consists of a set of elements and the relationships between them. It
depicts all the scenarios, regarding how our application interacts with users and other
external systems to achieve the goals of application. The main components of a use case
diagram include actors, use cases and their relationships. The use case is an external view
of the system that represents some actions that the user performs to get a job done. Actors
are the users who interact with the application.
Figure 4.1:Use Case Diagram
Actors:
The only Actor of the system is User.
UseCases:
We have identified a set of use cases based on the functionalities and goals of the application.
● Launch Screen-In launch screen we have subject button which are DS,DSR,IS subjects
● Select the Subjects
○ DS Subject:In DS subjects we have 10 questions
○ DSR Subject:In DSR subject we have 10 questions
○ IS Subject:In IS subject we have 10 questions
● Toast Message:
1. First when a question is displayed it shows “Please select an option”
2.After selecting an option it displays “That’s correct” if the answer is correct else
it displays “That incorrect”.
CHAPTER 5 - IMPLEMENTATION
5.1
1. Introduction
Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and
desktop from a single codebase.
In this codelab, you'll build and test a simple Flutter app. The app will use the Provider package for
managing state.
You can run this codelab using any of the following devices:
● A physical device (Android or iOS) connected to your computer and set to developer mode.
● The iOS simulator. (Requires installing Xcode tools.)
● The Android emulator. (Requires setup in Android Studio.)
3. Getting started
Create a simple templated Flutter app, using the instructions in Getting Started with your first
Flutter app. Name the project testing_app (instead of myapp). You'll be modifying this starter app to
create the finished app.
Note: If you don't see "New Flutter Project" as an option in your IDE, make sure that you have the plugins
installed for Flutter and Dart.
This codelab is written in null safe Dart, so we convert the generated project to Null Safety as
follows:
$ cd testing_app
$ dart migrate --apply-changes
If you are using Flutter 2.2 or above, your sample code will already be null safe, so the above dart
migrate will not result in any changes to your source code.
In your IDE or editor, open the pubspec.yaml file. Add the following dependencies marked as new,
then save the file. (You can delete the comments to make the file more readable.)
pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
provider: ^5.0.0 # new
dev_dependencies:
flutter_test:
sdk: flutter
integration_test: # new
sdk: flutter # new
test: ^1.14.4 # new
1. Click the Pub get button in your IDE or, at the command line, run flutter pub get from the top
of the project.
If this results in an error, make sure that the indentation in your dependencies block is exactly the same
as shown above, using spaces (not tabs). YAML files are sensitive to white space.
lib/main.dart
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:testing_app/models/favorites.dart';
import 'package:testing_app/screens/favorites.dart';
import 'package:testing_app/screens/home.dart';
void main() {
runApp(TestingApp());
}
Create a new directory, screens, in the lib directory and, in that newly created directory, create a
new file named home.dart. In lib/screens/home.dart add the following code:
lib/screens/home.dart
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:testing_app/models/favorites.dart';
import 'package:testing_app/screens/favorites.dart';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Testing Sample'),
actions: <Widget>[
TextButton.icon(
style: TextButton.styleFrom(primary: Colors.white),
onPressed: () {
Navigator.pushNamed(context, FavoritesPage.routeName);
},
icon: Icon(Icons.favorite_border),
label: Text('Favorites'),
),
],
),
body: ListView.builder(
itemCount: 100,
cacheExtent: 20.0,
padding: const EdgeInsets.symmetric(vertical: 16),
itemBuilder: (context, index) => ItemTile(index),
),
);
}
}
const ItemTile(
this.itemNo,
);
@override
Widget build(BuildContext context) {
var favoritesList = Provider.of<Favorites>(context);
return Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.primaries[itemNo % Colors.primaries.length],
),
title: Text(
'Item $itemNo',
key: Key('text_$itemNo'),
),
trailing: IconButton(
key: Key('icon_$itemNo'),
icon: favoritesList.items.contains(itemNo)
? Icon(Icons.favorite)
: Icon(Icons.favorite_border),
onPressed: () {
!favoritesList.items.contains(itemNo)
? favoritesList.add(itemNo)
: favoritesList.remove(itemNo);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(favoritesList.items.contains(itemNo)
? 'Added to favorites.'
: 'Removed from favorites.'),
duration: Duration(seconds: 1),
),
);
},
),
),
);
}
}
lib/screens/favorites.dart
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:testing_app/models/favorites.dart';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Favorites'),
),
body: Consumer<Favorites>(
builder: (context, value, child) => ListView.builder(
itemCount: value.items.length,
padding: const EdgeInsets.symmetric(vertical: 16),
itemBuilder: (context, index) => FavoriteItemTile(value.items[index]),
),
),
);
}
}
const FavoriteItemTile(
this.itemNo,
);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: ListTile(
leading: CircleAvatar(
backgroundColor: Colors.primaries[itemNo % Colors.primaries.length],
),
title: Text(
'Item $itemNo',
key: Key('favorites_text_$itemNo'),
),
trailing: IconButton(
key: Key('remove_icon_$itemNo'),
icon: Icon(Icons.close),
onPressed: () {
Provider.of<Favorites>(context, listen: false).remove(itemNo);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Removed from favorites.'),
duration: Duration(seconds: 1),
),
);
},
),
),
);
}
}
Create a new directory, models and, in that directory, create a new file named favorites.dart. In that
file add the following code:
lib/models/favorites.dart
import 'package:flutter/material.dart';
/// The [Favorites] class holds a list of favorite items saved by the user.
class Favorites extends ChangeNotifier {
final List<int> _favoriteItems = [];
At the command line, navigate to the project's root directory and enter the following command:
Tip: You can run all the tests in the test directory at once by running:
$ flutter test
6. Widget testing
In this step you'll be performing widget tests. Widget testing is unique to Flutter, where you can test
each and every individual widget of your choice. This step tests the screens (HomePage and
FavoritesPage) individually.
Widget testing uses the testWidget() function instead of the test() function. It also takes two parameters:
the description, and the callback. But here, the callback takes a WidgetTester as an argument.
Widget tests use TestFlutterWidgetsBinding, a class that provides the same resources to your widgets
that they would have in a running app (information about screen size, the ability to schedule animations,
and so on), but without the actual app. Instead, a virtual environment is used to run the widget, measure
it, and so on, then tests the results. Here, pumpWidget kicks off the process by telling the framework to
mount and measure a particular widget just as it would in a complete application.
The widget testing framework provides finders to find widgets (for example, text(), byType(), byIcon())
and also matchers to verify the results.
Create a new file in the test directory and name it home_test.dart. In the newly created file, add the
following code:
test/home_test.dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';
import 'package:testing_app/models/favorites.dart';
import 'package:testing_app/screens/home.dart';
Widget createHomeScreen() => ChangeNotifierProvider<Favorites>(
create: (context) => Favorites(),
child: MaterialApp(
home: HomePage(),
),
);
void main() {
group('Home Page Widget Tests', () {
testWidgets('Testing Scrolling', (tester) async {
await tester.pumpWidget(createHomeScreen());
expect(find.text('Item 0'), findsOneWidget);
await tester.fling(find.byType(ListView), Offset(0, -200), 3000);
await tester.pumpAndSettle();
expect(find.text('Item 0'), findsNothing);
});
});
}
The createHomeScreen() function is used to create an app that loads the widget to be tested in a
MaterialApp, wrapped into a ChangeNotifierProvider. The HomePage widget needs both of these
widgets to be present above it in the widget tree so it can inherit from them and get access to the data
they offer. This function is passed as a parameter to the pumpWidget() function.
Next, test whether the framework can find a ListView rendered onto the screen.
Note: This test is supposed to be run before the scrolling test as you are performing actions on the ListView in
it. However, to give you a general idea of how widgets tests are written we wrote the scrolling test first.
test/home_test.dart
group('Home Page Widget Tests', () {
From the command line, navigate to the project's root directory and enter the following command:
Next, you'll make changes to the test file and enter Shift + R to hot restart the app and re-run all the
tests.
Add more tests to the group that tests the HomePage widgets. Copy the following test to your file:
test/home_test.dart
testWidgets('Testing IconButtons', (tester) async {
await tester.pumpWidget(createHomeScreen());
expect(find.byIcon(Icons.favorite), findsNothing);
await tester.tap(find.byIcon(Icons.favorite_border).first);
await tester.pumpAndSettle(Duration(seconds: 1));
expect(find.text('Added to favorites.'), findsOneWidget);
expect(find.byIcon(Icons.favorite), findsWidgets);
await tester.tap(find.byIcon(Icons.favorite).first);
await tester.pumpAndSettle(Duration(seconds: 1));
expect(find.text('Removed from favorites.'), findsOneWidget);
expect(find.byIcon(Icons.favorite), findsNothing);
});
This test verifies that tapping the IconButton changes from Icons.favorite_border (an open heart) to
Icons.favorite (a filled-in heart) and then back to Icons.favorite_border when tapped again.
Enter Shift + R. This hot restarts the app and re-runs all the tests.
Use the same process to test the FavoritesPage with the following code. Follow the same steps and
run it.
test/favorites_test.dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';
import 'package:testing_app/models/favorites.dart';
import 'package:testing_app/screens/favorites.dart';
void addItems() {
for (var i = 0; i < 10; i += 2) {
favoritesList.add(i);
}
}
void main() {
group('Favorites Page Widget Tests', () {
testWidgets('Test if ListView shows up', (tester) async {
await tester.pumpWidget(createFavoritesScreen());
addItems();
await tester.pumpAndSettle();
expect(find.byType(ListView), findsOneWidget);
});
This test verifies whether an item disappears when the close (remove) button is pressed.
Create a directory called integration_test in the project's root directory. In that newly created
directory, create an driver.dart file and add the following code:
integration_test/driver.dart
import 'package:integration_test/integration_test_driver.dart';
This code enables the integration test driver and then waits for the test to run. The response data is
stored in a file named integration_response_data.json after the tests are run.
integration_test/app_test.dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:testing_app/main.dart';
void main() {
group('Testing App Performance Tests', () {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized()
as IntegrationTestWidgetsFlutterBinding;
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
});
}
The ensureInitialized() function verifies if the integration test driver is initialized or not, and reinitializes
it if necessary. The framePolicy when set to fullyLive from the
LiveTestWidgetsFlutterBindingFramePolicy enum, is best suitable for testing heavily-animated
situations.
Next, test the scrolling performance of the app and record it using the watchPerformance() function.
Paste the following code into the test group you just created:
integration_test/app_test.dart
testWidgets('Scrolling test', (tester) async {
await tester.pumpWidget(TestingApp());
This test scrolls through the list of items really fast and then scrolls all the way up. The
watchPerformance() function records the actions and generates a timeline summary which is then sent
back as response data to the test driver in the driver.dart file.
final iconKeys = [
'icon_0',
'icon_1',
'icon_2',
];
await tester.tap(find.text('Favorites'));
await tester.pumpAndSettle();
final removeIconKeys = [
'remove_icon_0',
'remove_icon_1',
'remove_icon_2',
];
At the command line, navigate to the project's root directory and enter the following command:
Tip:
● It is recommended that you always run performance tests on a physical Android/iOS device in profile
mode as it gives you the best understanding of your app's performance.
● Using --profile on iOS requires you to have a valid Team ID to sign the code. You can remove this
option from the command or use an Android device.
● The --trace-startup option can be used to avoid flushing older timeline events when the timeline gets
long.
After the test completes successfully, the build directory at the root of the project should contain one file
named integration_response_data.json. It contains the response data sent back from the test while
running, in this case, the scrolling_summary. Open the file with any text editor to view the information.
With a more advanced setup, you could save a summary every time the test runs and create a graph of
the results.
CHAPTER 7 - CONCLUSION
Hereprovide
can we havethepresented the design
users to test of a Quiz app for android applications which
their knowledge.
This application
prepare is developed
the multiple for educational
choice questions purposes,
for different allowing the users to
examinations.
CHAPTER 8 - REFERENCES
● https://github.com/KotagiriSahithi/QuizApplication
● https://developer.android.com/studio?gclid=CjwKCAiAn5uOBhADEiwA_pZwcIJ
XZBwbsWJ-Jx3Z0o3lZaMWfMLHN00xBDV125dStMbPU13l9Tj_5hoC6DsQAv
D_BwE&gclsrc=aw.ds
● https://developer.android.com/docs
● https://www.tutorialspoint.com/android/android_studio.htm
● https://www.lucidchart.com/pages/examples/uml_diagram_tool
CHAPTER 9 - APPENDIX
1.MainActivity.java
package com.example.quizapplication;
import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity
implements View.OnClickListener {
private RadioButton option1;
private RadioButton option2;
private RadioButton option3;
private RadioButton option4;
private ImageButton nextButton;
private ImageButton prevButton;
private ImageView Image;
private TextView questionTextView;
private int correct = 0,a=0;
// to keep current question track
private int currentQuestionIndex = 0;
String value;
RadioGroup rg ;
private Question[] questionBank = new Question[] {
// array of objects of class Question
// providing questions from string
// resource and the correct ans
new Question(R.string.a, "server",R.string.op11,R.string.op12,R.string.op13,R.string.op14),
new Question(R.string.b, "process migration",R.string.op21,R.string.op22,R.string.op23,R.string.op24),
new Question(R.string.c, "same CLK",R.string.op31,R.string.op32,R.string.op33,R.string.op34),
new Question(R.string.d, "stateless servers",R.string.op41,R.string.op42,R.string.op43,R.string.op44),
new Question(R.string.e, "the remaining sites can continue
operating",R.string.op51,R.string.op52,R.string.op53,R.string.op54),
new Question(R.string.f, "all the processors are
synchronized",R.string.op61,R.string.op62,R.string.op63,R.string.op64),
new Question(R.string.g, "it's users,servers and storage devices are
dispersed",R.string.op71,R.string.op72,R.string.op73,R.string.op74),
new Question(R.string.h, "simplicity",R.string.op81,R.string.op82,R.string.op83,R.string.op84),
new Question(R.string.i, "address messages with the
process-id",R.string.op91,R.string.op92,R.string.op93,R.string.op94),
new Question(R.string.j, "all of the above",R.string.op101,R.string.op102,R.string.op103,R.string.op104),
};
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// setting up the buttons
// associated with id
// falseButton = findViewById(R.id.false_button);
//trueButton = findViewById(R.id.true_button);
nextButton = findViewById(R.id.next_button);
prevButton = findViewById(R.id.prev_button);
// register our buttons to listen to
// click events
questionTextView
= findViewById(R.id.answer_text_view);
Image = findViewById(R.id.myimage);
//falseButton.setOnClickListener(this);
//trueButton.setOnClickListener(this);
option1 = findViewById(R.id.radioButton);
option2 = findViewById(R.id.radioButton2);
option3= findViewById(R.id.radioButton3);
option4= findViewById(R.id.radioButton4);
nextButton.setOnClickListener(this);
prevButton.setOnClickListener(this);
rg = (RadioGroup) findViewById(R.id.radiogroup);
option1.setText(R.string.op11);
option2.setText(R.string.op12);
option3.setText(R.string.op13);
option4.setText(R.string.op14);
if(rg.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select an option...", Toast.LENGTH_SHORT).show();
}
else {
value = ((RadioButton) findViewById(rg.getCheckedRadioButtonId()))
.getText().toString();
checkAnswer(value);
}
//checkAnswer(value);
}
@SuppressLint("SetTextI18n")
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onClick(View v)
{
// checking which button is
// clicked by user
// in this case user choose false
if(rg.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select an option...", Toast.LENGTH_SHORT).show();
}
else {
value = ((RadioButton) findViewById(rg.getCheckedRadioButtonId()))
.getText().toString();
checkAnswer(value);
}
// a++;
switch (v.getId()) {
case R.id.next_button:
// go to next question
// limiting question bank range
a=0;
if (currentQuestionIndex <11) {
currentQuestionIndex
= currentQuestionIndex + 1;
// making buttons
// invisible
if (currentQuestionIndex == 10) {
questionTextView.setText(getString(
R.string.correct, correct));
nextButton.setVisibility( View.INVISIBLE);
prevButton.setVisibility(
View.INVISIBLE);
option1.setVisibility(
View.INVISIBLE);
option2.setVisibility(
View.INVISIBLE);
option3.setVisibility(
View.INVISIBLE);
option4.setVisibility(
View.INVISIBLE);
if (correct > 3) {
questionTextView.setText(
"CORRECTNESS IS " + correct
+""
+ "OUT OF 10");
Image.setImageResource(
R.drawable.happy);
// showing correctness
}
else
Image.setImageResource(
R.drawable.resu);
//questionTextView.setText(
//"Better Luck Next Time!");
// if correctness<3 showing sad emoji
}
else {
updateQuestion();
}
}
break;
case R.id.prev_button:
if (currentQuestionIndex > 0) {
currentQuestionIndex
= (currentQuestionIndex - 1)
% questionBank.length;
updateQuestion();
}
break;
}
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void updateQuestion()
{
Log.d("Current",
"onClick: " + currentQuestionIndex);
questionTextView.setText(
questionBank[currentQuestionIndex]
.getAnswerResId());
option1.setText(questionBank[currentQuestionIndex].getoption1());
option2.setText(questionBank[currentQuestionIndex].getoption2());
option3.setText(questionBank[currentQuestionIndex].getoption3());
option4.setText(questionBank[currentQuestionIndex].getoption4());
Toast
.makeText(MainActivity.this, toastMessageId,
Toast.LENGTH_SHORT)
.show();
}
}
2.MainActivity2.java
package com.example.quizapplication;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Button b1=findViewById(R.id.button);
Button b2=findViewById(R.id.button2);
Button b3=findViewById(R.id.button3);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), MainActivity3.class);
startActivity(intent);
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), MainActivity4.class);
startActivity(intent);
}
});
}
}
3.MainActivity3.java
package com.example.quizapplication;
import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
};
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// setting up the buttons
// associated with id
// falseButton = findViewById(R.id.false_button);
//trueButton = findViewById(R.id.true_button);
nextButton = findViewById(R.id.next_button);
prevButton = findViewById(R.id.prev_button);
// register our buttons to listen to
// click events
questionTextView
= findViewById(R.id.answer_text_view);
Image = findViewById(R.id.myimage);
//falseButton.setOnClickListener(this);
//trueButton.setOnClickListener(this);
option1 = findViewById(R.id.radioButton);
option2 = findViewById(R.id.radioButton2);
option3= findViewById(R.id.radioButton3);
option4= findViewById(R.id.radioButton4);
nextButton.setOnClickListener(this);
prevButton.setOnClickListener(this);
rg = (RadioGroup) findViewById(R.id.radiogroup);
questionTextView.setText(R.string.a1);
option1.setText(R.string.op211);
option2.setText(R.string.op212);
option3.setText(R.string.op213);
option4.setText(R.string.op214);
if(rg.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select an option...", Toast.LENGTH_SHORT).show();
}
else {
value = ((RadioButton) findViewById(rg.getCheckedRadioButtonId()))
.getText().toString();
checkAnswer(value);
}
//checkAnswer(value);
}
@SuppressLint("SetTextI18n")
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onClick(View v)
{
// checking which button is
// clicked by user
// in this case user choose false
if(rg.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select an option...", Toast.LENGTH_SHORT).show();
}
else {
value = ((RadioButton) findViewById(rg.getCheckedRadioButtonId()))
.getText().toString();
checkAnswer(value);
}
// a++;
switch (v.getId()) {
case R.id.next_button:
// go to next question
// limiting question bank range
a=0;
if (currentQuestionIndex <11) {
currentQuestionIndex
= currentQuestionIndex + 1;
questionTextView.setText(
"CORRECTNESS IS " + correct
+""
+ "OUT OF 10");
Image.setImageResource(
R.drawable.happy);
// showing correctness
}
else
Image.setImageResource(
R.drawable.resu);
//questionTextView.setText(
//"Better Luck Next Time!");
// if correctness<3 showing sad emoji
}
else {
updateQuestion();
}
}
break;
case R.id.prev_button:
if (currentQuestionIndex > 0) {
currentQuestionIndex
= (currentQuestionIndex - 1)
% questionBank.length;
updateQuestion();
}
break;
}
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void updateQuestion()
{
Log.d("Current",
"onClick: " + currentQuestionIndex);
questionTextView.setText(
questionBank[currentQuestionIndex]
.getAnswerResId());
option1.setText(questionBank[currentQuestionIndex].getoption1());
option2.setText(questionBank[currentQuestionIndex].getoption2());
option3.setText(questionBank[currentQuestionIndex].getoption3());
option4.setText(questionBank[currentQuestionIndex].getoption4());
Toast
.makeText(MainActivity3.this, toastMessageId,
Toast.LENGTH_SHORT)
.show();
}
}
4.MainActivity4.java
package com.example.quizapplication;
import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
};
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// setting up the buttons
// associated with id
// falseButton = findViewById(R.id.false_button);
//trueButton = findViewById(R.id.true_button);
nextButton = findViewById(R.id.next_button);
prevButton = findViewById(R.id.prev_button);
// register our buttons to listen to
// click events
questionTextView
= findViewById(R.id.answer_text_view);
Image = findViewById(R.id.myimage);
//falseButton.setOnClickListener(this);
//trueButton.setOnClickListener(this);
questionTextView.setText(R.string.a2);
option1 = findViewById(R.id.radioButton);
option2 = findViewById(R.id.radioButton2);
option3= findViewById(R.id.radioButton3);
option4= findViewById(R.id.radioButton4);
nextButton.setOnClickListener(this);
prevButton.setOnClickListener(this);
rg = (RadioGroup) findViewById(R.id.radiogroup);
option1.setText(R.string.op311);
option2.setText(R.string.op312);
option3.setText(R.string.op313);
option4.setText(R.string.op314);
if(rg.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select an option...", Toast.LENGTH_SHORT).show();
}
else {
value = ((RadioButton) findViewById(rg.getCheckedRadioButtonId()))
.getText().toString();
checkAnswer(value);
}
//checkAnswer(value);
}
@SuppressLint("SetTextI18n")
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onClick(View v)
{
// checking which button is
// clicked by user
// in this case user choose false
if(rg.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select an option...", Toast.LENGTH_SHORT).show();
}
else {
value = ((RadioButton) findViewById(rg.getCheckedRadioButtonId()))
.getText().toString();
checkAnswer(value);
}
// a++;
switch (v.getId()) {
case R.id.next_button:
// go to next question
// limiting question bank range
a=0;
if (currentQuestionIndex <11) {
currentQuestionIndex
= currentQuestionIndex + 1;
questionTextView.setText(
"CORRECTNESS IS " + correct
+""
+ "OUT OF 10");
Image.setImageResource(
R.drawable.happy);
// showing correctness
}
else
Image.setImageResource(
R.drawable.resu);
//questionTextView.setText(
//"Better Luck Next Time!");
// if correctness<3 showing sad emoji
}
else {
updateQuestion();
}
}
break;
case R.id.prev_button:
if (currentQuestionIndex > 0) {
currentQuestionIndex
= (currentQuestionIndex - 1)
% questionBank.length;
updateQuestion();
}
break;
}
}
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private void updateQuestion()
{
Log.d("Current",
"onClick: " + currentQuestionIndex);
questionTextView.setText(
questionBank[currentQuestionIndex]
.getAnswerResId());
option1.setText(questionBank[currentQuestionIndex].getoption1());
option2.setText(questionBank[currentQuestionIndex].getoption2());
option3.setText(questionBank[currentQuestionIndex].getoption3());
option4.setText(questionBank[currentQuestionIndex].getoption4());
Toast
.makeText(MainActivity4.this, toastMessageId,
Toast.LENGTH_SHORT)
.show();
}
}
5.Question.java
package com.example.quizapplication;
}
6.Testing :
7:Conclusion:
The advance booking module is an essential feature of a bakery POS. The bakery orders are freshly
made and usually take time to be prepared. In order to carry out deliveries in time, bakeries need
to be aware of the orders in advance.
A good bakery management system lets you accept orders in advance from the customers and rids
you of the hassles of maintaining a sheet for every order. Furthermore, it also lets you set reminders
and alerts to deliver the orders in time.
2. CRM Integration
Events like birthdays and anniversaries are primarily responsible for boosting any bakery’s sales. The
CRM module of a bakery management system captures this customer data from multiple sources and
updates it centrally in a single location.
The customer eating habits can be recognized using their order history data, which eventually helps
you in dishing out personalized SMS and email campaigns. Running loyalty programs also gets
easier when you know what your target customers prefer.
CRM module is also a good marketing tool for bakeries. Now that you’re aware of your customer’s
birthdays and anniversaries, you can send them personalized greetings and create a special
connection with them. Additionally, you can enhance customer delight on their special days by
offering them customized discounts on your bakery products.
Inventory management is critical for bakeries as most of the raw materials used in preparing bakery
products are perishable. Therefore, it has to be made sure that these perishable items are consumed
before their expiry date and are not eventually wasted. A bakery management system ensures that the
perishable items in stock are used first, and the customers are served with the freshest products,
thereby leading to better shelf-life management.
Besides, maintaining consistency is also one of the key things to take care of. The recipe
management feature of a bakery POS keeps track of the consumed ingredients in preparing any item,
thereby maintaining the same taste and consistency in all the items. Furthermore, since this feature
guides you to follow a standard recipe, it also helps keep the food costs in check.
The bakery management systems should be accessible on any device. You should be able to view the
reports and analytics from anywhere that you want. The mobility feature of a bakery POS lets you
access the reports and get the real-time bakery updates right on your mobile phone or any other
internet-enabled device. When the business data is so easily accessible, comparing multiple outlets’
performance also becomes more manageable.
In order to not miss a single order, especially during rush hours, a bakery POS must have the feature
of routing incoming calls to the next available line if the mainline is busy. The latest cloud
telephony technology allows you to access fully-managed telephone services via the internet at a
much lower cost. It does not require expensive hardware. It also gives you access to the call logs to
know the time spent on each order.
5. Detailed Reporting
Getting detailed reports is critical for knowing where your money is invested and where it is being
utilized. It’s important to know whether the efforts you are putting into your business are reaping the
best results. The detailed reports that a bakery management system provides help you to do an
in-depth analysis of your bakery’s sales and raw materials.
The in-depth daily, hourly, monthly, and annual reports of bakery sales help to know the pace
at which your business is expanding. Furthermore, ingredient-wise and item-wise reports give a
better grasp of the food costs and revenue earned per unit.
Central kitchen management makes it easier to handle multiple orders across multiple outlets
simultaneously. It is important to be aware of the day-to-day stock requirements to run all outlets
successfully. Managing a kitchen centrally gets you better control over the bakery operations.
You can easily view and track the baked, delivered, and wasted items from your inventory. In
addition, handling receipts becomes easier as the list of receivable and payable bills is present
centrally.
8.REFERENCES
1.https://www.scribd.com/document/261616931/Project-Report-on-Bakery-
Management-System
2.https://www.posist.com/restaurant-times/uk/bakery-management-system-fe
atures.html
3.https://api.flutter.dev/objcdoc/
4.https://docs.microsoft.com/en-us/visualstudio/ide/managing-references-in-a
-project?view=vs-2022