A sample application using internal storage

As a suitable example generally helps the understanding of a concept, let's create a quick bare bones file-updater application that utilizes internal storage. The operation of the file updater is simple. It collects text data from the user via an input field and updates a file stored in internal storage. A user can then check the text existing in that file from a view within the application. Simple, right? It's supposed to be! Create a new Android project and name it whatever you want. Just ensure that whatever name you give it reflects the purpose of the application. Once the project is created, create two new packages named base and main, within the src project package.

Add a BaseView interface ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.