Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Geofences with Google Location API #914

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,6 +6,7 @@
.idea

# Gradle files
gradle.properties
.gradle
**/build/

Expand Down
3 changes: 3 additions & 0 deletions mobile/build.gradle
Expand Up @@ -105,6 +105,9 @@ dependencies {
implementation 'com.github.loopj:android-smart-image-view:d09783b9508af5996361437a54cc234b662e4c78'
implementation 'com.github.BigBadaboom:androidsvg:3511e136498da94018ef9fa438895984ea9b99db'
implementation 'com.github.apl-devs:appintro:v4.2.2'

// Location Services
fullImplementation 'com.google.android.gms:play-services-location:12.0.1'
// Google Maps
fullImplementation 'com.google.android.gms:play-services-maps:12.0.1'
// GCM
Expand Down
@@ -0,0 +1,17 @@
package org.openhab.habdroid.core;

import android.app.Activity;

public class GeofencingHelper {
private static final String TAG = GeofencingHelper.class.getSimpleName();

public static void setupGeofences(Activity activity) {
}

public static void startSettingsActivity(Activity activity) {
}

public static boolean isGeofenceFeatureAvailable() {
return false;
}
}
14 changes: 14 additions & 0 deletions mobile/src/full/AndroidManifest.xml
Expand Up @@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<!-- geofencing -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<application>
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
Expand All @@ -13,6 +16,13 @@
</intent-filter>
</receiver>

<activity android:name="org.openhab.habdroid.ui.OpenHABGeofenceFragment"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fragment is not an activity. What exactly is the reason for adding this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had the fragment initaly as a activity... will delete that now that its a fragment

android:label="@string/geofencing_title">
android:parentActivityName="org.openhab.habdroid.ui.OpenHABMainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="org.openhab.habdroid.ui.OpenHABMainActivity" />
</activity>
<service
android:name="org.openhab.habdroid.core.GcmMessageListenerService"
android:exported="false">
Expand All @@ -33,6 +43,10 @@
android:name="org.openhab.habdroid.core.GcmRegistrationService"
android:exported="false" />

<service
android:name="org.openhab.habdroid.core.GeofencingService"
android:exported="false"/>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
Expand Down