Let’s Build a File Explorer in Kotlin

Gurleen Sethi
TheTechnoCafe
Published in
3 min readSep 6, 2018

Have you been away from Kotlin for a while? Wanna practice your Kotlin skills? Wanna build an Android app in Kotlin?

If yes, then I have something for you.

I have written a 5 part tutorial series, in which you will build a basic File Explorer application in Android using Kotlin.

You will start from scratch, setting up the UI and then implementing the corresponding functionality. I will guide you through every feature that is included in the application and keep showing you tips and tricks about Kotlin every now and then. All in all this is a great way to refresh your Kotlin skills.

Kotlin File Explorer

Below are screenshots of completed application.

The source code of completed application can be found at this GitHub repo (Clone the repo as it will help you whenever you are stuck).

Tutorial Series

Part 1 — Introduction and Set up

You will start with setting up an empty project and configure permissions that are required for accessing the file system in Android. You will add a basic File Provider which is required as of Android 7.0.

Part 2 — Reading files from paths

In this part you will set up functions that will read files from a particular path in the file system. Then you will display these files in RecyclerView for the user to see and interact with. This might sound simple but we will implement this functionality with reusability in mind so there is more to it than you think!

Part 3 — Navigating through File System

After you are done reading files from a path, you will add the functionality for the user to navigate through the file system i.e. whenever the user clicks on a folder, you will open up the list of files contained inside that folder and so on.

Part 4 — Adding Breadcrumbs

Now comes the fun part. You might have seen in many file manager applications, in the Toolbar they have a way to navigate back to a point in the file system where you came from, these are called breadcrumbs. You will implement this feature!

Part 5 — Creating/Deleting files and folders

In this part you will add feature to create/delete file and folders anywhere in the file system.

Part 6— Copying/Moving files and folders

I have written a 5 part tutorial series, and you might wonder why is 6th part mentioned. No! this is not a tutorial. This is your homework :D

I hope you enjoy this short series on Kotlin.

Many more series to come!

TheTechnoCafe

--

--