If you are looking for documentation around companion applications see the Domestic Helper Documentation. It will give you instructions on how to use the applications.
Setup the App Development Environment
-
Download and install Android Studio
-
Download / clone this repository to a folder on your computer
-
Create a Firebase project in Firebase Console
-
Create four Android apps, with the following package names
io.homeassistant.companion.android
io.homeassistant.companion.android.debug
io.homeassistant.companion.android.minimal
io.homeassistant.companion.android.minimal.debug
- Now download the
google-services.json
file and place it in the project /app, /car and /wearing folders. This file contains the configuration of the entire project (all four applications). (You can also use the mock services file instead of creating your own. The file must contain the client ID for all the packages listed above for debugging to work correctly. If you don’t create your own file, FCM push notification won’t work at all, only websocket notifications will work). - Start Android Studio, open your source code folder, and check if the Gradle build succeeds using the Build/Make Module “App”. You may need to install the correct Android SDK via Tools / SDK Manager first.
- trends
gradlew assembleDebug
to create all debug versions, it may take some time. - If the build is successful, you can run the app by doing the following: click trends -> Run the app.
- Connect your phone or create a new virtual device following the on-screen instructions.
- 🎉
If you get stuck while setting up your own environment, you can ask the #devs_mobile_apps channel to Discord.
If you want to work with push notifications or use a development build with push notifications, please go to the server-side code HERE and deploy it to your Firebase project. Once you have your androidV1 URL in the deployed service, put it in your ${GRADLE_USER_HOME}/gradle.properties
file, for example:
You can also define the URL of the rate limit function, for example:
The Android app has a full
Taste uses Google Play Services to offer features such as location tracking and notifications. There is also a minimal
taste that does not require Google Play Services and can be found in the release section. The little flavor has no location tracking or notifications.
To build the app for publishing, you need to sign the app. To do this, do the following:
- Create a keystore with a keypair for signing the debug application. In Android Studio: Menu/Build/Generate signed APK, then use the button to create a new keystore. Remember the passwords and the key alias. By default, the keystore must be named
release_keystore.keystore
and should be placed in home-assistant-Android/app and home-assistant-Android/wear folder. - Set the environmental variables used in the
app/build.gradle.kts
:
KEYSTORE_PASSWORD
KEYSTORE_ALIAS
KEYSTORE_ALIAS_PASSWORD
KEYSTORE_PATH
(if your keystore is located differently than stated above)
- trends
gradlew build
- The signed APK is located in your build folder
We use Github Actions to perform continuous integration of both through unit testing, deploying dev releases to Play Store Beta and final release of Play Store when we release. To help test a specific feature/fix users can find the APK on the Actions page for each pull request, this debug APK can be installed alongside the build or beta build.
We use ktlint as our linter. You can run a check locally on your machine using:
This command runs our CI for each PR to check if it passes all tests. So we recommend running it before doing.
To run a check using auto-format:
The project is currently in use Localize to translate the application. If you are interested in helping with the translation go to the link and click start translating!
Create a production release
- Go to the latest Pre-release and change it
- Uncheck the Pre-release box, check the Latest release box, and click Update release
- This should cause the
Play Publish Production
Workflow to implement and manage others for Google Play - Some platforms, such as the Amazon App Store, must be updated manually
- F-Droid uses the
version_code.txt
latest release file to find a new production release and build it themselves, it may take some time
- This should cause the