Simple Android app which shows when next Luas is due at predefined locations, depending on time of day, as tool for commuters.
- If before midday, shows next trams arriving at Marlborough Luas stop, with Outbound direction.
- If after midday (12:01pm and later), shows next trams arriving at Stillorgan Luas stop, with Inbound direction.
Shows which station currently showing information for.
Has refresh button which will fetch latest information.
Luas colour scheme used, as sampled on luas.ie, combining Luas purple with Transport for Ireland (TFI) green.
While simple, the app uses good practice, clean design and standards (except importantly lacking DI!)
- Written in Kotlin language
- MVVM architecture pattern used, separating back end (network access) into separate
api
module, used byViewModel
s, which update presentation layer viaLiveData
and accept actions as method calls - Data binding used to inflate layouts and pragmatically interact with layout
View
s. Where possible connectViewModel
directly into declarative XML - Koltin Coroutines used with RetroFit2 to fetch network API data, with TikXml library to parse XML
- Material Design Components (MDC) used, gives simple familiar Android standard UI look and feel
- Dark mode support (automatically by MDC, but with additional tweaks)
- Best practice string and dimension management used, ready for localisation and various custom screen size supports if required
Note also that SingleLiveEvent
class is transplanted in (as Java code, with some modifications) from Google examples. This is a really useful class for one time message delivery from ViewModel
to Fragment
using LiveData
pattern.
The app is currently very simple and lacks several features user will likely expect.
Future feature work could include:
- Allow user to set stations! Currently hardcoded
- Automatic polling of Luas forecast information
- Local information cache, in case of temporary internet disconnection, and showing last available information
Future technical work:
- Use dependency injection (DI) instead of ad hoc singleton objects, for RetroFit2 and TikXml 3rd party lib instances, and internal
PublicInfoDisplaySource
object. - Use repository pattern with caching, instead of direct data source usage in
ViewModel
- Add unit and instrumentation tests! Code is prepared for this but not yet implemented.