android-wear-data-api

NotificationListenerService Wearable

会有一股神秘感。 提交于 2019-12-11 23:44:09
问题 I am trying to implement a way to detect the notifications that are sent to the android wearable devices. After googling around, I have found it is not possible to use notificationListenerService on the wearable. In current implementation, I have implemented the notificationListenerService on the mobile handheld and am using the DataLayer to send the notifications over. My issue is: With the notificationListener, it detects everything that appears. Is there a reliable way to detect which

How to get dimensions of a connected Android Wear device for making bitmaps smaller?

核能气质少年 提交于 2019-12-11 14:18:35
问题 I would like to resize large images for connected Android Wear device. I don't want to transmit large images over Bluetooth. Is there some generic way? I don't want to hardcode screen size for a specific device. 回答1: If you want such kind of optimizations you can ask particular device for a configuration (resolution etc.) For the communication you can use one of WearableApi: https://developer.android.com/training/wearables/data-layer/index.html Either DataApi or MessageApi. But I think you

Send data and wait for the answers with the Wearable Data Layer API

最后都变了- 提交于 2019-12-11 09:03:38
问题 I have a wearable device from which data is sent to a handheld device wrapped in a DataMap object. On the handheld device I implemented a listener service that extends WearableListenerService implemented in this way: public class ListenerService extends WearableListenerService { private static final String TAG = ListenerService.class.toString(); private static final String WEARABLE_DATA_PATH = "/wearable_data"; @Override public void onDataChanged(DataEventBuffer dataEvents) { DataMap dataMap;

Android synchronizing database with wearable - DataMapItems are overwritten

有些话、适合烂在心里 提交于 2019-12-11 02:06:02
问题 I try to synchronize data from a SQLite database on the handheld to a wearable. Therefore I use the Data API with the following code on the handheld: cursor.moveToFirst(); while (!cursor.isAfterLast()) { final PutDataMapRequest putRequest = PutDataMapRequest.create("/SAMPLE"); putRequest.setUrgent(); final DataMap map = putRequest.getDataMap(); int i = 0; for (String columnName: cursor.getColumnNames()) { map.putString(columnName,cursor.getString(i)); i++; } Wearable.DataApi.putDataItem

Sending data from mobile app to Android Wear delay [duplicate]

▼魔方 西西 提交于 2019-12-10 20:02:23
问题 This question already has an answer here : WearListenerService onDataChanged strange behavior (1 answer) Closed 3 years ago . I'm trying to sync data between a settings app and a watch face and I'm having no luck. I've tried using a googleApiClient with listeners & onDataChanged and DataMaps, but there is a huge delay on the wear device to receive the data. (I'm talking like 5 minutes or more from being sent on from the mobile). I've also tried to use Teleport Library for Wearable and I can

Sending data to android wear device

ぐ巨炮叔叔 提交于 2019-12-09 00:34:30
问题 I'm trying to send a String array from my phone to my wear, I've created a service on my phone that is supposed to send the data with this code : public class SendDataService extends Service { private static final String TAG = "SendDataService"; @Override public void onCreate(){ GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { @Override public void onConnected(Bundle connectionHint) { Log.d(TAG,

Create a background service in android wear

早过忘川 提交于 2019-12-08 02:49:09
问题 I have been trying to create an alarm application for my watch for past few days. And unable to find any clue that how we can create a background service for android wear. Even I didn't find anything in the developer guide for android wear. But, I just want to create this application only for android wear and don't want to synchronize data from my cell phone. 回答1: Android Wear is based on the same architecture as regular Android phones. So if you want to create a background service, you do it

Permissions for a WearableListenerService

此生再无相见时 提交于 2019-12-07 07:39:14
问题 I've implemented a WearableListenerService in both my main app and the companion Wear app. In the manifests, the service needs to be declared as android:exported="true" (or not declared at all and left to default to true ) since it's started by Google Play Services. An exported service with no permissions can be called by any app on the system, but I can't find the correct permission to add to the service declaration to secure it. I've looked through the permissions on both the phone and the

Android Wear How Long do DataMap entries Stay Valid

杀马特。学长 韩版系。学妹 提交于 2019-12-07 05:20:58
问题 I'm extending one of my apps to work with Android Wear, and I need to send 4 bitmaps to Wear. I'm using the DataApi and DataMap to do this and it is currently working fine. My question is, how long does data stay synced in the DataApi ? Would I still be able to access them a week later? Is it something I have to manually manage. For instance, if some state would change on the handset, I would need to send different bitmaps. Do I need to remove the ones that are currently there? 回答1: The

Share objects from phone to android wear

為{幸葍}努か 提交于 2019-12-05 21:45:01
I created an app. Within this app, you have objects which contains 2 strings (name and age) and a bitmap (avatar). Everything is saved to a sqlite database. Now I want these objects to be accessible on my smart watch. So I want to achieve that you can go to start, start the application and scroll to the left and right to see these objects. This means I have to retrieve the objects from the phone and get them at the watch. I am currently wondering if I did everything right, or that I should do stuff differently. Whenever you start the application on your watch, I am sending a request to the