Skip to content

Commit

Permalink
Alpha application (#4)
Browse files Browse the repository at this point in the history
* Update gitignore

* Remove idea file

* Remove fcm

* Remove test folder

* Clear resources

* Create onboarding activity

* Discovery fragment

* Manual setup fragment

* Authentication fragment

* WebView Activity

* Handle back press

* Save session

* refresh token

* Settings activity

* Clear read me

* Use JSONObject to serialize json.
Check token each time the frontend hit getExternalAuth
Use Android client id
  • Loading branch information
CedrickFlocon authored and balloob committed Nov 2, 2019
1 parent 5cf20a5 commit e54311e
Show file tree
Hide file tree
Showing 75 changed files with 999 additions and 563 deletions.
19 changes: 7 additions & 12 deletions .gitignore
@@ -1,13 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild

local.properties

*.iml
.idea/
.gradle/
build/
147 changes: 0 additions & 147 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/dictionaries/awarecan.xml

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/gradle.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

17 changes: 1 addition & 16 deletions README.md
@@ -1,16 +1 @@
# :iphone: Home Assistant Companion for Android

## Setup Development Environment

- Download and install [Android Studio](https://developer.android.com/studio)

- Create a Firebase project at [Firebase Console](https://console.firebase.google.com)

- Add an Android app to your Firebase project, follow the on screen instruction download the `google-services.json`
to your home-assistant-Android/app folder

- Use Android Studio open your source code folder and click Run -> Run 'app'

- Connect your phone or create a new virtual device following on screen instruction

- :tada:
# :iphone: Home Assistant Companion for Android
9 changes: 5 additions & 4 deletions app/build.gradle
Expand Up @@ -17,8 +17,9 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "com.google.firebase:firebase-core:17.2.0"
implementation "com.google.firebase:firebase-messaging:20.0.0"
}
implementation "androidx.constraintlayout:constraintlayout:1.1.3"

apply plugin: 'com.google.gms.google-services'
implementation "com.squareup.retrofit2:retrofit:2.6.2"
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
implementation "com.squareup.retrofit2:converter-jackson:2.6.2"
}

This file was deleted.

36 changes: 14 additions & 22 deletions app/src/main/AndroidManifest.xml
@@ -1,42 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.homeassistant.android">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".HomeAssistantApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_home" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorPrimary" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<activity android:name=".MainActivity">
android:theme="@style/Theme.HomeAssistant"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">

<activity android:name=".io.homeassistant.android.launch.LaunchActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<activity android:name=".onboarding.OnboardingActivity" />

<activity android:name=".webview.WebViewActivity" />

<activity android:name=".settings.SettingsActivity" />

</application>

</manifest>
14 changes: 14 additions & 0 deletions app/src/main/java/HomeAssistantApplication.kt
@@ -0,0 +1,14 @@
package io.homeassistant.android

import android.app.Application
import io.homeassistant.android.api.Session

class HomeAssistantApplication : Application() {

override fun onCreate() {
super.onCreate()

Session.init(this)
}

}

0 comments on commit e54311e

Please sign in to comment.