wear-os

How to detect if android device is paired with android wear watch

▼魔方 西西 提交于 2019-11-27 07:38:15
I am creating an android wear app that extends push notifications. My app downloads approximately 10 images from a server when a push notification comes in and displays these additional images on the watch. These images are specific to the android wear app and are not shown on the handheld device. How do I tell if the handheld device is paired with an android wear device so that I can determine if it is necessary to download the additional images required for the wear app? Thanks! You need to use the NodeApi , in particular NodeApi.getConnectedNodes() . For example (from a background thread --

WearableListenerService, onDataChanged() is not called

痞子三分冷 提交于 2019-11-27 06:37:45
问题 I followed the tutorial to invoke a Wearable activity from phone, posted here How to send notification from handheld to wear to open Activity on wear device. However, I grab the source code from the answer. However, I couldn't get it running. It looks like onDataChanged() is never called. I ask this as a question on its own because it seems the example works for others. I'm on KitKat 4.4.2, if that matters. Any tip where to check, thanks. 回答1: There are two things you can check: packageName

How to access heart rate sensor in Android Wearable?

风格不统一 提交于 2019-11-27 05:56:17
问题 I am having problems accessing heart rate sensor on Moto 360. I tried following things : Sensor mHeartRateSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE); mSensorManager.registerListener(this, mHeartRateSensor, SensorManager.SENSOR_DELAY_NORMAL); and then implement SensorEventListener interface : @Override public void onSensorChanged(SensorEvent event) { String TAG = "tag"; Log.i(TAG, "--------------------------"); Log.i(TAG, msg); Log.i(TAG, ""+ event.sensor.getType()); Log

“No, missing feature: WATCH” when I try to run my smartphone app with wear app?

爷,独闯天下 提交于 2019-11-27 05:42:57
问题 I have a smartphone app with a wear app that has been packaged inside of it, similar to the first two steps of this section: https://developer.android.com/training/wearables/apps/packaging.html#Studio I was originally told that my smartphone wasn't running an SDK large enough to support the app (my phone was using KitKat, apparently I needed API 20), so now I am using my Nexus 7 with Android L preview, and this problem has appeared: I have a smartwatch emulator and tablet running, and both

Android Wear Watchface Settings on host

一世执手 提交于 2019-11-27 04:46:03
问题 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? 回答1: You can use the DataApi or MessageApi

Android compile error; Java plugin has been applied, not compatible with android

非 Y 不嫁゛ 提交于 2019-11-27 03:03:26
问题 So I've made a wearable application where I can control a robot-car with the buttons on screen with the MessageListenerService. After trying to build the project, I had some problems where it asked me to install "Android Support Repository" from the SDK, which I already had. I found another similar problem on SO (link) which had a sort-of solution, but now it says "Error: The java Plugin has been applied, but it is not compatible with the Android Plugins" This is my build.gradle in my

Google Play services out of date. Requires 11011000 but found 10289574

时光怂恿深爱的人放手 提交于 2019-11-27 02:07:44
I've been strugling with this problem about week now. Been searching similar topics about this but still can't resolve my problem. The Prolem is that when i'm trying to run my program on Polar m600 wear or wear emulator (Android V 7.1.1 and API25) they'r giving me this message "Google Play services out of date. Requires 11011000 but found 10289574". I've followed the "Getting the Last Known Location" part in the android developer site. (Link for the site https://developer.android.com/training/location/retrieve-current.html#play-services ) Here's my Mainactivity code which i'm using public

Not able to connect Android Wear Emulator with Device

一笑奈何 提交于 2019-11-27 00:53:06
问题 I am not able to connect Android Wear Emulator with my device.I have HTC One device which has 4.4 (KitKat OS). I follow below link : Setting up Android Wear But, when I execute the line adb -d forward tcp:5601 tcp:5601 through command prompt,nothing happens.Android Wear emulator does not show device connected. Note : I am able to launch the Android Wear Preview app successfully in my device and Notifications settings is also enabled. Any help will be appreciated. 回答1: @Lance Nanek basically

WearListenerService onDataChanged strange behavior

时光总嘲笑我的痴心妄想 提交于 2019-11-26 22:02:56
问题 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

Direct internet connection on Android Wear?

爱⌒轻易说出口 提交于 2019-11-26 21:21:57
问题 I tried to build an app showing some pictures from the internet. I used a function, which works great on my Phone (Galaxy S3 - Android 4.3) but on the watch i get a java.io.EOFException exception. The code (works on phone): private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> { ImageView bmImage; public DownloadImageTask(ImageView bmImage) { this.bmImage = bmImage; } protected Bitmap doInBackground(String... urls) { String urldisplay = urls[0]; Bitmap mIcon11 = null; try {