0% found this document useful (0 votes)
445 views

Bakery Management System

This document provides an overview of implementing and testing a bakery management mobile application built with Flutter. It includes: 1. An introduction describing the problem statement, objectives, and scope of creating an app to manage a bakery's online operations. 2. A technology review covering the tools used - Android Studio, Flutter, Visual Studio, and Dart. 3. System requirements including software like Android version and IDEs, and hardware like RAM and storage needed. 4. A use case diagram showing the user as the main actor and use cases like viewing products and placing orders. 5. An implementation section outlining how to set up the Flutter environment, create a test app,

Uploaded by

R Bharath Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
445 views

Bakery Management System

This document provides an overview of implementing and testing a bakery management mobile application built with Flutter. It includes: 1. An introduction describing the problem statement, objectives, and scope of creating an app to manage a bakery's online operations. 2. A technology review covering the tools used - Android Studio, Flutter, Visual Studio, and Dart. 3. System requirements including software like Android version and IDEs, and hardware like RAM and storage needed. 4. A use case diagram showing the user as the main actor and use cases like viewing products and placing orders. 5. An implementation section outlining how to set up the Flutter environment, create a test app,

Uploaded by

R Bharath Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

A

Report
on

BAKERY MANAGEMENT SYSTEM


Submitted for partial fulfillment of the requirements for the award of the degree of

BACHELOR OF ENGINEERING

in

COMPUTER SCIENCE AND ENGINEERING

By

Valijala Arjun ( 2451-18-733-301)


Madhira Goovardhan ( 2451-18-733-302)
Mekala Raju (2451-18-733-303)

MATURI VENKATA SUBBA RAO (MVSR) ENGINEERING COLLEGE


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
(Affiliated to Osmania University & Recognized by AICTE)
Nadergul(V), Balapur(M), Ranga Reddy(D), Hyderabad – 501 510, Telangana, INDIA

( Academic Year: 2021 - 2022 )


INDEX

SNo Contents Page no.

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

4. Build the app

5. Unit testing the provider

6. Widget testing

7. Testing app UI and performance with integration


tests

6 Testing and Results 11

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.

CHAPTER 2- TECHNOLOGY REVIEW


2.1. Android StudiO
The application can run on an emulator or can be installed on a mobile device.

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.


2.3 Visual Studio :

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

Operation system Windows 64 bit Android version 4(min) -

IDE Android Studio



-

SDK Version 31 31(Min SDK Version) -


SRE Android Emulator Android Android
Application application

Table 3.1: Software Requirements

3.2 Hardware Requirements

Development Deployment

CPU Intel core i5 (8th gen) Octa Core

RAM 8GB 2GB

HDD 1GB free space 1 GB free space

Network 2.5 Mbps 2.5Mbps

Table 3.2: Hardware Requirements

CHAPTER 4- SYSTEM DESIGN


4.1 Use Case Diagram

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”.

● Score > 3 && Score <3


Class Diagram :
Document from Raj

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.

2. Set up your Flutter environment


You need two pieces of software to complete this lab: the Flutter SDK, and an editor.

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 new Flutter app & update dependencies


This codelab focuses on testing a Flutter mobile app. You will quickly create the app to be tested using
source files that you copy and paste. The rest of the codelab then focuses on learning different kinds of
testing.

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.

4. Build the app


Next, you'll build out the app so that you can test it. The app contains the following files:

● lib/main.dart - the main file where the app starts


● lib/screens/home.dart - creates a list of items
● lib/screens/favorites.dart - creates the layout for the favorites list
● lib/models/favorites.dart - creates the model class for favorites list

Replace the contents of lib/main.dart

Replace the contents of lib/main.dart with the following code:

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());
}

class TestingApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<Favorites>(
create: (context) => Favorites(),
child: MaterialApp(
title: 'Testing Sample',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
routes: {
HomePage.routeName: (context) => HomePage(),
FavoritesPage.routeName: (context) => FavoritesPage(),
},
initialRoute: HomePage.routeName,
),
);
}
}

Add the Home page in lib/screens/home.dart

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';

class HomePage extends StatelessWidget {


static String routeName = '/';

@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),
),
);
}
}

class ItemTile extends StatelessWidget {


final int itemNo;

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),
),
);
},
),
),
);
}
}

Add the Favorites page in lib/screens/favorites.dart


In the lib/screens directory create another new file named favorites.dart. In that file add the
following code:

lib/screens/favorites.dart
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:testing_app/models/favorites.dart';

class FavoritesPage extends StatelessWidget {


static String routeName = '/favorites_page';

@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]),
),
),
);
}
}

class FavoriteItemTile extends StatelessWidget {


final int itemNo;

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),
),
);
},
),
),
);
}
}

Lastly, create the Favorites model in lib/models/favorites.dart

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 = [];

List<int> get items => _favoriteItems;

void add(int itemNo) {


_favoriteItems.add(itemNo);
notifyListeners();
}

void remove(int itemNo) {


_favoriteItems.remove(itemNo);
notifyListeners();
}
}

The app is now complete, but untested.

Run the test

If your app is running in your emulator or device, close it before continuing.

At the command line, navigate to the project's root directory and enter the following command:

$ flutter test test/models/favorites_test.dart

If everything works, you should see a message similar to the following:

00:06 +2: All tests passed!

The complete test file: test/models/favorites_test.dart.

Tip: You can run all the tests in the test directory at once by running:
$ flutter test

For more information on unit testing, visit An introduction to unit testing.

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.

Start by testing the HomePage widget.

Create a new test file


The first test verifies whether scrolling the HomePage works properly.

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.

Add the following code snippet to home_test.dart:

test/home_test.dart
group('Home Page Widget Tests', () {

// BEGINNING OF NEW CONTENT


testWidgets('Testing if ListView shows up', (tester) async {
await tester.pumpWidget(createHomeScreen());
expect(find.byType(ListView), findsOneWidget);
});
// END OF NEW CONTENT

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);
});
});

Run the test


You can run widget tests in the same way as unit tests, but using a device or an emulator allows you to
watch the test running. It also gives you the ability to use hot restart.

Plug-in your device or start your emulator.

From the command line, navigate to the project's root directory and enter the following command:

$ flutter run test/home_test.dart

If everything works you should see an output similar to the following:

Launching test/home_test.dart on Mi A3 in debug mode...


Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 62.7s
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk... 5.8s
Waiting for Mi A3 to report its views... 16ms
I/flutter ( 1616): 00:00 +0: Home Page Widget Tests Testing if ListView shows up
Syncing files to device Mi A3...
I/flutter ( 1616): 00:02 +1: Home Page Widget Tests Testing Scrolling
Syncing files to device Mi A3... 4,008ms (!)
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on Mi A3 is available at:
http://127.0.0.1:40433/KOsGesHSxR8=/
I/flutter ( 1616): 00:00 +0: Home Page Widget Tests Testing if ListView shows up
I/flutter ( 1616): 00:02 +1: Home Page Widget Tests Testing Scrolling
I/flutter ( 1616): 00:09 +3: All tests passed!

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.

The complete test file: test/home_test.dart.

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';

late Favorites favoritesList;

Widget createFavoritesScreen() => ChangeNotifierProvider<Favorites>(


create: (context) {
favoritesList = Favorites();
return favoritesList;
},
child: MaterialApp(
home: FavoritesPage(),
),
);

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);
});

testWidgets('Testing Remove Button', (tester) async {


await tester.pumpWidget(createFavoritesScreen());
addItems();
await tester.pumpAndSettle();
var totalItems = tester.widgetList(find.byIcon(Icons.close)).length;
await tester.tap(find.byIcon(Icons.close).first);
await tester.pumpAndSettle();
expect(tester.widgetList(find.byIcon(Icons.close)).length,
lessThan(totalItems));
expect(find.text('Removed from favorites.'), findsOneWidget);
});
});
}

This test verifies whether an item disappears when the close (remove) button is pressed.

For more information on widget testing, visit:

● An introduction to widget testing


● Find widgets
● Tap, drag, and enter text
● The flutter_testlibrary
● The WidgetTester class

7. Testing app UI and performance with integration tests


Integration tests are used to test how individual pieces of an app work together as a whole. The
integration_test library is used to perform integration tests in Flutter. This is Flutter's version of
Selenium WebDriver (generic web), Protractor (Angular), Espresso (Android), or Earl Gray (iOS). The
package internally uses flutter_driver to drive the test on a device.
Instrument the app
In order to write an integration test, you must first instrument the app. Instrumenting the app means
configuring the app so that the driver can access its GUI and functions for the purpose of creating and
running an automated test. Integration tests are placed in a directory called integration_test. In this
step, you'll add the following files for integration testing:

● integration_test/driver.dart - Instruments the app


● integration_test/app_test.dart - Runs the actual tests on the app

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';

Future<void> main() => integrationDriver();

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.

Write the test

Create a new file and name it app_test.dart.

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());

final listFinder = find.byType(ListView);

await binding.watchPerformance(() async {


await tester.fling(listFinder, Offset(0, -500), 10000);
await tester.pumpAndSettle();

await tester.fling(listFinder, Offset(0, 500), 10000);


await tester.pumpAndSettle();
}, reportKey: 'scrolling_summary');
});

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.

Next, test the add and remove operations.

Paste the following test into the same group:


integration_test/app_test.dart
testWidgets('Favorites operations test', (tester) async {
await tester.pumpWidget(TestingApp());

final iconKeys = [
'icon_0',
'icon_1',
'icon_2',
];

for (var icon in iconKeys) {


await tester.tap(find.byKey(ValueKey(icon)));
await tester.pumpAndSettle(Duration(seconds: 1));

expect(find.text('Added to favorites.'), findsOneWidget);


}

await tester.tap(find.text('Favorites'));
await tester.pumpAndSettle();

final removeIconKeys = [
'remove_icon_0',
'remove_icon_1',
'remove_icon_2',
];

for (final iconKey in removeIconKeys) {


await tester.tap(find.byKey(ValueKey(iconKey)));
await tester.pumpAndSettle(Duration(seconds: 1));

expect(find.text('Removed from favorites.'), findsOneWidget);


}
});

Run the test


Plug-in your device or start your emulator.

At the command line, navigate to the project's root directory and enter the following command:

$ flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart --profile

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.

If everything works, you should see an output similar to the following:

Running "flutter pub get" in step_07... 930ms


Running Gradle task 'assembleProfile'...
Running Gradle task 'assembleProfile'... Done 31.3s
✓ Built build/app/outputs/flutter-apk/app-profile.apk (11.3MB).
Installing build/app/outputs/flutter-apk/app.apk... 277ms
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:62862/K6QKjUNab8c=/
VMServiceFlutterDriver: Isolate found with number: 1935648057883071
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter (24385): 00:00 +0: Testing App Performance Tests Scrolling test
VMServiceFlutterDriver: Connected to Flutter application.
I/flutter (24385): 00:08 +1: Testing App Performance Tests Favorites operations
test
I/flutter (24385): 00:17 +2: Testing App Performance Tests (tearDownAll)
I/flutter (24385): 00:17 +3: All tests passed!
All tests passed.

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.

The complete test file: integration_test/app_test.dart.

For more details on Flutter Driver (Integration) testing, visit:

● An introduction to integration testing


● integration_test library docs

6.1 Main Activity

Figure 6.1 Main Activity

6.2 Distributed System


Figure 6.2 Distributed System

6.2.1 Toast Message

Figure 6.3 Toast Message

6.3 Data Science using R


Figure 6.3.1 Data Science using R

6.4 Information Security

Figure 6.4.1 Information Security

6.5 Score less than 3


Figure 6.5.1 Score less than 3

6.6 Score more than 3


Figure 6.6.1 Score more than 3

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());

// setting the textview with new question


/*switch (currentQuestionIndex) {
case 1:
// setting up image for each
// question
Image.setImageResource(R.drawable.f2);
break;
case 2:
Image.setImageResource(R.drawable.f3);
break;
case 3:
Image.setImageResource(R.drawable.f4);
break;
case 4:
Image.setImageResource(R.drawable.f5);
break;
case 5:
Image.setImageResource(R.drawable.f6);
break;
case 6:
Image.setImageResource(R.drawable.f7);
break;
case 7:
Image.setImageResource(R.drawable.f1);
break;
}*/
}
private void checkAnswer(String userChooseCorrect)
{
String answerIsTrue
= questionBank[currentQuestionIndex].isAnswerTrue();
// getting correct ans of current question
int toastMessageId;
// if ans matches with the
// button clicked
if(answerIsTrue!=null){
if (userChooseCorrect.equals(answerIsTrue)) {
toastMessageId = R.string.correct_answer;
//if(a==1)
correct++;
}
else {
// showing toast
// message correct
//a=1;
toastMessageId = R.string.wrong_answer;
}
}
else
toastMessageId=R.string.select_answer;

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;

public class MainActivity2 extends AppCompatActivity {

@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;

public class MainActivity3 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.a1, "Causal",R.string.op211,R.string.op212,R.string.op213,R.string.op214),
new Question(R.string.b1, "stripplot()",R.string.op221,R.string.op222,R.string.op223,R.string.op224),
new Question(R.string.c1, "Open source",R.string.op231,R.string.op232,R.string.op233,R.string.op234),
new Question(R.string.d1, "John Chambers",R.string.op241,R.string.op242,R.string.op243,R.string.op244),
new Question(R.string.e1, "Command line
interpreter",R.string.op251,R.string.op252,R.string.op253,R.string.op254),
new Question(R.string.f1, "6",R.string.op261,R.string.op262,R.string.op263,R.string.op264),
new Question(R.string.g1, "c()",R.string.op271,R.string.op272,R.string.op273,R.string.op274),
new Question(R.string.h1, "Function",R.string.op281,R.string.op282,R.string.op283,R.string.op284),
new Question(R.string.i1, "All of the mentioned",R.string.op291,R.string.op292,R.string.op293,R.string.op294),
new Question(R.string.j1, "All steps should be
noted",R.string.op2101,R.string.op2102,R.string.op2103,R.string.op2104),

};

@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;

// we are safe now!


// last question reached
// 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());

// setting the textview with new question


}
private void checkAnswer(String userChooseCorrect)
{
String answerIsTrue
= questionBank[currentQuestionIndex].isAnswerTrue();
// getting correct ans of current question
int toastMessageId;
// if ans matches with the
// button clicked
if(answerIsTrue!=null){
if (userChooseCorrect.equals(answerIsTrue)) {
toastMessageId = R.string.correct_answer;
//if(a==1)
correct++;
}
else {
// showing toast
// message correct
//a=1;
toastMessageId = R.string.wrong_answer;
}
}
else
toastMessageId=R.string.select_answer;

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;

public class MainActivity4 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.a2, "Information Security",R.string.op311,R.string.op312,R.string.op313,R.string.op314),
new Question(R.string.b2, "Threat",R.string.op321,R.string.op322,R.string.op323,R.string.op324),
new Question(R.string.c2, "ignored",R.string.op331,R.string.op332,R.string.op333,R.string.op334),
new Question(R.string.d2, "Vulnerability",R.string.op341,R.string.op342,R.string.op343,R.string.op344),
new Question(R.string.e2, "Encryption",R.string.op351,R.string.op352,R.string.op353,R.string.op354),
new Question(R.string.f2, "Hacking",R.string.op361,R.string.op362,R.string.op363,R.string.op364),
new Question(R.string.g2, "To protect your computer from all known
viruses",R.string.op371,R.string.op372,R.string.op373,R.string.op374),
new Question(R.string.h2, "Hacking",R.string.op381,R.string.op382,R.string.op383,R.string.op384),
new Question(R.string.i2, "Avoid, Transfer, Accept,
Mitigate",R.string.op391,R.string.op392,R.string.op393,R.string.op394),
new Question(R.string.j2, "Biometric authentication
factors",R.string.op3101,R.string.op3102,R.string.op3103,R.string.op3104),

};

@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;

// we are safe now!


// last question reached
// 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());

// setting the textview with new question


/*switch (currentQuestionIndex) {
case 1:
// setting up image for each
// question
Image.setImageResource(R.drawable.f2);
break;
case 2:
Image.setImageResource(R.drawable.f3);
break;
case 3:
Image.setImageResource(R.drawable.f4);
break;
case 4:
Image.setImageResource(R.drawable.f5);
break;
case 5:
Image.setImageResource(R.drawable.f6);
break;
case 6:
Image.setImageResource(R.drawable.f7);
break;
case 7:
Image.setImageResource(R.drawable.f1);
break;
}*/
}
private void checkAnswer(String userChooseCorrect)
{
String answerIsTrue
= questionBank[currentQuestionIndex].isAnswerTrue();
// getting correct ans of current question
int toastMessageId;
// if ans matches with the
// button clicked
if(answerIsTrue!=null){
if (userChooseCorrect.equals(answerIsTrue)) {
toastMessageId = R.string.correct_answer;
//if(a==1)
correct++;
}
else {
// showing toast
// message correct
//a=1;
toastMessageId = R.string.wrong_answer;
}
}
else
toastMessageId=R.string.select_answer;

Toast
.makeText(MainActivity4.this, toastMessageId,
Toast.LENGTH_SHORT)
.show();
}
}

5.Question.java

package com.example.quizapplication;

public class Question {

// answerResId will store question


private int answerResId;

// answerTrue will store correct answer


// of the question provided
private String answerTrue;
int op1;int op2; int op3;int op4;
public Question(int answerResId, String answerTrue, int op1,int op2, int op3,int op4)
{
// setting the values through
// arguments passed in constructor
this.answerResId = answerResId;
this.answerTrue = answerTrue;
this.op1=op1;
this.op2=op2;
this.op3=op3;
this.op4=op4;
}

// returning the question passed


public int getAnswerResId()
{
return answerResId;
}

// setting the question passed


public void setAnswerResId(int answerResId)
{
this.answerResId = answerResId;
}

// returning the correct answer


// of question
public String isAnswerTrue()
{
return answerTrue;
}

// setting the correct


// ans of question
public void setAnswerTrue(String answerTrue)
{
this.answerTrue = answerTrue;
}
public int getoption1(){
return op1;
}
public int getoption2(){
return op2;
}
public int getoption3(){
return op3;
}
public int getoption4(){
return op4;
}

}
6.Testing :
7:Conclusion:

1. Advanced Booking Module

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.

3. Shelf Life And Recipe Management

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.

4. Mobility & Cloud Telephony

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.

6. Central Kitchen Management

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

You might also like