SEMINAR REPORT Final Year Project
SEMINAR REPORT Final Year Project
Bachelor of Technology
In
Computer Science Engineering
This is to certify that Industrial Training Project Report entitled “Android Development With
Kotlin” has been submitted by “Rohan Tanwar (20EAOCS048)” for partial fulfillment of the
Degree of Bachelor of Technology form Rajasthan Technical University, Kota.
It is found satisfactory and approved for submission.
1
Training Certificate
2
Candidate’s Declaration
I hereby declare that the work, which is being presented in the Industrial Training report, entitled
“Android Development with Kotlin ” in partial fulfillment for the award of Degree of
“Bachelor of Technology” in Department of Computer Science & Engineering with
Specialization in Computer Engineering and submitted to the Department of Computer
Science & Engineering, Arya Institute of Engineering Technology and Management, is a
record of my own investigations carried under the Guidance of Mr. Rakesh Sharma, Assistant
Professor, Department of Computer Science & Engineering.
Rohan Tanwar
20EAOCS048
3
Abstract
4
Acknowledgement
I would like to thank the Department of Computer Science & Engineering, Arya Institute of
Engineering Technology and Management, Head of Department Mr. Sanjay Tiwari for providing us
the opportunity to have such a training where we could get the exposure to competing and performing
with students from other colleges and universities.
I would also like to express my heartful gratitude to Mr. Deepak Chaudhary under whose guidance I
have been able to complete this training successfully and gain experience and knowledge about the
various topics of the subject.
I would also like to thank all the teaching assistants at Deloitte, Jaipur, they have been very helpful
throughout the process in solving our doubts motivating us to complete our tasks and assignments,
and helping us learn.
I would also like to express my deepest appreciation to Mrs. Poorva Rajawat for guiding me
throughout. The training and all the people who have directly or indirectly helped me to successfully
complete the training.
Rohan Tanwar
20EAOCS048
5
Learning/Internship Objectives
6
TABLE OF CONTENTS
5 Chapter 5: Inheritance 18
7
6 Chapter 6: Interfaces 20
6.1 Introduction and Implementing to Interfaces
6.2 Multiple Inheritance through Interfaces
7 Chapter 7: Arrays and Loops 22
7.1 Arrays in Kotlin
7.2 Looping Constructs
7.3 Working with Multidimensional Arrays
8 Chapter 8: Collections 24
8.1 Collection Framework in Kotlin
8.2 Lists, Sets, and Maps
9 Chapter 9: Nested Classes and Lambda 26
Expressions
9.1 Nested Classes in Kotlin
9.2 Lambda Expressions and Functional Interfaces
9.3 Benefits of Nested Classes and Lambdas
10 Chapter 10: Kotlin Streams API 28
10.1 Introduction to Streams
10.2 Stream Operations
10.3 Parallel Streams
10.4 Stream API Examples
11 Chapter 11: Handle Exceptions and Fix Bugs 30
11.1 Exception Handling in Kotlin
11.2 Try-Catch Blocks
11.3 Custom Exceptions
11.4 Debugging and Bug Fixing Techniques
12 Chapter 12: Kotlin IO API 32
12.1 Input and Output Streams
12.2 File Handling in Kotlin
12.3 Serialization and Deserialization
13 Chapter 13: Kotlin Concurrency 34
and Multithreading
8
13.2 Creating and Managing Threads
13.3 Synchronization and Thread Safety
19 References 48
9
Chapter 1
Introduction
Kotlin is a modern, statically typed programming language that runs on the Java Virtual Machine
(JVM) and can also be compiled into JavaScript or native code. It was developed by JetBrains and
officially supported by Google for Android app development.
1.1 Advantages Of Kotlin
Advantages of Kotlin Language:
Conciseness: Kotlin code is often more concise than Java, reducing boilerplate and improving
readability.
Null safety: Kotlin's type system helps prevent null pointer exceptions by distinguishing between
nullable and non-nullable types.
Interoperability: Kotlin is fully interoperable with Java, allowing for seamless integration with
existing Java codebases.
Functional programming support: Kotlin includes features such as higher-order functions,
lambdas, and coroutines, making it suitable for functional programming paradigms.
Extension functions: Kotlin allows for the addition of new methods to existing classes without
modifying their source code.
Coroutines: Kotlin supports lightweight threads known as coroutines, enabling easier
asynchronous programming
Overall, Kotlin offers a modern, expressive, and pragmatic approach to software development,
making it a popular choice for building Android apps, server-side applications, and more.
The primary goals behind Kotlin's development were to create a modern language that is fully
interoperable with Java, concise, safe, and pragmatic. Kotlin was designed to address common
pain points of Java development while leveraging the existing ecosystem and infrastructure of the
Java Virtual Machine (JVM).
10
In May 2017, Google announced first-class support for Kotlin on Android, further boosting its
adoption in the mobile app development community. Since then, Kotlin has gained popularity
not only in Android development but also in other domains such as server-side and web
development.
2. Configure Kotlin Plugin: Once IntelliJ IDEA is installed, open the IDE and go to
"Preferences" or "Settings." In the "Plugins" section, search for "Kotlin" and install the Kotlin
plugin.
3. Create a Kotlin Project: After installing the Kotlin plugin, create a new project in IntelliJ
IDEA and select Kotlin as the programming language.
4. Kotlin Compiler: If you prefer command-line development, you can also install the Kotlin
compiler (kotlin) and set up the environment variables to include the Kotlin bin directory in your
system's PATH.
5. Build Tools Integration: For using Kotlin with build tools like Gradle or Maven, refer to their
respective documentation for adding Kotlin support to your projects.
By following these steps, you can set up your development environment for Kotlin and start
writing Kotlin code for your projects.
11
Chapter 2
Primitive Types, Operators, and Flow Control Statements
Kotlin, known for its simplicity and robustness, offers a rich set of tools for handling primitive data,
applying operators, and controlling the flow of your programs. This chapter delves into these
fundamental elements, building the cornerstone of your Kotlin development journey.
12
1. if-else: Used for executing code based on a
condition. Syntax:
if (condition) {
// Code to execute if condition is true
} else {
// Code to execute if condition is false
}
Loops in Kotlin
Loops in Kotlin:
1. for loop: Used to iterate over a range, array, collection, or any other type of iterable data. Syntax:
while (condition) {
// Code to execute while the condition is true
}
3. do-while loop: Similar to a while loop, but the condition is evaluated after the code block has been
13
executed. Syntax:
do {
// Code to execute
} while (condition)
These loops provide the necessary control for iterating over data and repeating code based on specific
conditions in Kotlin programs.
14
Chapter 3
Classes and Objects
To operate on an object, you can reference it using a variable of a relevant type. Each object would
be capable of behaviors defined by a class that represents its type. At run time, objects invoke
operations upon each other to execute program logic.
3.3Classes in Kotlin:
Class and Object are two key object-oriented concepts. A class is a blueprint for creating objects. It
defines the structure and behavior an object will possess.
Class represents a type of thing or a concept, such as a Dog, Cat, Ball, or Person. Each class defines
what kind of information (attributes) it can store:
A Dog could have a name, color, and size.
A Ball would have type, material, and so on.
15
Constructors are special methods used for object initialization when an object is created.
Constructors have the same name as the class. They do not have a return type. Default constructors
are provided if none are defined.
In Java, classes and objects are the building blocks of your applications. Classes define the structure
and behavior of objects, and objects encapsulate data and methods for manipulation. Understanding
the principles of object-oriented programming, class definitions, and the role of constructors and
methods is vital for crafting effective and maintainable Java code.
16
Chapter 4
Improved Class Design
Access Modifiers: Java provides access modifiers like "public," "private," and "protected" to control
the visibility of class members. This enforces data hiding and prevents unauthorized access or
modification of data.
Getters and Setters: Getter methods allow controlled access to class attributes, while setter methods
ensure data integrity by validating and setting attribute values.
4.2 Inheritance and Polymorphism:
Inheritance: In Kotlin, classes can inherit properties and behaviors from other classes. This concept
fosters code reusability and promotes a hierarchical structure in software design.
Super classes and Subclasses: A superclass (parent class) contains common attributes and methods,
while subclasses (child classes) inherit and extend these features. Inheritance is achieved using the
"extends" keyword.
Method Overriding: Inheritance enables method overriding, where a subclass provides its own
implementation of a method defined in the superclass. This allows for specialized behavior in
subclasses.
Method Overloading: Java supports method overloading, where multiple methods in a class have the
same name but different parameters. This is determined by the method's signature, including the
number and types of parameters.
17
Abstract Classes: An abstract class is a class that cannot be instantiated and may contain abstract
methods (methods without a body). Subclasses must implement these abstract methods, providing
concrete functionality.
Interfaces: Interfaces define a contract of methods that implementing classes must adhere to. They
enable multiple inheritance in Kotlin and are widely used to define common behaviors across
unrelated classes.
Incorporating encapsulation, inheritance, polymorphism, abstract classes, and interfaces into class
design enhances the modularity and flexibility of your code. These principles empower you to create
sophisticated, extensible, and maintainable software systems in Kotlin.
18
Chapter 5
Inheritance
Inheritance Concept:
Inheritance promotes code reusability and extensibility by allowing new classes to inherit properties
and behaviors from existing classes.
In Kotlin, classes are organized into a hierarchical structure, with a single superclass and multiple
subclasses. The subclass inherits attributes and methods from the superclass, reducing redundancy
and promoting a modular approach to design.
Creating Subclasses:
To create a subclass, use the "extends" keyword, followed by the superclass name.
The subclass inherits attributes and methods from the superclass, including public and protected
members. Subclasses can extend superclass functionality by adding new attributes and methods or by
overriding existing ones.
5.2 Super classes and Subclasses in Kotlin :
Superclasses:
A superclass (also known as a parent class) is the class from which other classes inherit. Superclasses
typically contain common attributes and methods shared by multiple subclasses. Kotlin supports
single inheritance, meaning a class can have only one direct Superclass.
Subclasses:
Subclasses (child classes) inherit attributes and methods from their superclass. They can additional
attributes and methods specific to their own needs.
It allows you to create a new class that is a modified version of an existing class, saving time and
19
effort in software development.
Understanding the relationship between super classes and subclasses is crucial for designing robust
and scalable Kotlin applications. As you progress through this training program, you'll explore real-
world examples and best practices for utilizing inheritance effectively in your Kotlin projects.
20
Chapter 6
Interfaces
Introduction to Interfaces:
Implementing Interfaces:
21
Kotlin’s support for multiple inheritance through interfaces facilitates the creation of highly
modular and flexible code. It encourages the development of classes that adhere to specific contracts
while retaining the ability to combine multiple functionalities from different sources.
As you progress through this training program, you'll explore practical applications and examples of
interfaces, highlighting the importance of this versatile feature in Java programming.
In Kotlin, interfaces are used to define a contract for classes to implement. Key points about interfaces
in Kotlin include:
2. Methods: Interfaces can contain method signatures, but no method bodies. Classes that implement
an interface must provide the method implementations.
3. Properties: Interfaces can also have properties, which may be abstract or provide accessor
implementations.
4. Default Implementations: Interfaces can provide default implementations for methods, allowing
classes to optionally override them.
5. Multiple Inheritance: Unlike Java, Kotlin allows a class to implement multiple interfaces.
Overall, interfaces in Kotlin serve as a way to define a set of methods and properties that classes can
adhere to, enabling polymorphism and code organization.
22
Chapter 7
Arrays and Loops
Arrays are fundamental data structures in Java that allow you to store multiple values of the same
data type under a single variable name. This chapter explores the usage of arrays in Java,
emphasizing their importance and common operations.
In Kotlin, arrays are used to store a collection of elements of the same data type. Some key points
about arrays in Kotlin include:
1. Declaration: Arrays are declared using the arrayOf() function or the arrayOfNulls() function for
arrays of nullable references.
2. Accessing Elements: Elements in an array are accessed using the indexing operator ([]), starting
from index 0.
3. Size: The size of an array is fixed after initialization and can be obtained using the size property.
4. Primitive Arrays: Kotlin also provides specialized classes like IntArray, DoubleArray,
BooleanArray, etc., for arrays of primitive types to avoid boxing overhead.
5. Array Operations: Kotlin provides various functions and methods for working with arrays, such
as map, filter, reduce, and other higher-order functions.
Arrays in Kotlin provide a versatile way to work with collections of data, offering flexibility and
performance optimizations for different use cases.
7.2 Looping Constructs:
Looping constructs in Java allow for the repetitive execution of a block of code. Java provides several
types of loops, including for, while, and do-while loops.
• For Loop: A for loop is used when you know how many times a task needs to be
23
repeated. It has an initialization, condition, and an update statement.
• While Loop: A while loop repeats a block of code if a specified condition is true.
• Do-While Loop: A do-while loop is like a while loop, but it ensures that the block of
code is executed at least once before checking the condition.
In addition to one-dimensional arrays, Java supports multidimensional arrays, which are arrays of
arrays. These arrays are organized in rows and columns, forming a grid-like structure
Multidimensional Arrays:
• Declaration: Multidimensional arrays are declared with multiple sets of square brackets
(e.g., int[][] matrix;).
• Initialization: Multidimensional arrays can be initialized similarly to one-dimensional
arrays, with the dimensions specified (e.g., int[][] matrix = new int[3][4];).
• Accessing Elements: Elements in a multidimensional array are accessed by providing
indices for both rows and columns (e.g., int value = matrix[2][1];).
Understanding arrays and looping constructs is crucial for handling collections of data and
automating repetitive tasks in Kotlin programming. As you progress through this training program,
you'll delve into real-world examples and best practices for effectively utilizing arrays and loops in
Kotlin.
24
Chapter 8
Collections
• Collections: Collections are objects that group multiple elements into a single unit,
allowing for easy manipulation and traversal.
• Interfaces: The framework includes various interfaces, such as List, Set, and Map,
that provide a common set of methods for different types of collections.
• Implementations: The framework offers multiple implementations of these
interfaces, each tailored to specific needs and performance characteristics.
Lists:
Ordered: Lists maintain the order of elements in which they were
inserted. Duplicates Allowed: Lists allow duplicate elements.
Examples: ArrayList, LinkedList, Vector.
Sets:
Unordered: Sets do not guarantee any specific order of elements.
No Duplicates: Sets do not allow duplicate elements.
Examples: HashSet, LinkedHashSet, TreeSet.
Maps:
Key-Value Pairs: Maps store elements as key-value pairs, allowing for efficient
retrieval.
The Collection Framework simplifies the management of data structures, offering a consistent and
efficient approach to handling collections of data. Whether you need a dynamic list, a unique set, or
a key-value mapping, Kotlin’s Collection Framework provides a suitable solution.
25
As you delve deeper into this training program, you'll explore practical applications and examples
of working with different collection types, gaining a solid understanding of their role in Kotlin
development.
26
Chapter 9
Nested Classes and Lambda Expressions
Nested classes in Kotlin allow you to define a class within another class. This chapter explores the
concept of nested classes and their various types, shedding light on their role in code organization
and encapsulation.
1. Static Nested Classes: These are associated with the outer class, and they can be
accessed without creating an instance of the outer class.
2. Inner Classes: Also known as non-static nested classes, they are associated with an
instance of the outer class and have access to its members.
3. Local Classes: These classes are defined within a method, and their scope is limited to
that method.
4. Anonymous Inner Classes: These are defined and instantiated at the same time, often used
for event handling.
9.2 Lambda Expressions and Functional Interfaces:
Lambda expressions introduce a concise way to define anonymous functions in Java. This chapter
covers lambda expressions and their relationship with functional interfaces, which are interfaces
with a single abstract method. Lambda expressions enable you to write more readable and compact
code for certain operations, such as implementing interfaces or functional programming.’
In Kotlin, the syntax for a lambda function is as follows:
Where:
- `lambdaName` is the name given to the lambda function
- `parameters` are the input parameters, if any
- `returnType` is the return type of the lambda function
- `arguments` are the actual arguments passed to the lambda function
- The code inside the curly braces {} represents the body of the lambda function
For example:
27
val square: (Int) -> Int = { x ->
x*x
}
This defines a lambda function called "square" that takes an integer as input and returns its square.
9.3 Nested Classes
In Kotlin, nested classes are defined within the scope of another class. Some key points about nested
classes in Kotlin include:
1. Declaration: To define a nested class, use the "class" keyword within the body of another class.
2. Access to Outer Class Members: A nested class can access members of its outer class, but it does not
hold a reference to the outer class instance by default.
3. Instance Creation: Instances of a nested class can be created without an instance of the outer class.
4. Static by Default: Nested classes are static by default, meaning they do not have access to the instance of
the outer class unless explicitly referenced.
Example:
class Nested {
fun accessOuterProperty(outer: Outer) {
println(outer.outerProperty) // Accessing outer class property
}
}
}
In this example, "Nested" is a nested class within the "Outer" class. It can access the "outerProperty"
of the "Outer" class.
9.4 Benefits of Nested Classes and Lambdas:
• Encapsulation: Nested classes can encapsulate helper classes within the scope of a related
class, improving code organization and readability.
• Code Organization: It helps in organizing classes that are only used in one place and are not
relevant to the outside world.
28
• Access to Outer Class Members: Nested classes can access private members of their outer
class, which can be useful for sharing implementation details.
Benefits of Lambdas:
• Concise Code: Lambdas allow for more concise and expressive code, especially when working
with higher-order functions and functional programming patterns.
• Readability: Lambdas can improve the readability of code by allowing the definition of inline
functions without the need for separate function declarations.
• Flexibility: They provide a flexible way to pass behavior as an argument to functions, enabling
more dynamic and reusable code.
Both nested classes and lambdas contribute to the flexibility and expressiveness of Kotlin, allowing for
better code organization, improved readability, and more powerful functional programming
capabilities.
29
Chapter 11
Kotlin Streams API
While Kotlin does not have a dedicated "Streams API" like Java, the functionality provided by the Kotlin
Collections API offers similar capabilities for processing and transforming data in a functional and
declarative manner. These functions can be used with both standard collections and sequences, providing
a powerful and expressive way to work with data in Kotlin.
4. flatMap:Transforms each element into an iterable and flattens the results into a single list.
val nestedList = listOf(listOf(1, 2), listOf(3, 4), listOf(5, 6))
val flattened = nestedList.flatMap { it } // [1, 2, 3, 4, 5, 6]
These operations and more are available in the Kotlin Collections API, providing a functional and
expressive way to work with collections and sequences.
30
"e"); Stream<String> parallelStream =
list.parallelStream();
As you progress through this training program, you'll gain a comprehensive understanding of the
Kotlin Streams API, its operations, and how to harness the power of parallel streams to efficiently
process large datasets. Stream API examples will solidify your grasp of this essential Kotlin feature.
31
Chapter 12
Handle Exceptions and Fix Bugs
Exceptions: These are unexpected or erroneous events that can occur during the execution of a Java
program, such as dividing by zero, attempting to access a non-existent file, or encountering null
references.
Kotlin’s try-catch mechanism enables developers to identify and handle exceptions gracefully. A
try block encloses the code that might throw exceptions, while one or more catch blocks handle
those exceptions.
Syntax:
try {
// Code that may throw an exception
// ...
} catch (e: SomeException) {
// Handle the specific exception
// ...
} catch (e: AnotherException) {
// Handle another specific exception
// ...
} finally {
// Optional finally block for cleanup or resource releasing
// This block is executed regardless of whether an exception is thrown or not
// ...
}
32
11.4 Debugging and Bug Fixing Techniques:
Effective debugging is a critical skill for any programmer. This chapter covers essential debugging
techniques and strategies for identifying and rectifying code issues, ensuring the mooth execution
of Java programs.
Debugging Tools:
Integrated Development Environments (IDEs) offer debugging tools like breakpoints, watches, and
variable inspection.
Logging frameworks can help record events and errors for later analysis.
Profilers assist in identifying performance bottlenecks and memory issues.
33
Chapter 12
Kotlin IO API
12.1 Input and Output Streams:
Kotlin’s Input and Output (IO) API provides a versatile set of classes for reading and writing data.
This chapter explores the fundamental concepts of input and output streams, which are essential for
handling data in Kotlin applications.
Input Streams:
These are used to read data from various sources, such as files, network connections, or user input.
Input streams facilitate the flow of data from external sources into your Kotlin program
.
Output Streams:
These are used to write data to various destinations, including files, network connections, or user
output. Output streams enable your program to communicate data to external entities.
Saving and restoring the state of objects. Transmitting objects between networked applications.
34
Sharing data across different platforms or technologies.
As you progress through this training program, you'll gain practical experience in working with input
and output streams, handling files, and utilizing serialization and deserialization to manage data
effectively in Kotlin applications. These skills are vital for building robust and data-driven Kotlin
software.
35
Chapter 13
Kotlin Concurrency and Multithreading
13.1 Multithreading Basics:
Multithreading is a fundamental concept in Kotlin that enables the execution of multiple threads
simultaneously. This chapter delves into the core principles of multithreading and its importance in
concurrent programming.
Thread: A thread is the smallest unit of execution in a program. Multithreading allows you to run
multiple threads concurrently, providing a way to utilize system resources efficiently.
• Extending the Thread Class: You can create a new class that extends the Thread class
and overrides the run method. This new class represents a thread, which you can
instantiate and start.
• Implementing the Runnable Interface: You can create a class that implements the
Runnable interface. This class can then be passed to a Thread object for execution.
Implementing Runnable is often preferred as it allows for better resource management.
Thread Synchronization: Synchronization ensures that only one thread can access a synchronized
block or method at a time. This prevents multiple threads from interfering with each other when
modifying shared data.
36
Chapter 14
Kotlin Modules
A module is a self-contained unit of code that contains both code and data. It encapsulates a set of
packages and their associated classes and interfaces. Modules define clear boundaries and
dependencies, allowing developers to create more maintainable and robust applications. By using
modules, you can avoid classpath issues, reduce classloading errors, and enhance security.
Declaration:
module com.example.mymodule {
requires some.other.module;
exports
com.example.mypackage;
}
37
14.4 Modular Programming:
• Encapsulation: Modules encourage encapsulation. You can hide internal
implementation details and only expose the necessary API, improving security and
maintainability.
• Testing: Modules make it easier to write unit tests for your code. You can test
individual modules in isolation, ensuring that they work correctly.
Migration: If you're working on an existing project, consider migrating to modules gradually. You
can start by modularizing specific parts of your codebas
38
Chapter 15
Requirements
15.1 Software Requirements:
Before diving into Java development on Android Studio , it's essential to ensure that you
have the necessary software components in place. Some of the software requirements are:
1. Java Development Kit (JDK): Oracle Cloud, like most Java development environments,
relies on the JDK. Ensure that you have the latest version of the JDK installed. You can
download it from the official Oracle website or use open-source alternatives like OpenJDK.
2. Integrated Development Environment (IDE): While it's possible to write Java code
using a simple text editor, using a dedicated IDE can greatly improve your productivity.
Popular choices for Java development include Eclipse, IntelliJ IDEA, and NetBeans.
3. Android Studio SDK: Android Studio provides a Software Development Kit (SDK)
specifically designed for working with Oracle Cloud services. You should install this SDK
to interact with Oracle Cloud resources seamlessly.
4. Maven or Gradle: These build automation tools help manage project dependencies and
build your Java applications efficiently. Oracle Cloud supports both Maven and Gradle,
so choose the one that fits your project best.
5. Git: Using version control is a best practice in software development. Git is a widely
used version control system that helps track changes in your codebase.
6. Database Tools: If your Java application interacts with databases hosted on Oracle
Cloud, you'll need appropriate database tools or libraries to establish connections, manage
data, and perform queries.
7. Operating System Compatibility: Ensure that your operating system is compatible with
the required software. Most Kotlin development tools and SDKs are cross-platform.
15.2 Hardware Requirements:
For Kotlin development on Android Studio you don't need specific high-end hardware, as the
development work primarily happens in the software domain. However, you should consider the
following hardware requirements:
1. Computer: A modern computer with sufficient RAM (8GB or more is recommended) and a
39
reasonably fast processor will suffice for Java development. A dual-core processor is
generally adequate.
3. Storage: Ensure that you have enough storage space to accommodate your Java
development projects, the IDE, and other software tools. Consider an SSD for better
performance.
4. Monitor and Input Devices: A good quality monitor and standard input devices like a
keyboard and mouse are essential for comfortable and efficient coding.
40
Chapter 16
Project Implementation
The journey of project implementation began with the invaluable resource provided by Android
Studio: the virtual environment. This virtual lab environment served as the canvas on which the
project would be developed and brought to life. Leveraging the capabilities and resources within this
environment, the project's realization became a possibility.
The project in focus constitutes the graphical user interface with the help of applet, swing, and man.
This code plays a pivotal role in ensuring the functionality and efficiency of the survey, making it a
fundamental asset for the business to make further decisions.
Features
At the core of this project is a sophisticated Login system, implemented using Java's Applet and
Swing APIs. This system allows for the seamless collection, processing, and analysis of user to
authenticate the user weather he is a valid person to conduct a survey or not. Applet and Swing APIs
enable the efficient way to authorize a user by adding functionality of create a new user.
2. Integration of IO APIs
The project incorporates Java's Input and Output (IO) APIs to manage data and interactions with
external resources. These APIs facilitate tasks such as file handling, ensuring the secure and reliable
exchange of information between the e-commerce backend and external entities.
To adhere to the latest android studio standards and best practices, the project integrates concepts
from SE11. This includes the use of Modules, which enhance the project's modularity and
organization. Object- Oriented Programming (OOPs) principles are applied throughout the
codebase, emphasizing the importance of encapsulation, inheritance, and polymorphism for
maintaining a structured and extensible code.
41
4. ENUMS, Interfaces, and Access Modifiers
The project's rating system benefits from the utilization of ENUMS to represent Login System
categories systematically. This not only simplifies the code but also promotes a well-structured and
maintainable system. Interfaces, including functional interfaces, are employed to support modularity
and provide a common framework for implementing various aspects of the application. Access
modifiers are meticulously applied to control code visibility and usability, ensuring the codebase
adheres to established guidelines and maintains a high level of security.
The successful implementation of this project holds profound significance for the Survey
Management. It directly influences the website's ability to provide a seamless and user-friendly
experience, particularly through the efficient Login system. It also generate a random and unique
code for each and every survey to retrieve it easily
42
Chapter 17
Source Code and Output
43
Fig1.3: Output of Details
44
Fig1.5: Adding Some Details
45
Fig1.7: Output Console
46
Conclusion
The industrial training program in Kotlin on Android Studio has been a transformative experience.
It began with a solid foundation in Java's fundamentals and evolved into a comprehensive
exploration of advanced topics. We covered primitive types, object-oriented concepts, exception
handling, and Java's and Kotlin’s powerful features like streams and modules.
Our practical journey culminated in a real-world e-commerce project, showcasing our ability to
apply this knowledge. The project featured a dynamic rating system, stream APIs, lambda functions,
and more.
Supported by Firebase virtual environment and guided by mentors, we've gained a deep appreciation
for Kotlin’s versatility. This program equips us with the practical skills needed for a successful
career in software development.
47
References
Our primary sources of knowledge and guidance during this training program included:
1. Udemy Premium Course: The official documentation for Kotlin's new version, provided
by Google, served as our comprehensive reference for understanding Kotlin’s core
concepts and features.
3. Student Learning Guide and Activity Guide Booklets: The learning guides and activity
booklets offered by Oracle University were essential resources, guiding us through
practical exercises and reinforcing our understanding of Kotlin’s development on
Android Development.
These references were instrumental in our journey of acquiring knowledge and skills in
Android development, making them invaluable assets in our training experience.
48