wear-os

“Default activity not found” for a wearable app created with Android Studio template

半世苍凉 提交于 2019-11-30 16:29:23
问题 I've created a wear app and used the Android Studio template to create it and haven't made any changes other than to drag and drop a button onto the MainActivity of the wear app. When I try and run the watch app in the Run/Debug Configurations is Launch default Activity is ticked then there is an error message saying: "Error: Default Activity not found". I've searched for previous posting on this and the answer is messing around with module sources and stuff. Is that really the correct

Requesting permissions on Android wear

你。 提交于 2019-11-30 16:08:46
I have written an application that takes advantage of system_alert_window on android wear. Since marshmallow this permission is revoked by default. I have enabled this permission on the phone side app from the phone settings. But the permission is still denied on the android wear side app and causes the android wear side app to crash with permission denied exception. Is there a way to enable this permission on Android wear side? Short answer: keep your watch app on targetSdkVersion 22. Long answer: this permission doesn't use the usual requestPermissions() flow. There's more info in the docs ,

Read underlying color/light data from Android Wear heart rate sensor?

删除回忆录丶 提交于 2019-11-30 15:37:36
问题 I'd like to read the heart rate sensor data on an Android Wear smartwatch. The documentation makes it seem like the heart rate sensor only reports two things: Heart rate (in beats per minute) Either an accuracy measure or an error code Is it possible to get the Android Wear heart rate sensor's underlying data, i.e., the amount of red light (or green or blue light) at any point in time, which it uses to determine when the heart beats? The Instant Heart Rate app gets color data from the camera

Does the accelerometer drain battery on Android Wear? (Android watch)

五迷三道 提交于 2019-11-30 15:34:08
I'm creating an Android Wear app that tries to detect some of the hand movements, to do it, I need to continuously monitor the accelerometer output . I'm wondering how it will affect the battery life. For phones, I know that there are methods like "disable accelerometer while screen is turned off" to save battery, but what's the battery cost in case of watches? Since Android watch can count your steps and it turns on the screen when you face it towards your face, I believe the accelerometer is turned-on all the time anyway. in this case, will my app drain the battery? (Calculations after

How to use DataItem of Android Wear

丶灬走出姿态 提交于 2019-11-30 15:07:11
问题 I want to sync preference between handhelds and wearables. I implement sample code on handheld app. PutDataMapRequest dataMap = PutDataMapRequest.create("/count"); dataMap.getDataMap().putInt(COUNT_KEY, count++); PutDataRequest request = dataMap.asPutDataRequest(); PendingResult<DataApi.DataItemResult> pendingResult = Wearable.DataApi .putDataItem(mGoogleApiClient, request); System.out.println(dataMap.getDataMap().getInt("COUNT_KEY"));//print 3 And then implement below code on wearable app.

Is it possible to get PPG(Photoplethysmogram) data from a smart watch via android?

那年仲夏 提交于 2019-11-30 14:21:28
I want to develop a health care app using Android smart watch devices that have an optical heart rate sensor. Examples of such devices are: Samsung gear live, Moto360, LG G watch R, etc. To do this, I need the raw PPG signal data from those devices, but I found that the Android API only supports heart rate data by BPM unit. Does anyone know if the raw signal data is accessible, and if so, how do I get access to that data? Yes, it is possible (at least on a Samsung mobile device such as the S5, S6 etc.). See this link: http://developer.samsung.com/galaxy#sensor-extension From the Samsung

Android Wear type detection - Round Or Square

半腔热情 提交于 2019-11-30 13:17:06
问题 I am curious to know about the wear type, whether it's round or square, because on the basis of device type I want to make different views for round and square. From This Post I got to know that in SDK-20 android.view.View class has a new listener to detect device type, using this I am trying to get the device type but nothing is printing on logcat. Below is the code I tried. public class WearSplash extends Activity implements OnApplyWindowInsetsListener { private WatchViewStub _stub = null;

How to use DataItem of Android Wear

寵の児 提交于 2019-11-30 12:52:13
I want to sync preference between handhelds and wearables. I implement sample code on handheld app. PutDataMapRequest dataMap = PutDataMapRequest.create("/count"); dataMap.getDataMap().putInt(COUNT_KEY, count++); PutDataRequest request = dataMap.asPutDataRequest(); PendingResult<DataApi.DataItemResult> pendingResult = Wearable.DataApi .putDataItem(mGoogleApiClient, request); System.out.println(dataMap.getDataMap().getInt("COUNT_KEY"));//print 3 And then implement below code on wearable app. But saved count can't be retrieved. PutDataMapRequest dataMap = PutDataMapRequest.create("/count"); int

Android wear project with 3 flavors, 3 buildTypes and 2 applicationIdSuffixes

微笑、不失礼 提交于 2019-11-30 10:50:15
When I build my project after trying to combine wearApp flavors and buildTypes with applicationIdSuffixes, i get the following error message: Error:Execution failed for task ':app:handleFirstCustomerTestMicroApk'. > The main and the micro apps do not have the same package name. From my app/build.gradle: buildTypes { debug { applicationIdSuffix '.debug' debuggable true embedMicroApp = true } customerTest { applicationIdSuffix '.customertest' debuggable true embedMicroApp = true } release { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' minifyEnabled

Having trouble reading heart rate sensor from Moto 360 - Android Wear

耗尽温柔 提交于 2019-11-30 10:02:28
Has anyone successfully read the heart rate sensor from the Moto 360? mSensorManager = ((SensorManager)getSystemService(SENSOR_SERVICE)); mHeartRateSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE); I am getting an error that states "SensorManager﹕ sensor or listener is null" I know the Gear Live uses a different ID other than Sensor.TYPE_HEART_RATE...I'm wondering if that's the case with the Moto 360. I tried a sensor value of 65538 which reports itself as a "Wellness Sensor" but that does not appear to return data either. Any advice would be appreciated. I am doing the same on