Part of Android Development - ISMIN
Course followed by students of Mines St Etienne, ISMIN - M2 Computer Science.
TP1: Introduction to Kotlin
📝 Goal
The goal is to discover Kotlin and its ecosystem by implementing:
-
📙 A
Book
data class containing 4 string attributes:isbn
: International Standard Book Numbertitle
: Title of the bookauthor
: Author of the bookdate
: Date of publication of the book
-
📚 A
Bookshelf
class that internally store books and have the following public functions:addBook(book: Book)
getBook(isbn: String)
returning aBook
getBooksOf(author: String)
returning anList of
Book`s, alpha sorted by titlegetAllBooks()
returning aList of
Book`s, alpha sorted by titlegetTotalNumberOfBooks()
returning a number
To guide you and help you find out if everything is ✅ a test suite is available in BookshelfUnitTest.kt
.
These tests can be ran directly inside your IDE.
🚀 Getting Started
- Start Android Studio
- Select
Open an existing Android Studio project
and pick this directory
That's it! You can code!
🛰 Extra:
- Handle the
date
attribute as a LocaleDate and not a string - Add a test, and a function
getBooksPublishedBefore(aDate: LocaleDate)
returning aList
ofBook
s
🔑 Solution
An implementation of the TP is available on solution
branch. To switch to the solution just do:
# Commit or revert your local changes
# git add . && git commit -m "YOUR_MSG"
# Update your repository
git pull
# Switch to `solution` branch
git checkout solution