hapces_timer_app

Overview

HAPCES Timer App is an Android app demonstrating consuming the HAPCES CCB API to allow timed control of home automation devices.

Features

Supported platforms

Due to time constraints, the CCB API currently only provides an openhabadapter (supporting the openhab home automation platform) hence the app currently only supports the openhab platform. However, if CCB API releases adapters for other platforms, these may be added to the app to enable timed control of devices associated with those platforms.

Supported devices

Due to time constraints, only switch devices are currently supported.

Video Demonstration

Click here for mp4 video file.

Screens

Project Structure

hapces_timer_app: this project
|   README.md: this file
|
+---HapcesTimerApp: Android project folder 
|   |   build.gradle: build settings for all modules
|   |
|   \---app
|       |   build.gradle: build settings for single module
|       |
|       \---src: source code
|           \---main
|               |   AndroidManifest.xml: app declarations (e.g., permissions, etc.)
|               |
|               +---.../hapcestimerapp
|               |   |
|               |   +---db: database related components
|               |   |   |   DbHelper.java: helper class for managing database
|               |   |   |
|               |   |   \---models: models used with database
|               |   |           LinkedDevice.kt: represents 
|               |   |           TimerData.java
|               |   |           UserData.java
|               |   |
|               |   +---net: network related components
|               |   |   |   NetHelper.java: helper class for managing network features
|               |   |   |
|               |   |   +---ccbapiservice: ccb api related components
|               |   |   |   |   RetrofitClient.java: manages retrofit api implementations
|               |   |   |   |
|               |   |   |   +---models: models used with ccb api
|               |   |   |   |       CcbDevice.java
|               |   |   |   |       CcbFeature.java
|               |   |   |   |       CcbState.kt
|               |   |   |   |       TimerDevice.kt
|               |   |   |   |
|               |   |   |   \---openhabadapter: ccb openhab integration components
|               |   |   |           CcbOpenhabApi.java: ccb endpoints used by this app
|               |   |   |           CcbOpenhabApiHelper.java: helper class for ccb openhab api
|               |   |   |           CcbOpenhabClient.java: retrofit implementation for ccb api
|               |   |   |
|               |   |   \---tasks: network task related components
|               |   |           CommandStatesTask.java: sends commands to CcbStates
|               |   |           FetchDevicesTask.java: fetches CcbDevices as TimerDevices
|               |   |           FetchStatesTask.java: fetches CcbStates
|               |   |           PingCcbTask.java: checks connection with ccb api
|               |   |           TaskResultListener.java: listens for task result/error
|               |   |
|               |   +---screens: user interface related components
|               |   |   |   DialogHelper.java: helper class for managing dialogs
|               |   |   |   DurPickerDialog.java: manages duration picker dialog
|               |   |   |   EditTimerActivity.java: manages edit timer screen
|               |   |   |   MainActivity.java: manages login before loading timer screen
|               |   |   |   SettingsActivity.java: manages settings screen
|               |   |   |   TimerListActivity.java: manages timer screen
|               |   |   |
|               |   |   +---choosedevices: components for choose devices screen
|               |   |   |       ChooseDeviceAdapter.java: manages list items
|               |   |   |       ChooseDevicesActivity.java: manages choose devices screen
|               |   |   |
|               |   |   \---deviceslist: components for devices list screen
|               |   |           DeviceListAdapter.java:  manages list items
|               |   |           DevicesListActivity.java: manages devices list screen
|               |   |
|               |   \---timerservice: components for managing timer
|               |       |   TimerService.java: manages StateTimer
|               |       |
|               |       +---noti: notification related components
|               |       |       NotiChannelHelper.java: helper class for notification channels
|               |       |       NotiHelper.java: helper class for managing notifications
|               |       |
|               |       \---timers: timer related components
|               |               StartStopTimer.java: simple start/stop countdown timer
|               |               StateTimer.java: timer that controls CcbStates on start/stop
|               |
|               \---res: resources
|                   +---drawable: image resources as xml (e.g., menu icons)
|                   |       ...
|                   |
|                   +---layout: layout components
|                   |       ...
|                   |       elv_group_header.xml: header view for group in list
|                   |       elv_item_choose_device.xml: list item view for choose devices
|                   |       elv_item_device_list.xml: list item view for devices list
|                   |       pref_et_password.xml: custom layout allows password mask/toggle
|                   |
|                   +---menu: menu layout components
|                   |       ...
|                   |
|                   +---values
|                   |       colors.xml: app color values
|                   |       dimens.xml: layout dimension values
|                   |       strings.xml: app strings
|                   |       styles.xml: app styles
|                   |
|                   \---xml
|                           settings_preferences.xml: layout for settings preferences
|
+---readmes: readme files for each screen
|       ...
|
\---screenshots: screenshots for each screen's readme
    ...