wear-os

WearListenerService onDataChanged strange behavior

放肆的年华 提交于 2019-11-28 01:56:00
I want to make bidirectional data transfer between Android Wear and Handheld. All seems to be good except triggering onDataChanged on Handheld. It triggers only then I plug in\out USB cable, connected to the PC. So I don't understand why it's happen. Here is my code: WearListenerService on Handheld: import android.content.Intent; import android.os.Bundle; import android.support.v4.content.LocalBroadcastManager; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.wearable.DataApi; import com.google

Huawei Watch 2 NFC FEATURE not available?. Android Wear 2.0

左心房为你撑大大i 提交于 2019-11-28 01:27:06
问题 In short: On the Huawei Watch 2 it seems like NFC is available and enabled but NFC_FEAUTURE is not, hence nfc is not working properly. Trying to develop the ability to simply read and display NFC tags on the Huawei Watch 2 raises some difficulties: mNfcAdapter.enableForegroundDispatch(this,nfcPendingIntent, nfcIntentFilter, null); raises the error java.lang.UnsupportedOperationException That implies the FEATURE_NFC is not available. In MainActivity onCreate(): mNfcAdapter = NfcAdapter

Android Wear Watchface Settings on host

南楼画角 提交于 2019-11-28 00:28:17
I currently have an android wear watchface developed. I however would now like to create a settings section on the host app that would allow the user to customize the watchface. I am new to the android development so I am curious on the correct way to do this. Is there a way to update a sharedpreference on the host and then push or sync that with the sharedpreference on the wear device? Or is there a totally different way I should be looking at this? You can use the DataApi or MessageApi to sync your watchface configuration between Phone and Watch devices. Please take a look at the

Android Wear Custom Voice Actions

Deadly 提交于 2019-11-28 00:13:55
问题 I'm making an app that will work with Android Wear, And I wanted to implement a command into Google's "Ok Google" option. I saw this page: http://developer.android.com/training/wearables/apps/voice.html But it's related only to apps that include Activities in the Android Wear. I wanted to ask: Can I add custom commands? I mean, those who does not start with the word "Start"? Can I add commands that will do another thing than just opening the app? Like running a method? If it's not the place

Android Wear Notification is not displayed if FLAG_NO_CLEAR is used

那年仲夏 提交于 2019-11-27 23:39:13
问题 If flag " FLAG_NO_CLEAR " is used the notification gets not displayed on the Android Wear. Does anyone know why or any workaround? I didn't find any information in the documentation. I need the flag " FLAG_NO_CLEAR " on my notifications and have Action button for "dismiss", "snooze" etc.! 回答1: Notification flag FLAG_NO_CLEAR basically makes your notification "ongoing". Ongoing notifications posted from phone will NOT be displayed on the wearable device. You have two solutions to your problem

Gradle error: configuration declares dependency which is not declared

左心房为你撑大大i 提交于 2019-11-27 21:12:38
I'm making my first android wear app, but I can't get Android Studio working. First I got the error "Project with path ':wear' could not be found in project ':mobile'. This was resolved by adding "include ':wear" in settings.gradle . But then a new error occurs: "Error:Module version Test2:mobile:unspecified, configuration 'wearApp' declares a dependency on configuration 'default' which is not declared in the module descriptor for Test2:wear:unspecified" . What do I have to do to resolve that error? Just in case it's needed: here's build.gradle : apply plugin: 'com.android.application' android

Android Wear Data Items

不问归期 提交于 2019-11-27 20:49:40
问题 I'm trying to figure out how to sync some data from the phone to the Android Wear device and I've read the article on developer.android.com on Data Items however I'm still not clear on exactly how to use them. Specifically where each code segment (the GoogleApiClient, the Sync, and the Listen) should be implemented both where in the flow of the app code and on which device, phone or wear, or both. Link to developer.android.com page 回答1: Have you looked at the samples for API 20? There is a

Is there any way to detect if the clock is round?

一曲冷凌霜 提交于 2019-11-27 19:47:05
Might be I missed something but is there any flag for knowing if the clock is round or square? I could imagine that this is important if you want to design the background of the notifications. Update for API 23: To determine if the screen is round you can use context.getResources().getConfiguration().isScreenRound() Android reference Or you can use the round and notround resource qualifiers and let the system apply the proper resources but beware that this will not work on devices running API 22 or lower Source Thanks to people who pointed out this change. Old asnwer From google I/O talk (

sendMessage doesn't work properly (Wearable)

三世轮回 提交于 2019-11-27 19:35:46
问题 If I'm sending some bytes using sendMessage from Huawei p9 (Android 6.0) into Android Wear (Sony) the messages are not delivered if the screen of handheld device is turned off. The notifications inside wearable are not updated until the screen in the phone is turned on (in 1 minute)! Will setUrgent help? I already added the application in "list of granded applications" that can work while the screen is off. The application already works in WAKELOCK state. Is it a feature for all Android 6.0

Android Wear App not installed

﹥>﹥吖頭↗ 提交于 2019-11-27 19:07:20
we release our first Wearable Application today but sadly this one isn't get installed automatically as it should. We double checked the APK and the wearable apk is present but never hits the watch. Manually packaging the APK as suggested here http://android-developers.blogspot.de/2014/07/update-on-android-wear-paid-apps.html doesn't helped either. (We know this should only affect paid apps but just to be sure) Is anybody else facing this issue? The app works if we install the APKs over adb. Check your permissions. The Smartphone part needs to have all the permissions the Wear component has.