Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

INDUSTRY INTERNSHIP

SUMMARY REPORT

Virtual Internship - Android Application Development using Kotlin

BACHELOR OF TECHNOLOGY

in

COMPUTER SCIENCE AND ENGINEERING

Submitted by

Pritish Sinha (20SCSE1010033)

SCHOOL OF COMPUTING SCIENCE AND ENGINEERING


GREATER NOIDA, UTTAR PRADESH
Winter 2021 – 2022

1
BONAFIDE CERTIFICATE

2
INTERNSHIP CERTIFICATE

3
CERTIFICATE

I hereby certify that the work which is being presented in the Internship project report
entitled “Virtual Internship - Android Application Development using Kotlin“ in partial
fulfillment for the requirements for the award of the degree of Bachelor of Technology in the
School of Computing Science and Engineering of Galgotias University , Greater Noida, is an
authentic record of my own work carried out in the industry.
To the best of my knowledge, the matter embodied in the project report has not been
submitted to any other University/Institute for the award of any Degree.

Pritish Sinha(20SCSE1010033)

This is to certify that the above statement made by the candidate is correct and true to
the best of my knowledge.

Signature of Internship Coordinator Signature of Dean (SCSE)


Dr.N.Partheeban Dr. MUNISH SABHARWAL
Professor & IIIC Professor & Dean
School of Computing Science & Engineering School of Computing Science & Engineering
Galgotias University Galgotias University
Greater Noida. Greater Noida.

4
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO


Abstract 6
List of Figures 7
1 Introduction 8-13
Basics 8
Key Features 8-12
Applications 13
2 Technical Description 14-20
Pre-requisits 14
Setup 14-17
Hello World 17-20
4 System Implementation 21-24
5 Results and Discussions 25 -31
6 Conclusion and Future Work 32
7 Appendices 33
8 References 34

5
ABSTRACT

SmartBridge and Google have teamed up to create an outcome-driven skilling effort that will train

2000+ educators and 5000 students on  android application development in Kotlin programming.

This program has been recognised by AICTE for delivery as a virtual internship program to all

higher education students in India. Program will be executed in two phases, phase-1 is to teach the

educators on android skills and application lifecycle management and qualify them as "Mentor on

Campus" to drive the phase-2 of the program in campus called virtual internship program. The

virtual internship program is 100+ Hrs. experiential learning program containing hands-on

bootcamps, courses, learning resources and project work. Successful learners will be receiving the

virtual internship completion certificate. Also, they will get an opportunity to join the Google

developer community in India.

6
LIST OF FIGURES

FIG. NO TITLE PAGE. NO

1 Directory 14

2 Enviroment Setting 15

3 Path entry 16

4 Path 16

5 Cmd installation 17

6 Android Studio 21

7 Choose Template 22

8 Create Project 23

9 Codebase 24

10 Architecture 25

11 GCP Dashboard 26

12 GCP API services panel 26

13 Cred Page 27

14 Create API 27

15 API Library 29

16 Map SDK page 29

17 Building APK 30

18 Final Map 31

7
CHAPTER 1

INTRODUCTION

Android Basics in Kotlin

Kotlin is a cross-platform programming language that may be used as an alternative to Java for

Android App Development. Kotlin is much simpler for beginners to try as compared to Java and

this Kotlin Android Tutorial can also be used as an ‘entry point’ for Android App Development.

Kotlin is sponsored by Google, and announced as one of the official languages for Android

Development in 2017. Kotlin programming language is multi-platform, i.e. easily executable on a

Java Virtual Machine.

Example of Kotlin –

fun main()

println("Hello Geeks");

Key Features of Kotlin:

1. Statically typed – Statically typed is a programming language characteristic that


means the type of every variable and expression is known at compile time. Although it
is statically typed language, it does not require you to explicitly specify the type of
every variable you declare.
2. Data Classes– In Kotlin, there are Data Classes which lead to auto-generation of
boilerplate like equals, hashCode, toString, getters/setters and much more.
Consider the following example –

8
/* Java Code */

class Book {

private String title;

private Author author;

public String getTitle()

return title;

public void setTitle(String title)

this.title = title;

public Author getAuthor()

return author;

public void setAuthor(Author author)

9
this.author = author;

But in Kotlin only one line used to define the above class –

/* Kotlin Code */

data class Book(var title:String, var author:Author)

Concise – It drastically reduces the extra code written in other object-oriented programming
languages.

Safe – It provides the safety from most annoying and irritating NullPointerExceptions by

supporting nullability as part of its system.

Every variable in Kotlin is non-null by default.

String s = "Hello Geeks" // Non-null

If we try to assign s null value then it gives compile time error.So,

s = null // compile time error

To assign null value to any string string it should be declared as nullable.

String nullableStr? = null // compiles successfully

length() function also disabled on the nullable strings.

10
Interoperable with Java – Kotlin runs on Java Virtual Machine(JVM) so it is totally
interoperable with java. We can easily access use java code from kotlin and kotlin code from java.

Functional and Object Oriented Capabilities – Kotlin has rich set of many useful methods

which includes higher-order functions, lambda expressions, operator overloading, lazy evaluation,

operator overloading and much more.

Higher order function is a function which accepts function as a parameter or returns a function or

can do both.

Example of higher-order function –

fun myFun(company: String,product: String, fn: (String,String) -> String): Unit {

val result = fn(company,product)

println(result)

fun main(args: Array){

val fn:(String,String)->String={org,portal->"$org develops $portal"}

myFun("JetBrains","Kotlin",fn)

Output:
JetBrains develops Kotlin

Smart Cast – It explicitly typecasts the immutable values and inserts the value in its safe cast

automatically.

11
If we try to access a nullable type of String ( String? = “BYE”) without safe cast it will generate a

compile error.

fun main(args: Array){

var string: String? = "BYE"

print(string.length) // compile time error

fun main(args: Array){

var string: String? = "BYE"

if(string != null) { // smart cast

print(string.length)

Compilation time – It has higher performance and fast compilation time.

Tool- Friendly – It has excellent tooling support. Any of the Java IDEs – IntelliJ IDEA, Eclipse
and Android Studio can be used for Kotlin. We can also be run Kotlin program from command
line.

Advantages of Kotlin language:

12
● Easy to learn – Basic is almost similar to java.If anybody worked in java then easily
understand in no time.
● Kotlin is multi-platform – Kotlin is supported by all IDEs of java so you can write
your program and execute them on any machine which supports JVM.
● It’s much safer than Java.
● It allows using the Java frameworks and libraries in your new Kotlin projects by using
advanced frameworks without any need to change the whole project in Java.
● Kotlin programming language, including the compiler, libraries and all the tooling is
completely free and open source and available on github. Here is the link for Github
https://github.com/JetBrains/kotlin
Applications of Kotlin language:

● You can use Kotlin to build Android Application.


● Kotlin can also compile to JavaScript, and making it available for the frontend.
● It is also designed to work well for web development and server-side development.

13
CHAPTER 2

TECHNICAL DESCRIPTION

Prerequisite to install Kotlin –

Kotlin runs on Java Virtual Machine, so it is necessary to install JDK and set the path in local
system environment variable. To install the JDK and JRE in your system and set the path in
environment variable, please refer this article – Setting up the environment in Java.

Download the Kotlin compiler –

You can download the latest version of standalone compiler of kotlin form Github Releases. Now
the latest version is 1.3.31.

Setup the Kotlin compiler for command line –

● First of all, extract the downloaded file in any location where you have write access.
● Copy path upto bin directory of kotlinc.

14
Figure 1. Directory

● Now open my computer properties ->Advance System setting and then click on
environment variables.

Figure 2. Enviroment Setting

15
● Click on the path in system variables then edit button.

Figure 3. Path entry

● Now paste the copied path of bin directory here and click ok -> ok -> ok.

16
Figure 4. Path

● Verify the installation by typing kotlinc in command prompt.

Figure 5. Cmd installation

Hello World in Kotiln

Hello, World! is the first basic program in any programming language. Let’s write the first
program in Kotlin programming language.

The “Hello, World!” program in Kotlin: Open your favorite editor notepad or notepad++ and
create a file named firstapp.kt with the following code.

// Kotlin Hello World Program

fun main(args: Array<String>) {

println("Hello, World!")

17
}

You can compile the program in the command-line compiler.

$ kotlinc firstapp.kt

Now, Run the program to see the output in a command-line compiler.

$kotlin firstapp.kt

Hello, World!

Note: You can run the program in Intellij IDEA as shown in the Setting up the environment
article.

Details about the “Hello, World!” program –

Line #1: First line is a comment which is ignored by the compiler. Comments are added to the
program with the purpose to make the source code easy to read and understand by the readers.

Kotlin supports two types of comments as follows:

1. Single line comment

// single line comment

18
2. Multiple line comment

/* This is

multi line

comment

*/

Line #2: The second line defines the main function

fun main(args: Array<String>) {

// ...

The main() function is the entry point of every program. All functions in kotlin start fun keyword
followed by the name of function(here main is the name), a list of parameters, an optional return
type, and the body of the function ( { ……. } ).

In this case, main function contains the argument – an array of strings and return units. Unit type
corresponds to void in java means the function does not return any value.

19
Line #3: The third line is a statement and it prints “Hello, World!” to print the output of the
program.

println("Hello, World!")

20
CHAPTER 3

SYSTEM IMPLEMENTATION

Below are the steps to create a new project in Kotlin programming Language.

Step 1: In Welcome to Android Studio screen, select Start a new Android Studio Project.

Figure 6. Android Studio

Step 2: Select Empty Activity and click on the Next button.

21
Figure 7. Choose Template

Step 3: Here we write name of our application and select the language Kotlin for the project.

Then, click on the Finish button to launch the project.

22
Figure 8. Create Project

Step 4: Finally our newly created project opens which contains different number of files.

23
Figure 9. Codebase

24
CHAPTER 4

RESULTS AND DISCUSSIONS

Over the span of 30 days we were given to follow training modules and build 6 mini projects in

each learning phase. Final outcome An Android Application To Search Nearby Business Using

Kotlin

A mobile app is built where the user can search for his nearby locations based on his requirement.

Whenever the user gives input of business type like a hotel, petrol pumps, hospitals, etc. using

Place API and as a response we obtain the co-ordinates that are marked on the Google map.

Architecture:

Figure 11. Architecture

Below is an guide to build this application -

Create A Project In Cloud Console

In this milestone you will be working with the API. You need to create an project & enable the

place API

25
Steps For Creating A Project

Refer to the steps given and create a project on the cloud console

Figure 12. GCP Dashboard

Click on API & Services then click on Dashboard

26
Figure 13. GCP API services panel

Figure 14. Cred Page

Click on create credentials and then select API key

Figure 15.0 Create API

Click on the API key and the API key will be created.

27
Figure 15.1 Create API

Copy the API key and save it in Notepad.

Figure 15.2 Create API

Enable the Maps SDK for android

28
Figure 16. API Library

Figure 17. Map SDK page

Build The APK File


If you want to build the apk file for the app. Click on Build Build--->Build
Bundle/APK(s)--->Build APK.

29
Figure 18.0 Building APK

Gradle will build the APK file. Click on locate which will open the APK file path.

Figure 18.1 Building APK

30
The output APK file is obtained, and you share the file to android mobile and install it.

Figure 18.2 Building APK

The output of the APP.

Figure 19. Final Map

31
CHAPTER 5

CONCLUSION AND FUTURE WORK

This course is for anyone who wants to be a Kotlin programmer from scratch. The course will

start by fundamentals of Kotlin. You will first install the development environment then you will

run your first Kotlin app. Then you will learn about variables, math operation, priorities, logical

operations, making a decision, loops, how to work with files, functions and OOP concept that you

need to use when you program apps with Kotlin. You will learn about multi-processing and how

to run multi-process same time. You will learn how to build apps and game on Android like

Pokemon and tic tac toy and work with restful web services and JSON by build apps like getting

sunshine time. You will learn how to work with SQLite database to add, delete and update

records. Also, you will learn how to use Firebase for online gaming and build social media app

like twitter. Learn how to create apps with sensors like run music when a light is on, and Nimbuzz

vibrates when a phone is shaken.

32
CHAPTER 6

APPENDICES

Learning Experiences

a. Knowledge acquired:
● Step-by-Step procedure to develop mobile application
● Confirming the idea & market research - using Mural
● Wireframe design - using Figma
● Kotlin Basics
● Layouts
● Navigation
● Connect to the internet
● Data Persistence
● Work manager

Projects: Develop Android Applications powered by AI / ML API's (Vision API’s, Natural


Language API’s)

b. Skills learned:
● Expressive and concise: You can do more with less. Express your ideas and reduce the
amount of boilerplate code. 67% of professional developers who use Kotlin say Kotlin has
increased their productivity.
● Safer code: Kotlin has many language features to help you avoid common programming
mistakes such as null pointer exceptions. Android apps that contain Kotlin code are 20%
less likely to crash.
● Interoperable: Call Java-based code from Kotlin, or call Kotlin from Java-based code.
Kotlin is 100% interoperable with the Java programming language, so you can have as
little or as much of Kotlin in your project as you want.
● Structured Concurrency: Kotlin coroutines make asynchronous code as easy to work
with as blocking code. Coroutines dramatically simplify background task management for
everything from network calls to accessing local data.

33
CHAPTER 7

REFERENCES

Sites

● kotlinlang.org - The JetBrains site for all things Kotlin.

Tutorials

● Hello World - An interactive tutorial by JetBrains that illustrates Kotlin features and

syntax.

Videos

● Kotlin bootcamp for programmers: This Udacity course teaches you the essentials of

Kotlin.

● Introduction to Kotlin programming: This O'Reilly course provides an introduction to the

Kotlin language.

● Developing Android apps with Kotlin: This Udacity course shows you how to architect

and develop Android apps in Kotlin.

Books

● Android development with Kotlin: Learn how to make Android development much faster

using a variety of Kotlin features, from basics to advanced, to write better quality code.

34

You might also like