Recently I've been making a Bus Checker app for Android Wear 2.0, as a standalone app so that iOS users can also use it.
I am obviously getting the location of the watch to get the local bus stops. This means I need to use the following permissions:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Even though my Huawei Watch can get the location of the "watch" through the phone, when publishing the app to the Google Play store, it only becomes supported with the one device that supports GPS: the LG Watch Urbane 2nd Edition LTE.
I really don't know what to do here, I want to publish my app for devices that don't have GPS and just get GPS from the phone, but to get GPS from the phone I need those permissions and those permissions cause the Huawei Watch and other non-GPS devices to become unsupported.
I have tried adding this to my manifest to test whether the Huawei Watch would become supported:
<uses-feature android:name="android.hardware.LOCATION" android:required="false" />
<uses-feature android:name="android.hardware.location.GPS" android:required="false" />
<uses-feature android:name="android.hardware.location.NETWORK" android:required="false" />
But unfortunately, it didn't work. The compatibility is definitely based on the permissions and not the features required. I also tried this with a blank Hello World app to no avail.
If it is of any relevance, here is my app manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.buschecker.williamvenner.buschecker">
<uses-feature android:name="android.hardware.type.watch" android:required="true" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:supportsRtl="true"
android:theme="@android:style/Theme.DeviceDefault">
<uses-library android:name="com.google.android.wearable" android:required="false" />
<activity android:name=".MainActivity" android:label="@string/app_name"
android:theme="@android:style/Theme.DeviceDefault.Light">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BusStopView"
android:theme="@android:style/Theme.DeviceDefault.Light">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
My Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.buschecker.williamvenner.buschecker"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:2.0.0-beta2'
compile 'com.google.android.gms:play-services-wearable:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
provided 'com.google.android.wearable:wearable:2.0.0-beta2'
wearApp project(':app')
}
My project structure can be found here.